From e714d8563cc4f349c4c7e6c186c9b2111ffe4089 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Tue, 6 May 2025 12:41:53 +0200 Subject: [PATCH] UI tweaks (#771) --- .../app/(tabs)/credentials/add-edit.tsx | 8 +- .../app/(tabs)/credentials/index.tsx | 3 +- apps/mobile-app/app/(tabs)/emails/index.tsx | 3 +- .../app/(tabs)/settings/auto-lock.tsx | 38 +++++---- apps/mobile-app/app/(tabs)/settings/index.tsx | 5 +- .../app/(tabs)/settings/ios-autofill.tsx | 22 ++--- .../app/(tabs)/settings/vault-unlock.tsx | 5 +- apps/mobile-app/components/EmailCard.tsx | 2 - .../components/credentials/CredentialCard.tsx | 2 - .../form/FormInputCopyToClipboard.tsx | 2 - .../components/form/ValidatedFormField.tsx | 2 +- .../components/ui/CollapsibleHeader.tsx | 81 ++++++++++++------- apps/mobile-app/constants/Colors.ts | 10 +-- 13 files changed, 104 insertions(+), 79 deletions(-) diff --git a/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx b/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx index d832d1531..97579d91a 100644 --- a/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx +++ b/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx @@ -439,6 +439,10 @@ export default function AddEditCredentialScreen() : React.ReactNode { padding: 10, paddingLeft: 0, }, + headerLeftButtonText: { + color: colors.primary, + fontSize: 20, + }, headerRightButton: { padding: 10, paddingRight: 0, @@ -492,7 +496,7 @@ export default function AddEditCredentialScreen() : React.ReactNode { onPress={() => router.back()} style={styles.headerLeftButton} > - Cancel + Cancel ), /** @@ -507,7 +511,7 @@ export default function AddEditCredentialScreen() : React.ReactNode { ), }); - }, [navigation, mode, handleSubmit, onSubmit, colors.primary, isEditMode, router, styles.headerLeftButton, styles.headerRightButton]); + }, [navigation, mode, handleSubmit, onSubmit, colors.primary, isEditMode, router, styles.headerLeftButton, styles.headerLeftButtonText, styles.headerRightButton]); return ( <> diff --git a/apps/mobile-app/app/(tabs)/credentials/index.tsx b/apps/mobile-app/app/(tabs)/credentials/index.tsx index c334c7a48..6efbc011a 100644 --- a/apps/mobile-app/app/(tabs)/credentials/index.tsx +++ b/apps/mobile-app/app/(tabs)/credentials/index.tsx @@ -190,13 +190,12 @@ export default function CredentialsScreen() : React.ReactNode { }, content: { flex: 1, - marginTop: 36, padding: 16, paddingTop: 0, }, contentContainer: { paddingBottom: 40, - paddingTop: 4, + paddingTop: 42, }, emptyText: { color: colors.textMuted, diff --git a/apps/mobile-app/app/(tabs)/emails/index.tsx b/apps/mobile-app/app/(tabs)/emails/index.tsx index 13865b5bd..f0468c1e7 100644 --- a/apps/mobile-app/app/(tabs)/emails/index.tsx +++ b/apps/mobile-app/app/(tabs)/emails/index.tsx @@ -165,12 +165,11 @@ export default function EmailsScreen() : React.ReactNode { }, content: { flex: 1, - marginTop: 22, padding: 16, }, contentContainer: { paddingBottom: 40, - paddingTop: 4, + paddingTop: 26, }, emptyText: { color: colors.textMuted, diff --git a/apps/mobile-app/app/(tabs)/settings/auto-lock.tsx b/apps/mobile-app/app/(tabs)/settings/auto-lock.tsx index af0da40b4..86e3cc8f6 100644 --- a/apps/mobile-app/app/(tabs)/settings/auto-lock.tsx +++ b/apps/mobile-app/app/(tabs)/settings/auto-lock.tsx @@ -56,13 +56,16 @@ export default function AutoLockScreen() : React.ReactNode { borderBottomWidth: StyleSheet.hairlineWidth, flexDirection: 'row', paddingHorizontal: 16, - paddingVertical: 16, + paddingVertical: 14, }, optionContainer: { backgroundColor: colors.accentBackground, borderRadius: 10, margin: 16, }, + optionLast: { + borderBottomWidth: 0, + }, optionText: { color: colors.text, flex: 1, @@ -83,21 +86,24 @@ export default function AutoLockScreen() : React.ReactNode { - {timeoutOptions.map((option) => ( - { - setAutoLockTimeout(option.value); - setAutoLockTimeoutState(option.value); - }} - > - {option.label} - {autoLockTimeout === option.value && ( - - )} - - ))} + {timeoutOptions.map((option, index) => { + const isLast = index === timeoutOptions.length - 1; + return ( + { + setAutoLockTimeout(option.value); + setAutoLockTimeoutState(option.value); + }} + > + {option.label} + {autoLockTimeout === option.value && ( + + )} + + ); + })} diff --git a/apps/mobile-app/app/(tabs)/settings/index.tsx b/apps/mobile-app/app/(tabs)/settings/index.tsx index bfe8727c3..66b4af021 100644 --- a/apps/mobile-app/app/(tabs)/settings/index.tsx +++ b/apps/mobile-app/app/(tabs)/settings/index.tsx @@ -111,12 +111,11 @@ export default function SettingsScreen() : React.ReactNode { }, content: { flex: 1, - marginTop: 22, padding: 16, }, scrollContent: { paddingBottom: 40, - paddingTop: 4, + paddingTop: 26, }, scrollView: { flex: 1, @@ -159,7 +158,7 @@ export default function SettingsScreen() : React.ReactNode { alignItems: 'center', flex: 1, flexDirection: 'row', - paddingVertical: 12, + paddingVertical: 10, }, settingItemIcon: { alignItems: 'center', diff --git a/apps/mobile-app/app/(tabs)/settings/ios-autofill.tsx b/apps/mobile-app/app/(tabs)/settings/ios-autofill.tsx index c301114b7..fe97db302 100644 --- a/apps/mobile-app/app/(tabs)/settings/ios-autofill.tsx +++ b/apps/mobile-app/app/(tabs)/settings/ios-autofill.tsx @@ -115,16 +115,6 @@ export default function IosAutofillScreen() : React.ReactNode { Open iOS Settings - {shouldShowIosAutofillReminder && ( - - - I already configured it - - - )} 2. Go to "General" @@ -141,6 +131,18 @@ export default function IosAutofillScreen() : React.ReactNode { Note: You'll need to authenticate with Face ID/Touch ID or your device passcode when using autofill. + + {shouldShowIosAutofillReminder && ( + + + I already configured it + + + )} + diff --git a/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx b/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx index 2a2fd7d3f..585ae149e 100644 --- a/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx +++ b/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx @@ -156,6 +156,9 @@ export default function VaultUnlockSettingsScreen() : React.ReactNode { justifyContent: 'space-between', marginBottom: 4, }, + optionLast: { + borderBottomWidth: 0, + }, optionText: { color: colors.text, fontSize: 16, @@ -197,7 +200,7 @@ export default function VaultUnlockSettingsScreen() : React.ReactNode { )} - + Password = ({ }, inputContainer: { backgroundColor: colors.accentBackground, - borderColor: colors.accentBorder, borderRadius: 8, - borderWidth: 1, marginBottom: 12, padding: 12, }, diff --git a/apps/mobile-app/components/form/ValidatedFormField.tsx b/apps/mobile-app/components/form/ValidatedFormField.tsx index 302ca5785..423e61d58 100644 --- a/apps/mobile-app/components/form/ValidatedFormField.tsx +++ b/apps/mobile-app/components/form/ValidatedFormField.tsx @@ -77,7 +77,7 @@ const ValidatedFormFieldComponent = forwardRef void; @@ -29,10 +32,11 @@ export function CollapsibleHeader({ showNavigationHeader = false, alwaysVisible = false, headerButtons = [] -}: CollapsibleHeaderProps) : React.ReactNode { +}: CollapsibleHeaderProps): React.ReactNode { const colors = useColors(); + const colorScheme = useColorScheme(); - // Calculate header opacity based on scroll position and transform + // Calculate header opacity and transforms based on scroll const headerOpacity = scrollY.interpolate({ inputRange: [10, 60], outputRange: [0, 1], @@ -45,12 +49,13 @@ export function CollapsibleHeader({ extrapolate: 'clamp', }); - const headerTransform = alwaysVisible ? 0 : headerOpacity.interpolate({ - inputRange: [0, 1], - outputRange: [-20, 0], - }); + const headerTransform = alwaysVisible + ? 0 + : headerOpacity.interpolate({ + inputRange: [0, 1], + outputRange: [-20, 0], + }); - // Interpolate the header background color and border const headerBackground = headerOpacity.interpolate({ inputRange: [0, 1], outputRange: [colors.background, colors.accentBackground], @@ -63,6 +68,7 @@ export function CollapsibleHeader({ height: Platform.OS === 'ios' ? 100 : 64, justifyContent: 'center', left: 0, + overflow: 'hidden', paddingBottom: Platform.OS === 'ios' ? 12 : 16, paddingTop: Platform.OS === 'ios' ? 60 : 0, position: 'absolute', @@ -92,7 +98,6 @@ export function CollapsibleHeader({ }, headerButton: { bottom: Platform.OS === 'ios' ? 6 : 16, - color: colors.primary, padding: 4, position: 'absolute', }, @@ -106,37 +111,53 @@ export function CollapsibleHeader({ return ( <> - {showNavigationHeader ? ( - - ) : null} + {showNavigationHeader && ( + + )} - + {Platform.OS === 'ios' ? ( + colorScheme === 'dark' ? ( + + ) : ( + + ) + ) : ( + + )} + + {title} - {headerButtons.map((button, index) => ( + {headerButtons.map((button, idx) => ( @@ -147,12 +168,10 @@ export function CollapsibleHeader({ ); -} \ No newline at end of file +} diff --git a/apps/mobile-app/constants/Colors.ts b/apps/mobile-app/constants/Colors.ts index e01638806..4b52d2ca2 100644 --- a/apps/mobile-app/constants/Colors.ts +++ b/apps/mobile-app/constants/Colors.ts @@ -30,9 +30,9 @@ export const Colors = { white: '#ffffff', text: '#ECEDEE', textMuted: '#9BA1A6', - background: '#111827', - accentBackground: '#1f2937', - accentBorder: '#4b5563', + background: '#000', + accentBackground: '#202020', + accentBorder: '#444', errorBackground: '#3d1a1e', errorBorder: '#9c2530', errorText: '#fae1e3', @@ -40,8 +40,8 @@ export const Colors = { icon: '#9BA1A6', tabIconDefault: '#9BA1A6', tabIconSelected: '#f49541', - headerBackground: '#1f2937', - tabBarBackground: '#1f2937', + headerBackground: '#202020', + tabBarBackground: '#202020', primary: '#f49541', primarySurfaceText: '#ffffff', secondary: '#6b7280',