Skip to content

Commit 5a407a1

Browse files
ieowsmgv
andcommitted
feat: new UI flow for manual account backup for srp
Co-authored-by: smgv <gpatra1996@gmail.com>
1 parent 0f1a9db commit 5a407a1

File tree

39 files changed

+1944
-1823
lines changed

39 files changed

+1944
-1823
lines changed

android/settings.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ dependencyResolutionManagement {
3939
include ':app'
4040
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile())
4141
includeBuild('../node_modules/@react-native') {}
42-
include ':@react-native-community_blur'
43-
project(':@react-native-community_blur').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/blur/android')
4442
include ':lottie-react-native'
4543
project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')
4644
include ':react-native-gesture-handler'

app/component-library/components/BottomSheets/BottomSheet/foundation/BottomSheetDialog/BottomSheetDialog.styles.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Third party dependencies.
22
// eslint-disable-next-line @typescript-eslint/no-shadow
3-
import { StyleSheet, ViewStyle } from 'react-native';
3+
import { Platform, StyleSheet, ViewStyle } from 'react-native';
44

55
// External dependencies.
66
import { Theme } from '../../../../../../util/theme/models';
@@ -38,7 +38,10 @@ const styleSheet = (params: {
3838
borderTopRightRadius: 8,
3939
maxHeight: maxSheetHeight,
4040
overflow: 'hidden',
41-
paddingBottom: screenBottomPadding,
41+
paddingBottom:
42+
Platform.OS === 'ios'
43+
? screenBottomPadding
44+
: screenBottomPadding + 16,
4245
borderWidth: 1,
4346
borderColor: colors.border.muted,
4447
...(isFullscreen && { height: maxSheetHeight }),

app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.styles.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ const styleSheet = (params: {
2020
}) => {
2121
const { vars, theme } = params;
2222
const { colors } = theme;
23-
const { style, isDanger, pressed } = vars;
23+
const { style, isDanger, pressed, overridePressedColor } = vars;
2424
const colorObj = isDanger ? colors.error : colors.primary;
2525

26+
const pressedColor = pressed
27+
? overridePressedColor || colorObj.alternative
28+
: 'transparent';
29+
2630
return StyleSheet.create({
2731
base: Object.assign(
2832
{
29-
backgroundColor: pressed ? colorObj.alternative : 'transparent',
33+
backgroundColor: pressedColor,
3034
borderWidth: 1,
3135
borderColor: colorObj.default,
3236
} as ViewStyle,

app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ const ButtonSecondary = ({
2626
onPressOut,
2727
isDanger = false,
2828
label,
29+
overridePressedColor,
2930
...props
3031
}: ButtonSecondaryProps) => {
3132
const [pressed, setPressed] = useState(false);
3233
const { styles } = useStyles(styleSheet, {
3334
style,
3435
isDanger,
3536
pressed,
37+
overridePressedColor,
3638
});
3739

3840
const triggerOnPressedIn = useCallback(
@@ -72,9 +74,12 @@ const ButtonSecondary = ({
7274
label
7375
);
7476

75-
const renderLoading = () => (
76-
<ActivityIndicator size="small" color={DEFAULT_BUTTONSECONDARY_LABEL_TEXTVARIANT} />
77-
);
77+
const renderLoading = () => (
78+
<ActivityIndicator
79+
size="small"
80+
color={DEFAULT_BUTTONSECONDARY_LABEL_TEXTVARIANT}
81+
/>
82+
);
7883

7984
return (
8085
<Button

app/component-library/components/Buttons/Button/variants/ButtonSecondary/ButtonSecondary.types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { ButtonBaseProps } from '../../foundation/ButtonBase';
44
/**
55
* ButtonSecondary component props.
66
*/
7-
export type ButtonSecondaryProps = Omit<ButtonBaseProps, 'labelColor'>;
7+
export type ButtonSecondaryProps = Omit<ButtonBaseProps, 'labelColor'> & {
8+
overridePressedColor?: string;
9+
};
810

911
/**
1012
* Style sheet input parameters.
@@ -15,4 +17,5 @@ export type ButtonSecondaryStyleSheetVars = Pick<
1517
> & {
1618
isDanger: boolean;
1719
pressed: boolean;
20+
overridePressedColor?: string;
1821
};

app/component-library/components/Icons/Icon/Icon.assets.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ import webtrafficSVG from './assets/web-traffic.svg';
273273
import widgetsSVG from './assets/widgets.svg';
274274
import wifioffSVG from './assets/wifi-off.svg';
275275
import wifiSVG from './assets/wifi.svg';
276+
import eyeSlashSolidSVG from './assets/eye-slash-solid.svg';
277+
import eyeSolidSVG from './assets/eye-solid.svg';
276278
import dangerSolidSVG from './assets/danger-solid.svg';
277279
import successSolidSVG from './assets/success.svg';
278280
import xSVG from './assets/x.svg';
@@ -550,6 +552,8 @@ export const assetByIconName: AssetByIconName = {
550552
[IconName.Widgets]: widgetsSVG,
551553
[IconName.WifiOff]: wifioffSVG,
552554
[IconName.Wifi]: wifiSVG,
555+
[IconName.EyeSlashSolid]: eyeSlashSolidSVG,
556+
[IconName.EyeSolid]: eyeSolidSVG,
553557
[IconName.DangerSolid]: dangerSolidSVG,
554558
[IconName.SuccessSolid]: successSolidSVG,
555559
[IconName.X]: xSVG,

app/component-library/components/Icons/Icon/Icon.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ export enum IconName {
343343
Widgets = 'Widgets',
344344
WifiOff = 'WifiOff',
345345
Wifi = 'Wifi',
346+
EyeSlashSolid = 'EyeSlashSolid',
347+
EyeSolid = 'EyeSolid',
346348
DangerSolid = 'DangerSolid',
347349
SuccessSolid = 'SuccessSolid',
348350
X = 'X',
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading

app/components/Nav/App/App.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ import ImportNewSecretRecoveryPhrase from '../../Views/ImportNewSecretRecoveryPh
134134
import { SelectSRPBottomSheet } from '../../Views/SelectSRP/SelectSRPBottomSheet';
135135
///: END:ONLY_INCLUDE_IF
136136
import NavigationService from '../../../core/NavigationService';
137+
import SeedphraseModal from '../../UI/SeedphraseModal';
138+
import SkipAccountSecurityModal from '../../UI/SkipAccountSecurityModal';
139+
import SuccessErrorSheet from '../../Views/SuccessErrorSheet';
137140
import ConfirmTurnOnBackupAndSyncModal from '../../UI/Identity/ConfirmTurnOnBackupAndSyncModal/ConfirmTurnOnBackupAndSyncModal';
138141
import AddNewAccount from '../../Views/AddNewAccount';
139142
import SwitchAccountTypeModal from '../../Views/confirmations/components/modals/switch-account-type-modal';
@@ -334,6 +337,18 @@ const RootModalFlow = (
334337
name={Routes.MODAL.MODAL_MANDATORY}
335338
component={ModalMandatory}
336339
/>
340+
<Stack.Screen
341+
name={Routes.SHEET.SEEDPHRASE_MODAL}
342+
component={SeedphraseModal}
343+
/>
344+
<Stack.Screen
345+
name={Routes.SHEET.SKIP_ACCOUNT_SECURITY_MODAL}
346+
component={SkipAccountSecurityModal}
347+
/>
348+
<Stack.Screen
349+
name={Routes.SHEET.SUCCESS_ERROR_SHEET}
350+
component={SuccessErrorSheet}
351+
/>
337352
<Stack.Screen
338353
name={Routes.SHEET.ACCOUNT_SELECTOR}
339354
component={AccountSelector}

0 commit comments

Comments
 (0)