diff --git a/src/common/constants/screens.ts b/src/common/constants/screens.ts index 654a93caa..6d18437ac 100644 --- a/src/common/constants/screens.ts +++ b/src/common/constants/screens.ts @@ -8,7 +8,6 @@ const screens = { Passcode: 'app.Setup.Passcode', Biometric: 'app.Setup.Biometric', PushNotification: 'app.Setup.PushNotification', - Disclaimers: 'app.Setup.Disclaimers', Finish: 'app.Setup.Finish', }, TabBar: { diff --git a/src/screens/Setup/Biometry/BiometryView.tsx b/src/screens/Setup/Biometry/BiometryView.tsx index c67aac2b1..bf38f9719 100644 --- a/src/screens/Setup/Biometry/BiometryView.tsx +++ b/src/screens/Setup/Biometry/BiometryView.tsx @@ -20,7 +20,7 @@ import { Button, Spacer, Footer } from '@components/General'; import Localize from '@locale'; -import { DisclaimersSetupViewProps } from '@screens/Setup/Disclaimers'; +import { FinishSetupViewProps } from '@screens/Setup/Finish'; import { PushNotificationSetupViewProps } from '@screens/Setup/PushNotification'; import { AppStyles } from '@theme'; @@ -106,7 +106,7 @@ class BiometrySetupView extends Component { PushNotificationsService.checkPermission() .then((granted) => { if (granted) { - Navigator.push(AppScreens.Setup.Disclaimers, {}); + Navigator.push(AppScreens.Setup.Finish, {}); return; } diff --git a/src/screens/Setup/Disclaimers/DisclaimersView.tsx b/src/screens/Setup/Disclaimers/DisclaimersView.tsx deleted file mode 100644 index 23055a9f5..000000000 --- a/src/screens/Setup/Disclaimers/DisclaimersView.tsx +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Setup Disclaimers Screen - */ - -import React, { Component } from 'react'; - -import { View, SafeAreaView, Image, Text, Platform, LayoutAnimation } from 'react-native'; - -import { Navigator } from '@common/helpers/navigator'; -import { AppScreens } from '@common/constants'; - -import StyleService from '@services/StyleService'; - -import { Footer, NumberSteps, Spacer, ProgressBar, CheckBox } from '@components/General'; - -import Localize from '@locale'; - -import { FinishSetupViewProps } from '@screens/Setup/Finish'; - -import { AppStyles } from '@theme'; -import styles from './styles'; - -/* types ==================================================================== */ -export interface Props {} - -export interface State { - isProgressing: boolean; - agreed: boolean; - currentStep: number; -} - -/* Component ==================================================================== */ -class DisclaimersView extends Component { - static screenName = AppScreens.Setup.Disclaimers; - - private progressBarRef: React.RefObject; - - static options() { - return { - topBar: { - visible: false, - }, - }; - } - - constructor(props: Props) { - super(props); - - this.state = { - isProgressing: true, - agreed: false, - currentStep: 0, - }; - - this.progressBarRef = React.createRef(); - } - - componentDidMount() { - this.startProgress(); - } - - startProgress = () => { - this.setState({ - isProgressing: true, - agreed: false, - }); - - this.progressBarRef?.current?.fill(10000, () => { - this.setState({ - isProgressing: false, - }); - }); - }; - - onStepChange = (index: number) => { - this.setState({ - currentStep: index, - }); - }; - - onAgreePress = () => { - const { currentStep } = this.state; - - this.setState({ - agreed: true, - }); - - if (currentStep === 6) { - Navigator.push(AppScreens.Setup.Finish, {}); - return; - } - - setTimeout(() => { - if (Platform.OS === 'ios') { - LayoutAnimation.easeInEaseOut(); - } - - this.setState( - { - currentStep: currentStep + 1, - }, - this.startProgress, - ); - }, 1000); - }; - - getStepContent = () => { - const { currentStep } = this.state; - - switch (currentStep) { - case 0: - return { - title: Localize.t('setupTermOfService.XamanIsNonCustodial'), - content: Localize.t('setupTermOfService.XamanNotCustodialExplain'), - button: undefined, - }; - case 1: - return { - title: Localize.t('setupTermOfService.keepYourSecretsSafe'), - content: Localize.t('setupTermOfService.KeepYourSecretsSafeExplain'), - button: Localize.t('setupTermOfService.IWillKeepMySecretsSafeAndOffline'), - }; - case 2: - return { - title: Localize.t('setupTermOfService.transactionsArePermanent'), - content: Localize.t('setupTermOfService.transactionsArePermanentExplain'), - button: Localize.t('setupTermOfService.iAmResponsibleForKeepingMyKeysAndFundsSafe'), - }; - case 3: - return { - title: Localize.t('setupTermOfService.yourFundsLiveOnTheXRPLedger'), - content: Localize.t('setupTermOfService.yourFundsLiveOnTheXRPLedgerExplain'), - button: Localize.t('setupTermOfService.myFundsAreRegisteredOnTheXRPLedger'), - }; - case 4: - return { - title: Localize.t('setupTermOfService.neverShareYourSecret'), - content: Localize.t('setupTermOfService.neverShareYourSecretExplain'), - button: Localize.t('setupTermOfService.IWillNeverGiveMySecretsToAnyone'), - }; - case 5: - return { - title: Localize.t('setupTermOfService.whenYouChangeYourPhone'), - content: Localize.t('setupTermOfService.whenYouChangeYourPhoneExplain'), - button: Localize.t('setupTermOfService.IWillKeepMySecretsSafeSoICanReEnterThemIfIGetANewPhone'), - }; - case 6: - return { - title: Localize.t('setupTermOfService.questionsAndSupport'), - content: Localize.t('setupTermOfService.questionsAndSupportExplain'), - button: Localize.t('setupTermOfService.IOnlyTrustAnswersFromXamanSupportTeam'), - }; - default: - return {}; - } - }; - - render() { - const { currentStep, isProgressing, agreed } = this.state; - - const content = this.getStepContent(); - - return ( - - - - - - - - - - - {currentStep + 1}. {content.title} - - - {content.content} - - -
- - - {isProgressing ? ( - - {Localize.t('setupTermOfService.pleaseReadTheTextAboveCarefully')} - - ) : ( - - )} - -
-
- ); - } -} - -/* Export Component ==================================================================== */ -export default DisclaimersView; diff --git a/src/screens/Setup/Disclaimers/index.ts b/src/screens/Setup/Disclaimers/index.ts deleted file mode 100644 index 6e0abcbb8..000000000 --- a/src/screens/Setup/Disclaimers/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import DisclaimersSetupView, { Props as DisclaimersSetupViewProps } from './DisclaimersView'; - -export type { DisclaimersSetupViewProps }; -export default DisclaimersSetupView; diff --git a/src/screens/Setup/Disclaimers/styles.ts b/src/screens/Setup/Disclaimers/styles.ts deleted file mode 100644 index 6eb24c413..000000000 --- a/src/screens/Setup/Disclaimers/styles.ts +++ /dev/null @@ -1,41 +0,0 @@ -import StyleService from '@services/StyleService'; - -import { AppSizes } from '@theme'; - -const styles = StyleService.create({ - container: { - flex: 1, - justifyContent: 'center', - backgroundColor: '$background', - }, - contentContainer: { - flex: 1, - padding: 35, - }, - logo: { - width: AppSizes.screen.width * 0.4, - height: AppSizes.screen.height * 0.1, - resizeMode: 'contain', - }, - footerStyle: { - backgroundColor: '$background', - height: 120, - width: '100%', - flexDirection: 'row', - padding: 0, - borderTopWidth: 5, - borderColor: '$tint', - }, - footerContent: { - width: '90%', - height: '100%', - justifyContent: 'center', - }, - progressBar: { - position: 'absolute', - left: 0, - top: -5, - }, -}); - -export default styles; diff --git a/src/screens/Setup/Passcode/PasscodeView.tsx b/src/screens/Setup/Passcode/PasscodeView.tsx index 10c47f04b..5647a17b3 100644 --- a/src/screens/Setup/Passcode/PasscodeView.tsx +++ b/src/screens/Setup/Passcode/PasscodeView.tsx @@ -21,7 +21,7 @@ import { Button, Spacer, Footer, PinInput, InfoMessage } from '@components/Gener import Localize from '@locale'; -import { DisclaimersSetupViewProps } from '@screens/Setup/Disclaimers'; +import { FinishSetupViewProps } from '@screens/Setup/Finish'; import { BiometrySetupViewProps } from '@screens/Setup/Biometry'; import { PushNotificationSetupViewProps } from '@screens/Setup/PushNotification'; @@ -103,7 +103,7 @@ class PasscodeSetupView extends Component { // if push notification already granted then go to last part const granted = await PushNotificationsService.checkPermission(); if (granted) { - Navigator.push(AppScreens.Setup.Disclaimers, {}); + Navigator.push(AppScreens.Setup.Finish, {}); return; } diff --git a/src/screens/Setup/PushNotification/PushNotificationView.tsx b/src/screens/Setup/PushNotification/PushNotificationView.tsx index f36259b67..d3f19fbe9 100644 --- a/src/screens/Setup/PushNotification/PushNotificationView.tsx +++ b/src/screens/Setup/PushNotification/PushNotificationView.tsx @@ -15,7 +15,7 @@ import { Footer, Button, Spacer } from '@components/General'; import Localize from '@locale'; -import { DisclaimersSetupViewProps } from '@screens/Setup/Disclaimers'; +import { FinishSetupViewProps } from '@screens/Setup/Finish'; import { AppStyles } from '@theme'; import styles from './styles'; @@ -85,7 +85,7 @@ class PushNotificationSetupView extends Component { }; nextStep = () => { - Navigator.push(AppScreens.Setup.Disclaimers, {}); + Navigator.push(AppScreens.Setup.Finish, {}); }; render() { diff --git a/src/screens/index.ts b/src/screens/index.ts index 244736467..dcae134c0 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -3,7 +3,6 @@ import Onboarding from './Onboarding'; import PasscodeSetup from './Setup/Passcode'; import BiometrySetup from './Setup/Biometry'; import PushNotificationSetup from './Setup/PushNotification'; -import DisclaimersSetup from './Setup/Disclaimers'; import FinishSetup from './Setup/Finish'; // TabBar @@ -103,7 +102,6 @@ export { PasscodeSetup, BiometrySetup, PushNotificationSetup, - DisclaimersSetup, FinishSetup, Home, Events,