Skip to content

Commit

Permalink
Merge pull request #5417 from EdgeApp/jon/usp-signin-buttons
Browse files Browse the repository at this point in the history
Conclude 'uspSigninCta' experiment
  • Loading branch information
Jon-edge authored Jan 4, 2025
2 parents 2ae42bc + cd503c9 commit e9b98bb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 38 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
45 changes: 16 additions & 29 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 @@ -156,36 +156,24 @@ export const GettingStartedScene = (props: Props) => {
}
)

const footerButtons =
experimentConfig.uspSigninCta === 'alreadyHaveAccount' ? (
<>
<ButtonsView
layout="column"
primary={{
label: lstrings.account_get_started,
onPress: handlePressSignUp
}}
/>
<TertiaryTouchable onPress={handlePressSignIn}>
<TertiaryText>
{/* eslint-disable-next-line react-native/no-raw-text */}
{`${lstrings.getting_started_already_have_an_account} `}
<TappableText>{lstrings.getting_started_sign_in}</TappableText>
</TertiaryText>
</TertiaryTouchable>
</>
) : (
const footerButtons = (
<>
<ButtonsView
layout="column"
primary={{
label: lstrings.account_get_started,
onPress: handlePressSignUp
}}
secondary={{
label: lstrings.getting_started_sign_in,
onPress: handlePressSignIn
}}
/>
)
<TertiaryTouchable onPress={handlePressSignIn}>
<TertiaryText>
{/* eslint-disable-next-line react-native/no-raw-text */}
{`${lstrings.getting_started_already_have_an_account} `}
<TappableText>{lstrings.getting_started_sign_in}</TappableText>
</TertiaryText>
</TertiaryTouchable>
</>
)

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
12 changes: 3 additions & 9 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'
signupCaptcha: 'withoutCaptcha'
}

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 e9b98bb

Please sign in to comment.