Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Responsive tweaks (#771)

Leendert de Borsta22875081b1e
diff --git a/apps/mobile-app/app/(tabs)/credentials/index.tsx b/apps/mobile-app/app/(tabs)/credentials/index.tsx
index 1bfe569a0..539ba4806 100644
--- a/apps/mobile-app/app/(tabs)/credentials/index.tsx
+++ b/apps/mobile-app/app/(tabs)/credentials/index.tsx
@@ -219,13 +219,9 @@ export default function CredentialsScreen() : React.ReactNode {
container: {
flex: 1,
paddingBottom: insets.bottom,
+ paddingHorizontal: 14,
paddingTop: insets.top,
},
- content: {
- flex: 1,
- padding: 16,
- paddingTop: 0,
- },
contentContainer: {
paddingBottom: 40,
paddingTop: 42,
@@ -271,80 +267,77 @@ export default function CredentialsScreen() : React.ReactNode {
alwaysVisible={true}
headerButtons={headerButtons}
/>
-
- <ThemedView style={styles.content}>
- <ThemedView style={styles.stepContainer}>
- <Animated.FlatList
- ref={flatListRef}
- data={isLoadingCredentials ? Array(4).fill(null) : filteredCredentials}
- keyExtractor={(item, index) => item?.Id ?? `skeleton-${index}`}
- keyboardShouldPersistTaps='handled'
- onScroll={Animated.event(
- [{ nativeEvent: { contentOffset: { y: scrollY } } }],
- { useNativeDriver: true }
- )}
- scrollEventThrottle={16}
- contentContainerStyle={styles.contentContainer}
- scrollIndicatorInsets={{ bottom: 40 }}
- initialNumToRender={14}
- maxToRenderPerBatch={14}
- windowSize={7}
- removeClippedSubviews={true}
- ListHeaderComponent={
- <ThemedView>
- <TitleContainer title="Credentials" />
- <ThemedView style={styles.searchContainer}>
- <MaterialIcons
- name="search"
- size={20}
- color={colors.textMuted}
- style={styles.searchIcon}
- />
- <TextInput
- style={styles.searchInput}
- placeholder="Search credentials..."
- placeholderTextColor={colors.textMuted}
- value={searchQuery}
- autoCorrect={false}
- autoCapitalize="none"
- onChangeText={setSearchQuery}
- clearButtonMode={Platform.OS === 'ios' ? 'while-editing' : 'never'}
- />
- {Platform.OS === 'android' && searchQuery.length > 0 && (
- <TouchableOpacity
- style={styles.clearButton}
- onPress={() => setSearchQuery('')}
- >
- <ThemedText style={styles.clearButtonText}>×</ThemedText>
- </TouchableOpacity>
- )}
- </ThemedView>
+ <ThemedView style={styles.stepContainer}>
+ <Animated.FlatList
+ ref={flatListRef}
+ data={isLoadingCredentials ? Array(4).fill(null) : filteredCredentials}
+ keyExtractor={(item, index) => item?.Id ?? `skeleton-${index}`}
+ keyboardShouldPersistTaps='handled'
+ onScroll={Animated.event(
+ [{ nativeEvent: { contentOffset: { y: scrollY } } }],
+ { useNativeDriver: true }
+ )}
+ scrollEventThrottle={16}
+ contentContainerStyle={styles.contentContainer}
+ scrollIndicatorInsets={{ bottom: 40 }}
+ initialNumToRender={14}
+ maxToRenderPerBatch={14}
+ windowSize={7}
+ removeClippedSubviews={true}
+ ListHeaderComponent={
+ <ThemedView>
+ <TitleContainer title="Credentials" />
+ <ThemedView style={styles.searchContainer}>
+ <MaterialIcons
+ name="search"
+ size={20}
+ color={colors.textMuted}
+ style={styles.searchIcon}
+ />
+ <TextInput
+ style={styles.searchInput}
+ placeholder="Search credentials..."
+ placeholderTextColor={colors.textMuted}
+ value={searchQuery}
+ autoCorrect={false}
+ autoCapitalize="none"
+ onChangeText={setSearchQuery}
+ clearButtonMode={Platform.OS === 'ios' ? 'while-editing' : 'never'}
+ />
+ {Platform.OS === 'android' && searchQuery.length > 0 && (
+ <TouchableOpacity
+ style={styles.clearButton}
+ onPress={() => setSearchQuery('')}
+ >
+ <ThemedText style={styles.clearButtonText}>×</ThemedText>
+ </TouchableOpacity>
+ )}
</ThemedView>
- }
- refreshControl={
- <RefreshControl
- refreshing={refreshing}
- onRefresh={onRefresh}
- colors={[colors.primary]}
- tintColor={colors.primary}
- />
- }
- renderItem={({ item }) =>
- isLoadingCredentials ? (
- <SkeletonLoader count={1} height={60} parts={2} />
- ) : (
- <CredentialCard credential={item} />
- )
- }
- ListEmptyComponent={
- !isLoadingCredentials ? (
- <Text style={styles.emptyText}>
- {searchQuery ? 'No matching credentials found' : 'No credentials found'}
- </Text>
- ) : null
- }
- />
- </ThemedView>
+ </ThemedView>
+ }
+ refreshControl={
+ <RefreshControl
+ refreshing={refreshing}
+ onRefresh={onRefresh}
+ colors={[colors.primary]}
+ tintColor={colors.primary}
+ />
+ }
+ renderItem={({ item }) =>
+ isLoadingCredentials ? (
+ <SkeletonLoader count={1} height={60} parts={2} />
+ ) : (
+ <CredentialCard credential={item} />
+ )
+ }
+ ListEmptyComponent={
+ !isLoadingCredentials ? (
+ <Text style={styles.emptyText}>
+ {searchQuery ? 'No matching credentials found' : 'No credentials found'}
+ </Text>
+ ) : null
+ }
+ />
</ThemedView>
</ThemedView>
);
diff --git a/apps/mobile-app/app/(tabs)/emails/index.tsx b/apps/mobile-app/app/(tabs)/emails/index.tsx
index 041e08278..4a8f443c5 100644
--- a/apps/mobile-app/app/(tabs)/emails/index.tsx
+++ b/apps/mobile-app/app/(tabs)/emails/index.tsx
@@ -158,12 +158,9 @@ export default function EmailsScreen() : React.ReactNode {
container: {
flex: 1,
paddingBottom: insets.bottom,
+ paddingHorizontal: 14,
paddingTop: insets.top,
},
- content: {
- flex: 1,
- padding: 16,
- },
contentContainer: {
paddingBottom: 40,
paddingTop: 26,
@@ -232,29 +229,27 @@ export default function EmailsScreen() : React.ReactNode {
scrollY={scrollY}
showNavigationHeader={true}
/>
- <ThemedView style={styles.content}>
- <Animated.ScrollView
- ref={scrollViewRef}
- onScroll={Animated.event(
- [{ nativeEvent: { contentOffset: { y: scrollY } } }],
- { useNativeDriver: true }
- )}
- scrollEventThrottle={16}
- contentContainerStyle={styles.contentContainer}
- scrollIndicatorInsets={{ bottom: 40 }}
- refreshControl={
- <RefreshControl
- refreshing={isRefreshing}
- onRefresh={onRefresh}
- colors={[colors.primary]}
- tintColor={colors.primary}
- />
- }
- >
- <TitleContainer title="Emails" />
- {renderContent()}
- </Animated.ScrollView>
- </ThemedView>
+ <Animated.ScrollView
+ ref={scrollViewRef}
+ onScroll={Animated.event(
+ [{ nativeEvent: { contentOffset: { y: scrollY } } }],
+ { useNativeDriver: true }
+ )}
+ scrollEventThrottle={16}
+ contentContainerStyle={styles.contentContainer}
+ scrollIndicatorInsets={{ bottom: 40 }}
+ refreshControl={
+ <RefreshControl
+ refreshing={isRefreshing}
+ onRefresh={onRefresh}
+ colors={[colors.primary]}
+ tintColor={colors.primary}
+ />
+ }
+ >
+ <TitleContainer title="Emails" />
+ {renderContent()}
+ </Animated.ScrollView>
</ThemedView>
);
}
diff --git a/apps/mobile-app/app/(tabs)/settings/index.tsx b/apps/mobile-app/app/(tabs)/settings/index.tsx
index a072135c8..acbaa92ae 100644
--- a/apps/mobile-app/app/(tabs)/settings/index.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/index.tsx
@@ -120,12 +120,9 @@ export default function SettingsScreen() : React.ReactNode {
container: {
flex: 1,
paddingBottom: insets.bottom,
+ paddingHorizontal: 14,
paddingTop: insets.top,
},
- content: {
- flex: 1,
- padding: 16,
- },
scrollContent: {
paddingBottom: 40,
paddingTop: 26,
@@ -224,105 +221,103 @@ export default function SettingsScreen() : React.ReactNode {
scrollY={scrollY}
showNavigationHeader={false}
/>
- <ThemedView style={styles.content}>
- <Animated.ScrollView
- ref={scrollViewRef}
- onScroll={Animated.event(
- [{ nativeEvent: { contentOffset: { y: scrollY } } }],
- { useNativeDriver: true }
- )}
- scrollEventThrottle={16}
- contentContainerStyle={styles.scrollContent}
- scrollIndicatorInsets={{ bottom: 40 }}
- style={styles.scrollView}
- >
- <TitleContainer title="Settings" />
- <View style={styles.userInfoContainer}>
- <Image
- source={avatarImage}
- style={styles.avatar}
- />
- <ThemedText style={styles.usernameText}>Logged in as: {username}</ThemedText>
- </View>
+ <Animated.ScrollView
+ ref={scrollViewRef}
+ onScroll={Animated.event(
+ [{ nativeEvent: { contentOffset: { y: scrollY } } }],
+ { useNativeDriver: true }
+ )}
+ scrollEventThrottle={16}
+ contentContainerStyle={styles.scrollContent}
+ scrollIndicatorInsets={{ bottom: 40 }}
+ style={styles.scrollView}
+ >
+ <TitleContainer title="Settings" />
+ <View style={styles.userInfoContainer}>
+ <Image
+ source={avatarImage}
+ style={styles.avatar}
+ />
+ <ThemedText style={styles.usernameText}>Logged in as: {username}</ThemedText>
+ </View>
- <View style={styles.section}>
- {Platform.OS === 'ios' && (
- <>
- <TouchableOpacity
- style={styles.settingItem}
- onPress={handleIosAutofillPress}
- >
- <View style={styles.settingItemIcon}>
- <Ionicons name="key-outline" size={20} color={colors.text} />
- </View>
- <View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>iOS Autofill</ThemedText>
- {shouldShowIosAutofillReminder && (
- <View style={styles.settingItemBadge}>
- <ThemedText style={styles.settingItemBadgeText}>1</ThemedText>
- </View>
- )}
- </View>
- </TouchableOpacity>
- <View style={styles.separator} />
- </>
- )}
- <TouchableOpacity
- style={styles.settingItem}
- onPress={handleVaultUnlockPress}
- >
- <View style={styles.settingItemIcon}>
- <Ionicons name="lock-closed" size={20} color={colors.text} />
- </View>
- <View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Vault Unlock Method</ThemedText>
- {isFirstLoad ? (
- <InlineSkeletonLoader width={100} style={styles.skeletonLoader} />
- ) : (
- <ThemedText style={styles.settingItemValue}>{authMethodDisplay}</ThemedText>
- )}
- <Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
- </View>
- </TouchableOpacity>
- <View style={styles.separator} />
- <TouchableOpacity
- style={styles.settingItem}
- onPress={handleAutoLockPress}
- >
- <View style={styles.settingItemIcon}>
- <Ionicons name="timer-outline" size={20} color={colors.text} />
- </View>
- <View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Auto-lock Timeout</ThemedText>
- {isFirstLoad ? (
- <InlineSkeletonLoader width={80} style={styles.skeletonLoader} />
- ) : (
- <ThemedText style={styles.settingItemValue}>{autoLockDisplay}</ThemedText>
- )}
- <Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
- </View>
- </TouchableOpacity>
- </View>
+ <View style={styles.section}>
+ {Platform.OS === 'ios' && (
+ <>
+ <TouchableOpacity
+ style={styles.settingItem}
+ onPress={handleIosAutofillPress}
+ >
+ <View style={styles.settingItemIcon}>
+ <Ionicons name="key-outline" size={20} color={colors.text} />
+ </View>
+ <View style={styles.settingItemContent}>
+ <ThemedText style={styles.settingItemText}>iOS Autofill</ThemedText>
+ {shouldShowIosAutofillReminder && (
+ <View style={styles.settingItemBadge}>
+ <ThemedText style={styles.settingItemBadgeText}>1</ThemedText>
+ </View>
+ )}
+ </View>
+ </TouchableOpacity>
+ <View style={styles.separator} />
+ </>
+ )}
+ <TouchableOpacity
+ style={styles.settingItem}
+ onPress={handleVaultUnlockPress}
+ >
+ <View style={styles.settingItemIcon}>
+ <Ionicons name="lock-closed" size={20} color={colors.text} />
+ </View>
+ <View style={styles.settingItemContent}>
+ <ThemedText style={styles.settingItemText}>Vault Unlock Method</ThemedText>
+ {isFirstLoad ? (
+ <InlineSkeletonLoader width={100} style={styles.skeletonLoader} />
+ ) : (
+ <ThemedText style={styles.settingItemValue}>{authMethodDisplay}</ThemedText>
+ )}
+ <Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
+ </View>
+ </TouchableOpacity>
+ <View style={styles.separator} />
+ <TouchableOpacity
+ style={styles.settingItem}
+ onPress={handleAutoLockPress}
+ >
+ <View style={styles.settingItemIcon}>
+ <Ionicons name="timer-outline" size={20} color={colors.text} />
+ </View>
+ <View style={styles.settingItemContent}>
+ <ThemedText style={styles.settingItemText}>Auto-lock Timeout</ThemedText>
+ {isFirstLoad ? (
+ <InlineSkeletonLoader width={80} style={styles.skeletonLoader} />
+ ) : (
+ <ThemedText style={styles.settingItemValue}>{autoLockDisplay}</ThemedText>
+ )}
+ <Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
+ </View>
+ </TouchableOpacity>
+ </View>
- <View style={styles.section}>
- <TouchableOpacity
- style={styles.settingItem}
- onPress={handleLogout}
- >
- <View style={styles.settingItemIcon}>
- <Ionicons name="log-out" size={20} color={colors.primary} />
- </View>
- <View style={styles.settingItemContent}>
- <ThemedText style={[styles.settingItemText, { color: colors.primary }]}>Logout</ThemedText>
- </View>
- </TouchableOpacity>
- </View>
+ <View style={styles.section}>
+ <TouchableOpacity
+ style={styles.settingItem}
+ onPress={handleLogout}
+ >
+ <View style={styles.settingItemIcon}>
+ <Ionicons name="log-out" size={20} color={colors.primary} />
+ </View>
+ <View style={styles.settingItemContent}>
+ <ThemedText style={[styles.settingItemText, { color: colors.primary }]}>Logout</ThemedText>
+ </View>
+ </TouchableOpacity>
+ </View>
- <View style={styles.versionContainer}>
- <ThemedText style={styles.versionText}>App version {AppInfo.VERSION}</ThemedText>
- </View>
- </Animated.ScrollView>
- </ThemedView>
+ <View style={styles.versionContainer}>
+ <ThemedText style={styles.versionText}>App version {AppInfo.VERSION}</ThemedText>
+ </View>
+ </Animated.ScrollView>
</ThemedView>
);
}
\ No newline at end of file
diff --git a/apps/mobile-app/components/Toast.tsx b/apps/mobile-app/components/Toast.tsx
index b9fa1b2a2..3b66d1d17 100644
--- a/apps/mobile-app/components/Toast.tsx
+++ b/apps/mobile-app/components/Toast.tsx
@@ -1,8 +1,12 @@
import { View, Text, StyleSheet } from 'react-native';
import Toast from 'react-native-toast-message';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
-type ToastProps = {
+type BaseToastProps = {
text1?: string;
+};
+
+type ErrorToastProps = BaseToastProps & {
text2?: string;
};
@@ -27,9 +31,7 @@ const styles = StyleSheet.create({
backgroundColor: primaryColor,
borderRadius: 8,
elevation: 5,
- marginBottom: 70,
marginHorizontal: 16,
- marginTop: 20,
padding: 12,
shadowColor: shadowColor,
shadowOffset: {
@@ -50,25 +52,44 @@ const styles = StyleSheet.create({
},
});
-export const toastConfig = {
- /**
- * Success toast.
- */
- success: (props: ToastProps): React.ReactNode => (
+/**
+ * Success toast component with safe area insets.
+ */
+const SuccessToast = (props: BaseToastProps): React.ReactNode => {
+ const insets = useSafeAreaInsets();
+ return (
<View
- style={[styles.toast, styles.toastSuccess]}
+ style={[
+ styles.toast,
+ styles.toastSuccess,
+ {
+ marginTop: insets.top - 38,
+ marginBottom: insets.bottom + 20,
+ },
+ ]}
>
<Text style={styles.text1}>
{props.text1 ?? ''}
</Text>
</View>
- ),
- /**
- * Error toast.
- */
- error: (props: ToastProps): React.ReactNode => (
+ );
+};
+
+/**
+ * Error toast component with safe area insets.
+ */
+const ErrorToast = (props: ErrorToastProps): React.ReactNode => {
+ const insets = useSafeAreaInsets();
+ return (
<View
- style={[styles.toast, styles.toastError]}
+ style={[
+ styles.toast,
+ styles.toastError,
+ {
+ marginTop: insets.top + 20,
+ marginBottom: insets.bottom + 20,
+ },
+ ]}
>
<Text style={styles.text1}>
{props.text1 ?? ''}
@@ -79,19 +100,45 @@ export const toastConfig = {
</Text>
)}
</View>
- ),
- /**
- * Info toast.
- */
- info: (props: ToastProps): React.ReactNode => (
+ );
+};
+
+/**
+ * Info toast component with safe area insets.
+ */
+const InfoToast = (props: BaseToastProps): React.ReactNode => {
+ const insets = useSafeAreaInsets();
+ return (
<View
- style={[styles.toast, styles.toastInfo]}
+ style={[
+ styles.toast,
+ styles.toastInfo,
+ {
+ marginTop: insets.top + 20,
+ marginBottom: insets.bottom + 20,
+ },
+ ]}
>
<Text style={styles.text1}>
{props.text1 ?? ''}
</Text>
</View>
- ),
+ );
+};
+
+export const toastConfig = {
+ /**
+ * Success toast.
+ */
+ success: SuccessToast,
+ /**
+ * Error toast.
+ */
+ error: ErrorToast,
+ /**
+ * Info toast.
+ */
+ info: InfoToast,
};
/**
diff --git a/apps/mobile-app/components/themed/ThemedScrollView.tsx b/apps/mobile-app/components/themed/ThemedScrollView.tsx
index 4935595ad..334bfa10f 100644
--- a/apps/mobile-app/components/themed/ThemedScrollView.tsx
+++ b/apps/mobile-app/components/themed/ThemedScrollView.tsx
@@ -1,4 +1,5 @@
import { Platform, ScrollView, StyleProp, StyleSheet, ViewStyle } from 'react-native';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
type ThemedScrollViewProps = {
style?: StyleProp<ViewStyle>;
@@ -13,11 +14,16 @@ type ThemedScrollViewProps = {
* Themed scroll view component.
*/
export function ThemedScrollView({ style, lightColor, darkColor, ...otherProps }: ThemedScrollViewProps): React.ReactNode {
+ const insets = useSafeAreaInsets();
+
+ const paddingTop = Platform.OS === 'ios' ? insets.top + 36 : 64;
+ const paddingBottom = Platform.OS === 'ios' ? insets.bottom : 0;
+
return (
<ScrollView
- style={[styles.container, style]}
- contentContainerStyle={[styles.contentContainer]}
- scrollIndicatorInsets={styles.scrollIndicatorInsets}
+ style={[styles.container, { paddingTop: paddingTop }, style]}
+ contentContainerStyle={{ paddingBottom: paddingBottom }}
+ scrollIndicatorInsets={{ bottom: paddingBottom }}
{...otherProps}
/>
);
@@ -31,10 +37,4 @@ const styles = StyleSheet.create({
marginBottom: 80,
paddingTop: HEADER_HEIGHT,
},
- contentContainer: {
- paddingBottom: 40,
- },
- scrollIndicatorInsets: {
- bottom: 40,
- },
});
\ No newline at end of file