From d1e85651ca2431db99ad76c7d669a2d85911b10d Mon Sep 17 00:00:00 2001 From: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:34:05 +0530 Subject: [PATCH] [INJI-691] add backup and restore screen Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> --- assets/google-drive-28.svg | 1 + components/ui/svg.tsx | 5 + screens/Settings/BackupAndRestoreScreen.tsx | 225 ++++++++++++++++++++ screens/Settings/BackupToggle.tsx | 5 +- 4 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 assets/google-drive-28.svg create mode 100644 screens/Settings/BackupAndRestoreScreen.tsx diff --git a/assets/google-drive-28.svg b/assets/google-drive-28.svg new file mode 100644 index 00000000..d999a543 --- /dev/null +++ b/assets/google-drive-28.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/ui/svg.tsx b/components/ui/svg.tsx index 868cf217..282f912a 100644 --- a/components/ui/svg.tsx +++ b/components/ui/svg.tsx @@ -20,6 +20,7 @@ import SuccessLogo from '../../assets/Success_Message_Icon1.svg'; import NoInternetConnection from '../../assets/No_Internet_Connection.svg'; import SomethingWentWrong from '../../assets/Something_Went_Wrong.svg'; import MagnifierZoom from '../../assets/Magnifier_Zoom.svg'; +import GoogleDriveIcon from '../../assets/google-drive-28.svg'; import {displayType} from '../../machines/issuersMachine'; import {IssuerProps} from '../openId4VCI/Issuer'; import { @@ -203,6 +204,10 @@ export class SvgImage { static MagnifierZoom() { return ; } + + static GoogleDriveIcon() { + return ; + } } function getIssuerLogo(props: displayType) { diff --git a/screens/Settings/BackupAndRestoreScreen.tsx b/screens/Settings/BackupAndRestoreScreen.tsx new file mode 100644 index 00000000..231b9029 --- /dev/null +++ b/screens/Settings/BackupAndRestoreScreen.tsx @@ -0,0 +1,225 @@ +import React from 'react'; +import {View} from 'react-native'; +import {Icon, ListItem} from 'react-native-elements'; +import {Button, Column, Row, Text} from '../../components/ui'; +import {Modal} from '../../components/ui/Modal'; +import {Theme} from '../../components/ui/styleUtils'; +import {useBackupScreen} from './BackupController'; +import {SvgImage} from '../../components/ui/svg'; + +const SectionLayout: React.FC = ({ + headerIcon, + headerText, + children, +}) => { + return ( + + + {headerIcon} + + {headerText} + + + + + {children} + + + ); +}; + +type SectionLayoutProps = { + headerIcon?: React.ReactNode; + headerText: string; + children: React.ReactNode; +}; + +const AccountInformation: React.FC = ({ + associatedAccount, + email, +}) => { + return ( + + + + + + + + {associatedAccount} + + + + + {email} + + + + + ); +}; + +type AccountInformationProps = { + associatedAccount: string; + email: string; +}; + +const BackupAndRestoreScreen = () => { + const controller = useBackupScreen(); + const LastBackup = ( + + + + + Backup your Data to Google Drive. You can restore them when you + reinstall INJI. + + + + +