From b56ae02a9e088ec7e1fdb7f1dc8748d765560052 Mon Sep 17 00:00:00 2001 From: Fara Woolf Date: Fri, 27 Sep 2024 16:48:55 -0400 Subject: [PATCH] fix: settings design qa --- apps/mobile/ios/Podfile.lock | 2 +- apps/mobile/package.json | 1 + apps/mobile/src/app/(home)/_layout.tsx | 24 ++- .../(home)/settings/display/display-cell.tsx | 13 +- .../app/(home)/settings/help/help-cell.tsx | 24 +++ .../src/app/(home)/settings/help/index.tsx | 30 ++-- apps/mobile/src/app/(home)/settings/index.tsx | 141 +++++++++--------- .../(home)/settings/networks/network-cell.tsx | 7 +- .../(home)/settings/notifications/email.tsx | 6 +- .../(home)/settings/notifications/index.tsx | 7 +- .../settings/security/security-cell.tsx | 13 +- .../src/app/(home)/settings/settings-cell.tsx | 24 +++ apps/mobile/src/components/divider.tsx | 8 +- apps/mobile/src/locales/en/messages.po | 64 ++++---- .../src/locales/pseudo-locale/messages.po | 64 ++++---- .../item-layout/item-layout.native.tsx | 13 +- packages/ui/src/icons/index.native.ts | 4 +- .../icons/package-security-icon.native.tsx | 2 +- .../ui/src/icons/users-two-icon.native.tsx | 17 +++ pnpm-lock.yaml | 3 + 20 files changed, 262 insertions(+), 205 deletions(-) create mode 100644 apps/mobile/src/app/(home)/settings/help/help-cell.tsx create mode 100644 apps/mobile/src/app/(home)/settings/settings-cell.tsx create mode 100644 packages/ui/src/icons/users-two-icon.native.tsx diff --git a/apps/mobile/ios/Podfile.lock b/apps/mobile/ios/Podfile.lock index fbee23343..618696f8d 100644 --- a/apps/mobile/ios/Podfile.lock +++ b/apps/mobile/ios/Podfile.lock @@ -1997,7 +1997,7 @@ SPEC CHECKSUMS: SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 348f8b538c3ed4423eb58a8e5730feec50bce372 + Yoga: b9a182ab00cf25926e7f79657d08c5d23c2d03b0 PODFILE CHECKSUM: 1183a5e3969c957f2df7140e9b85ba46d355b320 diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 1fa15bccd..15ceb4789 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -69,6 +69,7 @@ "buffer": "6.0.3", "dayjs": "1.11.13", "expo": "51.0.26", + "expo-application": "5.9.1", "expo-asset": "10.0.6", "expo-blur": "13.0.2", "expo-clipboard": "6.0.3", diff --git a/apps/mobile/src/app/(home)/_layout.tsx b/apps/mobile/src/app/(home)/_layout.tsx index fadbe294b..647cde9e2 100644 --- a/apps/mobile/src/app/(home)/_layout.tsx +++ b/apps/mobile/src/app/(home)/_layout.tsx @@ -2,12 +2,9 @@ import { RefObject, createContext } from 'react'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { ActionBarMethods } from '@/components/action-bar'; -import { AccountsHeader } from '@/components/headers/account'; import { BackButtonHeader } from '@/components/headers/back-button'; -import { BlurredHeader } from '@/components/headers/containers/blurred-header'; import { SimpleHeader } from '@/components/headers/containers/simple-header'; import { LeatherLogoHeader } from '@/components/headers/leather-logo'; -import { MenuHeader } from '@/components/headers/menu'; import { OptionsHeader } from '@/components/headers/options'; import { TitleHeader } from '@/components/headers/title'; import { t } from '@lingui/macro'; @@ -26,14 +23,14 @@ export default function StackLayout() { const insets = useSafeAreaInsets(); const router = useRouter(); - const NavigationHeader = ( - router.back()} />} - center={} - right={} - /> - ); + // const NavigationHeader = ( + // router.back()} />} + // center={} + // right={} + // /> + // ); const NavigationHeaderHome = ( } right={} /> @@ -94,11 +91,12 @@ export default function StackLayout() { return ( - + {/* TODO: Can these be removed, or they should go after index route? */} + {/* NavigationHeader }} /> NavigationHeader }} /> NavigationHeader }} /> - + */} NavigationHeaderHome }} /> NavigationBackSimple }} /> NavigationBackSimple }} /> diff --git a/apps/mobile/src/app/(home)/settings/display/display-cell.tsx b/apps/mobile/src/app/(home)/settings/display/display-cell.tsx index 81f7bc169..5332e82ec 100644 --- a/apps/mobile/src/app/(home)/settings/display/display-cell.tsx +++ b/apps/mobile/src/app/(home)/settings/display/display-cell.tsx @@ -1,12 +1,7 @@ import { ReactNode } from 'react'; +import { Pressable } from 'react-native'; -import { - Avatar, - ChevronRightIcon, - Flag, - ItemLayout, - TouchableOpacity, -} from '@leather.io/ui/native'; +import { Avatar, ChevronRightIcon, Flag, ItemLayout } from '@leather.io/ui/native'; interface DisplayCellProps { caption: string; @@ -16,7 +11,7 @@ interface DisplayCellProps { } export function DisplayCell({ caption, icon, onCreateSheetRef, title }: DisplayCellProps) { return ( - + {icon}}> } @@ -24,6 +19,6 @@ export function DisplayCell({ caption, icon, onCreateSheetRef, title }: DisplayC titleLeft={title} /> - + ); } diff --git a/apps/mobile/src/app/(home)/settings/help/help-cell.tsx b/apps/mobile/src/app/(home)/settings/help/help-cell.tsx new file mode 100644 index 000000000..c6f83a851 --- /dev/null +++ b/apps/mobile/src/app/(home)/settings/help/help-cell.tsx @@ -0,0 +1,24 @@ +import { ReactNode } from 'react'; +import { Pressable } from 'react-native'; + +import { Avatar, ChevronRightIcon, Flag, ItemLayout } from '@leather.io/ui/native'; + +interface DisplayCellProps { + caption: string; + icon: ReactNode; + onPress(): void; + title: string; +} +export function HelpCell({ caption, icon, onPress, title }: DisplayCellProps) { + return ( + + {icon}}> + } + captionLeft={caption} + titleLeft={title} + /> + + + ); +} diff --git a/apps/mobile/src/app/(home)/settings/help/index.tsx b/apps/mobile/src/app/(home)/settings/help/index.tsx index e4044bd6b..ca9824313 100644 --- a/apps/mobile/src/app/(home)/settings/help/index.tsx +++ b/apps/mobile/src/app/(home)/settings/help/index.tsx @@ -4,14 +4,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { t } from '@lingui/macro'; import { useTheme } from '@shopify/restyle'; -import { - Box, - Cell, - GraduateCapIcon, - MagicBookIcon, - SupportIcon, - Theme, -} from '@leather.io/ui/native'; +import { Box, GraduateCapIcon, MagicBookIcon, SupportIcon, Theme } from '@leather.io/ui/native'; + +import { HelpCell } from './help-cell'; export default function SettingsHelpScreen() { const { bottom } = useSafeAreaInsets(); @@ -27,17 +22,22 @@ export default function SettingsHelpScreen() { gap: theme.spacing[5], }} > - } + onPress={() => {}} + /> + } onPress={() => {}} /> - {}} /> - } onPress={() => {}} /> diff --git a/apps/mobile/src/app/(home)/settings/index.tsx b/apps/mobile/src/app/(home)/settings/index.tsx index b5f51453a..5e50c46f8 100644 --- a/apps/mobile/src/app/(home)/settings/index.tsx +++ b/apps/mobile/src/app/(home)/settings/index.tsx @@ -1,10 +1,11 @@ -import { ScrollView } from 'react-native-gesture-handler'; +import { ScrollView } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { Divider } from '@/components/divider'; import { AppRoutes } from '@/routes'; import { t } from '@lingui/macro'; import { useTheme } from '@shopify/restyle'; +import * as Application from 'expo-application'; import { useRouter } from 'expo-router'; import { @@ -12,97 +13,91 @@ import { BellIcon, Box, Button, - Cell, GlobeTiltedIcon, - SettingsSliderThreeIcon, + SettingsGearIcon, ShieldIcon, - SunIcon, + SquareLinesBottomIcon, SupportIcon, Text, Theme, + UsersTwoIcon, WalletIcon, } from '@leather.io/ui/native'; +import { SettingsCell } from './settings-cell'; + export default function SettingsScreen() { const { bottom } = useSafeAreaInsets(); const theme = useTheme(); const router = useRouter(); return ( - - - { - router.navigate(AppRoutes.SettingsWallet); - }} - /> + + + + } + onPress={() => router.navigate(AppRoutes.SettingsWallet)} + /> + - { - router.navigate(AppRoutes.SettingsDisplay); - }} - /> - { - router.navigate(AppRoutes.SettingsSecurity); - }} - /> - { - router.navigate(AppRoutes.SettingsNetworks); - }} - /> - { - router.navigate(AppRoutes.SettingsNotifications); - }} - /> - { - router.navigate(AppRoutes.SettingsHelp); + + } + onPress={() => router.navigate(AppRoutes.SettingsDisplay)} + /> + } + onPress={() => router.navigate(AppRoutes.SettingsSecurity)} + /> + } + onPress={() => router.navigate(AppRoutes.SettingsNetworks)} + /> + } + onPress={() => router.navigate(AppRoutes.SettingsNotifications)} + /> + } + onPress={() => router.navigate(AppRoutes.SettingsHelp)} + /> + + } onPress={() => {}} /> + } onPress={() => {}} /> + + } + /> + + + - - - - - } - /> - {/* TODO: Replace with shared Footer */} - - + > {t`Version`} - 0.0 + {process.env.NODE_ENV === 'development' + ? Application.nativeBuildVersion + : Application.nativeApplicationVersion}