Skip to content

Commit

Permalink
feat(suite-native): prepare empty view-only settings screen
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkriz committed Apr 8, 2024
1 parent 022b89c commit 7803da2
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 2 deletions.
3 changes: 3 additions & 0 deletions suite-common/icons/assets/icons/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions suite-common/icons/assets/icons/checkCircleSolid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions suite-common/icons/src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const icons = {
arrowUpRight: require('../assets/icons/arrowUpRight.svg'),
backspace: require('../assets/icons/backspace.svg'),
biometric: require('../assets/icons/biometric.svg'),
bookmark: require('../assets/icons/bookmark.svg'),
bugBeetle: require('../assets/icons/bugBeetle.svg'),
calendar: require('../assets/icons/calendar.svg'),
caretCircleDown: require('../assets/icons/caretCircleDown.svg'),
Expand Down
4 changes: 4 additions & 0 deletions suite-native/intl/src/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ export const en = {
privacyAndSecurity: {
title: 'Privacy & Security',
},
viewOnly: {
title: 'View-only',
subtitle: 'Check balances without connecting your Trezor.',
},
},
moduleOnboarding: {
welcomeScreen: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useNavigation } from '@react-navigation/core';
import { useAtomValue } from 'jotai';

import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags';
import {
SettingsStackRoutes,
SettingsStackParamList,
Expand All @@ -15,6 +16,7 @@ import { isDevButtonVisibleAtom } from './ProductionDebug';

export const ApplicationSettings = () => {
const isDevButtonVisible = useAtomValue(isDevButtonVisibleAtom);
const [isViewOnlyFeatureEnabled] = useFeatureFlag(FeatureFlag.IsViewOnlyEnabled);

const navigation =
useNavigation<
Expand Down Expand Up @@ -57,6 +59,14 @@ export const ApplicationSettings = () => {
subtitle="Analytics, Discreet mode, Biometrics"
onPress={() => handleNavigation(SettingsStackRoutes.SettingsPrivacyAndSecurity)}
/>
{isViewOnlyFeatureEnabled && (
<SettingsSectionItem
title="View-only"
iconName="bookmark"
subtitle="Check balances without your Trezor"
onPress={() => handleNavigation(SettingsStackRoutes.SettingsViewOnly)}
/>
)}
</SettingsSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { SettingsScreen } from '../screens/SettingsScreen';
import { SettingsLocalizationScreen } from '../screens/SettingsLocalizationScreen';
import { SettingsCustomizationScreen } from '../screens/SettingsCustomizationScreen';
import { SettingsPrivacyAndSecurity } from '../screens/SettingsPrivacyAndSecurity';
import { SettingsViewOnly } from '../screens/SettingsViewOnly';
import { SettingsAboutUsScreen } from '../screens/SettingsAboutUsScreen';
import { SettingsFAQScreen } from '../screens/SettingsFAQScreen';

Expand Down Expand Up @@ -40,6 +41,11 @@ export const SettingsStackNavigator = () => (
name={SettingsStackRoutes.SettingsPrivacyAndSecurity}
component={SettingsPrivacyAndSecurity}
/>
<SettingsStack.Screen
options={{ title: SettingsStackRoutes.SettingsViewOnly }}
name={SettingsStackRoutes.SettingsViewOnly}
component={SettingsViewOnly}
/>
<SettingsStack.Screen
options={{ title: SettingsStackRoutes.SettingsFAQ }}
name={SettingsStackRoutes.SettingsFAQ}
Expand Down
17 changes: 17 additions & 0 deletions suite-native/module-settings/src/screens/SettingsViewOnly.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Screen, ScreenSubHeader } from '@suite-native/navigation';
import { Text } from '@suite-native/atoms';
import { Translation, useTranslate } from '@suite-native/intl';

export const SettingsViewOnly = () => {
const { translate } = useTranslate();

return (
<Screen
screenHeader={<ScreenSubHeader content={translate('moduleSettings.viewOnly.title')} />}
>
<Text>
<Translation id="moduleSettings.viewOnly.subtitle" />
</Text>
</Screen>
);
};
1 change: 1 addition & 0 deletions suite-native/navigation/src/navigators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type SettingsStackParamList = {
[SettingsStackRoutes.SettingsLocalization]: undefined;
[SettingsStackRoutes.SettingsCustomization]: undefined;
[SettingsStackRoutes.SettingsPrivacyAndSecurity]: undefined;
[SettingsStackRoutes.SettingsViewOnly]: undefined;
[SettingsStackRoutes.SettingsAbout]: undefined;
[SettingsStackRoutes.SettingsFAQ]: undefined;
};
Expand Down
1 change: 1 addition & 0 deletions suite-native/navigation/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export enum SettingsStackRoutes {
SettingsLocalization = 'SettingsLocalization',
SettingsCustomization = 'SettingsCustomization',
SettingsPrivacyAndSecurity = 'SettingsPrivacyAndSecurity',
SettingsViewOnly = 'SettingsViewOnly',
SettingsAbout = 'SettingsAbout',
SettingsFAQ = 'SettingsFAQ',
}

0 comments on commit 7803da2

Please sign in to comment.