Skip to content

Commit

Permalink
Conclude 'uspSigninCta' experiment
Browse files Browse the repository at this point in the history
In favor of the 'alreadyHaveAccount' variant
  • Loading branch information
Jon-edge committed Jan 3, 2025
1 parent 4f9b4b3 commit 55bfdf2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- fixed: Only send successful import items to completion scene
- fixed: WalletConnect `eth_sendRawTransaction` event handling
- removed: Removed patch for usb and node-hid
- removed: 'uspSigninCta' experiment in favor of the 'alreadyHaveAccount' variant

## 4.19.1 (2024-12-19)

Expand Down
23 changes: 5 additions & 18 deletions src/components/scenes/GettingStartedScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import uspImage1 from '../../assets/images/gettingStarted/usp1.png'
import uspImage2 from '../../assets/images/gettingStarted/usp2.png'
import uspImage3 from '../../assets/images/gettingStarted/usp3.png'
import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings'
import { ExperimentConfig, UspSigninCtaType } from '../../experimentConfig'
import { ExperimentConfig } from '../../experimentConfig'
import { useHandler } from '../../hooks/useHandler'
import { lstrings } from '../../locales/strings'
import { useDispatch, useSelector } from '../../types/reactRedux'
Expand Down Expand Up @@ -157,7 +157,6 @@ export const GettingStartedScene = (props: Props) => {
)

const footerButtons =
experimentConfig.uspSigninCta === 'alreadyHaveAccount' ? (
<>
<ButtonsView
layout="column"
Expand All @@ -174,18 +173,7 @@ export const GettingStartedScene = (props: Props) => {
</TertiaryText>
</TertiaryTouchable>
</>
) : (
<ButtonsView
primary={{
label: lstrings.account_get_started,
onPress: handlePressSignUp
}}
secondary={{
label: lstrings.getting_started_sign_in,
onPress: handlePressSignIn
}}
/>
)


return (
<SceneWrapper hasHeader={false}>
Expand Down Expand Up @@ -259,7 +247,7 @@ export const GettingStartedScene = (props: Props) => {
))}
</Pagination>
<SectionCoverAnimated swipeOffset={swipeOffset}>
<Sections swipeOffset={swipeOffset} uspSigninCta={experimentConfig.uspSigninCta}>
<Sections swipeOffset={swipeOffset}>
{sections.map((section, index) => {
return (
<Section key={section.key} swipeOffset={swipeOffset} itemIndex={index + 1}>
Expand Down Expand Up @@ -478,12 +466,11 @@ const SectionCoverAnimated = styled(Animated.View)<{

const Sections = styled(Animated.View)<{
swipeOffset: SharedValue<number>
uspSigninCta: UspSigninCtaType
}>(theme => props => {
const { swipeOffset, uspSigninCta } = props
const { swipeOffset } = props
return [
{
paddingBottom: uspSigninCta === 'alreadyHaveAccount' ? theme.rem(1) : theme.rem(-0.5)
paddingBottom: theme.rem(1)
},
useAnimatedStyle(() => {
const flexGrow = interpolate(swipeOffset.value, [0, 1], [0, 1.5])
Expand Down
10 changes: 2 additions & 8 deletions src/experimentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@ import { LOCAL_EXPERIMENT_CONFIG } from './constants/constantSettings'
import { ENV } from './env'
import { isMaestro } from './util/maestro'

export type UspSigninCtaType = 'alreadyHaveAccount' | 'signIn'

// Persistent experiment config for A/B testing. Values initialized in this
// config persist throughout the liftetime of the app install.
export interface ExperimentConfig {
signupCaptcha: 'withCaptcha' | 'withoutCaptcha'
uspSigninCta: UspSigninCtaType
}

// Defined default "unchanged" values before experimentation.
export const DEFAULT_EXPERIMENT_CONFIG: ExperimentConfig = {
signupCaptcha: 'withoutCaptcha',
uspSigninCta: 'alreadyHaveAccount'
}

const experimentConfigDisklet = makeReactNativeDisklet()

// The probability of an experiment config feature being set for a given key
const experimentDistribution = {
signupCaptcha: [50, 50],
uspSigninCta: [50, 50]
signupCaptcha: [50, 50]
}

/**
Expand Down Expand Up @@ -65,8 +60,7 @@ const generateExperimentConfigVal = <T>(key: keyof typeof experimentDistribution
}

const asExperimentConfig: Cleaner<ExperimentConfig> = asObject({
signupCaptcha: asMaybe(asValue('withoutCaptcha', 'withCaptcha'), generateExperimentConfigVal('signupCaptcha', ['withoutCaptcha', 'withCaptcha'])),
uspSigninCta: asMaybe(asValue('alreadyHaveAccount', 'signIn'), generateExperimentConfigVal('uspSigninCta', ['alreadyHaveAccount', 'signIn']))
signupCaptcha: asMaybe(asValue('withoutCaptcha', 'withCaptcha'), generateExperimentConfigVal('signupCaptcha', ['withoutCaptcha', 'withCaptcha']))
})

/**
Expand Down

0 comments on commit 55bfdf2

Please sign in to comment.