From 25e3c93e1e9f5ab84d56ccbab7d63be219a590ac Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Sun, 6 Oct 2024 08:22:00 +0900 Subject: Improve localization of {els} string on Create Account page (#3912) Co-authored-by: Hailey --- src/screens/Signup/StepInfo/Policies.tsx | 83 ++++++++++++++++++++------------ src/screens/Signup/index.tsx | 3 +- 2 files changed, 54 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/screens/Signup/StepInfo/Policies.tsx b/src/screens/Signup/StepInfo/Policies.tsx index a3a067222..ba0cfc2b4 100644 --- a/src/screens/Signup/StepInfo/Policies.tsx +++ b/src/screens/Signup/StepInfo/Policies.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, {ReactElement} from 'react' import {View} from 'react-native' import {ComAtprotoServerDescribeServer} from '@atproto/api' import {msg, Trans} from '@lingui/macro' @@ -42,43 +42,64 @@ export const Policies = ({ ) } - const els = [] - if (tos) { - els.push( - - {_(msg`Terms of Service`)} - , + let els: ReactElement + if (tos && pp) { + els = ( + + By creating an account you agree to the{' '} + + Terms of Service + {' '} + and{' '} + + Privacy Policy + + . + ) - } - if (pp) { - els.push( - - {_(msg`Privacy Policy`)} - , + } else if (tos) { + els = ( + + By creating an account you agree to the{' '} + + Terms of Service + + . + ) - } - if (els.length === 2) { - els.splice( - 1, - 0, - - {' '} - and{' '} - , + } else if (pp) { + els = ( + + By creating an account you agree to the{' '} + + Privacy Policy + + . + ) + } else { + return null } return ( - - By creating an account you agree to the {els}. - + {els ? ( + + {els} + + ) : null} {under13 ? ( diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx index e3da053c0..1857981a0 100644 --- a/src/screens/Signup/index.tsx +++ b/src/screens/Signup/index.tsx @@ -168,7 +168,8 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { - + Having trouble?{' '}