Skip to content

Commit

Permalink
fix(analytics): Improve text styling and add translations on ToS Scre…
Browse files Browse the repository at this point in the history
…ens (#2616)
  • Loading branch information
michaeljscript authored Aug 16, 2023
1 parent 9df56a4 commit 0a3deac
Showing 9 changed files with 42 additions and 20 deletions.
14 changes: 11 additions & 3 deletions apps/wallet-mobile/src/components/BlueCheckbox/BlueCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -10,16 +10,17 @@ export type BlueCheckboxProps = {
onPress?: () => void
children?: ReactNode
style?: StyleProp<ViewStyle>
spacing?: number
}

export const BlueCheckbox = ({checked, onPress, children, style}: BlueCheckboxProps) => {
export const BlueCheckbox = ({checked, onPress, children, style, spacing = 15}: BlueCheckboxProps) => {
return (
<TouchableOpacity style={[styles.checkboxRow, style]} onPress={onPress}>
{checked ? <CheckboxChecked /> : <CheckboxNotChecked />}

<Spacer width={15} />
<Spacer width={spacing} />

<View style={{flexDirection: 'row'}}>{children}</View>
<View style={styles.textRow}>{children}</View>
</TouchableOpacity>
)
}
@@ -73,4 +74,11 @@ const styles = StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
},
textRow: {
flexDirection: 'row',
flexWrap: 'wrap',
flex: 1,
justifyContent: 'flex-start',
alignItems: 'flex-start',
},
})
3 changes: 2 additions & 1 deletion apps/wallet-mobile/src/components/YoroiLogo/YoroiLogo.tsx
Original file line number Diff line number Diff line change
@@ -61,13 +61,14 @@ const styles = StyleSheet.create({
color: COLORS.SHELLEY_BLUE,
fontSize: 30,
fontWeight: '500',
fontFamily: 'Rubik',
fontFamily: 'Rubik-Bold',
},
yoroiLogoText: {
fontSize: 14,
fontWeight: '400',
fontFamily: 'Rubik',
lineHeight: 22,
color: '#000000',
},
})

Original file line number Diff line number Diff line change
@@ -55,15 +55,19 @@ export const InitialScreen = () => {

<Spacer height={8} />

<BlueCheckbox checked={tosAccepted} onPress={onPressTosCheckbox} style={styles.checkbox}>
<BlueCheckbox checked={tosAccepted} spacing={8} onPress={onPressTosCheckbox} style={styles.checkbox}>
<View style={styles.checkboxRow}>
<Text style={styles.checkboxText}>{`${strings.tosIAgreeWith} `}</Text>

<TouchableOpacity onPress={onTosLinkPress}>
<Text style={[styles.checkboxText, styles.checkboxLink]}>{strings.tosAgreement}</Text>
</TouchableOpacity>

<Text style={styles.checkboxText}>{` ${strings.tosAnd} `}</Text>
<Text style={styles.checkboxText}>{` `}</Text>

<Text style={styles.checkboxText}>{strings.tosAnd}</Text>

<Text style={styles.checkboxText}>{` `}</Text>

<TouchableOpacity onPress={onPrivacyLinkPress}>
<Text style={[styles.checkboxText, styles.checkboxLink]}>{strings.privacyPolicy}</Text>
@@ -103,7 +107,7 @@ const styles = StyleSheet.create({
title: {
fontSize: 20,
fontWeight: '500',
fontFamily: 'Rubik',
fontFamily: 'Rubik-Bold',
lineHeight: 30,
textAlign: 'center',
color: '#242838',
Original file line number Diff line number Diff line change
@@ -44,15 +44,19 @@ export const TermsOfServiceChangedScreen = () => {

<Spacer height={24} />

<BlueCheckbox checked={accepted} onPress={onPressCheckbox} style={styles.checkbox}>
<BlueCheckbox checked={accepted} spacing={8} onPress={onPressCheckbox} style={styles.checkbox}>
<View style={styles.checkboxRow}>
<Text style={styles.checkboxText}>{`${strings.tosIAgreeWith} `}</Text>

<TouchableOpacity onPress={onTosLinkPress}>
<Text style={[styles.checkboxText, styles.checkboxLink]}>{strings.tosAgreement}</Text>
</TouchableOpacity>

<Text style={styles.checkboxText}>{` ${strings.tosAnd} `}</Text>
<Text style={styles.checkboxText}>{` `}</Text>

<Text style={styles.checkboxText}>{strings.tosAnd}</Text>

<Text style={styles.checkboxText}>{` `}</Text>

<TouchableOpacity onPress={onPrivacyLinkPress}>
<Text style={[styles.checkboxText, styles.checkboxLink]}>{strings.privacyPolicy}</Text>
@@ -84,21 +88,24 @@ const styles = StyleSheet.create({
title: {
fontSize: 20,
fontWeight: '500',
fontFamily: 'Rubik',
fontFamily: 'Rubik-Bold',
lineHeight: 30,
textAlign: 'center',
color: '#242838',
},
description: {
fontSize: 16,
fontWeight: '400',
fontFamily: 'Rubik',
lineHeight: 24,
textAlign: 'center',
color: '#383E54',
},
checkboxText: {
fontFamily: 'Rubik',
fontSize: 16,
lineHeight: 18,
color: '#000000',
},
checkboxLink: {
color: COLORS.DARK_BLUE,
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@ const messages = defineMessages({
defaultMessage: '!!!and',
},
privacyPolicy: {
id: 'analytics.privacyPolicy',
defaultMessage: '!!!Privacy Policy',
id: 'analytics.privacyNotice',
defaultMessage: '!!!Privacy Notice',
},
tosAgreement: {
id: 'analytics.tosAgreement',
4 changes: 3 additions & 1 deletion apps/wallet-mobile/src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
@@ -669,5 +669,7 @@
"termsOfService.tosAgreement": "Terms Of Service Agreement",
"toggleAnalyticsSettings.analyticsTitle": "User Insights",
"termsOfService.privacyPolicyTitle": "Privacy Policy",
"analytics.privacyPolicy": "Privacy Policy"
"analytics.privacyPolicy": "Privacy Policy",
"analytics.privacyNotice": "Privacy Notice",
"analytics.tosAnd": "and"
}
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/legacy/config.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ const _LOG_LEVEL = __DEV__ ? LogLevel.Debug : LogLevel.Warn

const FORCE_CRASH_REPORTS = isNightly()

const AGREEMENT_DATE = 2
const AGREEMENT_DATE = 3

export const CONFIG = {
SENTRY_DSN,
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@
"defaultMessage": "!!!Light wallet for Cardano assets",
"file": "src/components/YoroiLogo/YoroiLogo.tsx",
"start": {
"line": 83,
"line": 84,
"column": 8,
"index": 2116
"index": 2143
},
"end": {
"line": 86,
"line": 87,
"column": 3,
"index": 2211
"index": 2238
}
}
]
Original file line number Diff line number Diff line change
@@ -45,8 +45,8 @@
}
},
{
"id": "analytics.privacyPolicy",
"defaultMessage": "!!!Privacy Policy",
"id": "analytics.privacyNotice",
"defaultMessage": "!!!Privacy Notice",
"file": "src/features/Initialization/common/strings.tsx",
"start": {
"line": 34,

0 comments on commit 0a3deac

Please sign in to comment.