Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Tweak collapsible header UI (#771)
Leendert de Borst70151f058736
diff --git a/mobile-app/app/(tabs)/(credentials)/[id].tsx b/mobile-app/app/(tabs)/(credentials)/[id].tsxindex 7f3d74a7b..1bf4ee6c3 100644--- a/mobile-app/app/(tabs)/(credentials)/[id].tsx+++ b/mobile-app/app/(tabs)/(credentials)/[id].tsx@@ -64,7 +64,10 @@ export default function CredentialDetailsScreen() {}return (- <ThemedScrollView style={styles.container}>+ <ThemedScrollView style={styles.container}+ contentContainerStyle={{ paddingBottom: 40 }}+ scrollIndicatorInsets={{ bottom: 40 }}+ ><ThemedView style={styles.header}><CredentialIcon logo={credential.Logo} style={styles.logo} /><View style={styles.headerText}>@@ -91,13 +94,13 @@ export default function CredentialDetailsScreen() {const styles = StyleSheet.create({container: {flex: 1,- marginBottom: 100,},header: {flexDirection: 'row',alignItems: 'center',padding: 16,gap: 12,+ marginTop: 6,},headerText: {flex: 1,diff --git a/mobile-app/app/(tabs)/(credentials)/index.tsx b/mobile-app/app/(tabs)/(credentials)/index.tsxindex ae4d5e07c..06907a254 100644--- a/mobile-app/app/(tabs)/(credentials)/index.tsx+++ b/mobile-app/app/(tabs)/(credentials)/index.tsx@@ -1,6 +1,7 @@import { StyleSheet, Text, FlatList, ActivityIndicator, TouchableOpacity, TextInput, Keyboard, RefreshControl, Platform, Animated } from 'react-native';import { useState, useEffect, useCallback, useRef } from 'react';import { useNavigation } from '@react-navigation/native';+import { useRouter } from 'expo-router';import { ThemedText } from '@/components/ThemedText';import { ThemedView } from '@/components/ThemedView';import { ThemedSafeAreaView } from '@/components/ThemedSafeAreaView';@@ -25,6 +26,13 @@ export default function CredentialsScreen() {const scrollY = useRef(new Animated.Value(0)).current;const navigation = useNavigation();const [isTabFocused, setIsTabFocused] = useState(false);+ const router = useRouter();++ const headerButtons = [{+ icon: 'add' as const,+ position: 'right' as const,+ onPress: () => router.push('/(modals)/add-credential')+ }];useEffect(() => {const unsubscribeFocus = navigation.addListener('focus', () => {@@ -146,6 +154,8 @@ export default function CredentialsScreen() {content: {flex: 1,padding: 16,+ paddingTop: 0,+ marginTop: 36,},stepContainer: {flex: 1,@@ -197,6 +207,8 @@ export default function CredentialsScreen() {title="Credentials"scrollY={scrollY}showNavigationHeader={true}+ alwaysVisible={true}+ headerButtons={headerButtons}/><ThemedView style={styles.content}>@@ -214,7 +226,7 @@ export default function CredentialsScreen() {{ useNativeDriver: true })}scrollEventThrottle={16}- contentContainerStyle={{ paddingBottom: 40 }}+ contentContainerStyle={{ paddingBottom: 40, paddingTop: 4 }}scrollIndicatorInsets={{ bottom: 40 }}ListHeaderComponent={<ThemedView>diff --git a/mobile-app/app/(tabs)/(emails)/index.tsx b/mobile-app/app/(tabs)/(emails)/index.tsxindex 81befa946..a3fe3ae98 100644--- a/mobile-app/app/(tabs)/(emails)/index.tsx+++ b/mobile-app/app/(tabs)/(emails)/index.tsx@@ -168,6 +168,7 @@ export default function EmailsScreen() {content: {flex: 1,padding: 16,+ marginTop: 22,},headerImage: {color: colors.textMuted,@@ -212,7 +213,7 @@ export default function EmailsScreen() {{ useNativeDriver: true })}scrollEventThrottle={16}- contentContainerStyle={{ paddingBottom: 40 }}+ contentContainerStyle={{ paddingBottom: 40, paddingTop: 4 }}scrollIndicatorInsets={{ bottom: 40 }}refreshControl={<RefreshControldiff --git a/mobile-app/app/_layout.tsx b/mobile-app/app/_layout.tsxindex 75d6ef8ab..c2a7ffa59 100644--- a/mobile-app/app/_layout.tsx+++ b/mobile-app/app/_layout.tsx@@ -30,7 +30,7 @@ const toastConfig = {borderRadius: 8,marginHorizontal: 16,marginBottom: 70,- marginTop: 30,+ marginTop: 20,shadowColor: '#000',shadowOffset: {width: 0,diff --git a/mobile-app/components/CollapsibleHeader.tsx b/mobile-app/components/CollapsibleHeader.tsxindex 0d864bbfb..ae8d2a7a3 100644--- a/mobile-app/components/CollapsibleHeader.tsx+++ b/mobile-app/components/CollapsibleHeader.tsx@@ -1,44 +1,99 @@import React from 'react';-import { StyleSheet, Platform, Animated } from 'react-native';-import { Stack } from 'expo-router';+import { StyleSheet, Platform, Animated, TouchableOpacity } from 'react-native';+import { Stack, useRouter } from 'expo-router';import { useColors } from '@/hooks/useColorScheme';import { ThemedText } from './ThemedText';+import MaterialIcons from '@expo/vector-icons/MaterialIcons';++interface HeaderButton {+ icon: keyof typeof MaterialIcons.glyphMap;+ onPress: () => void;+ position: 'left' | 'right';+}interface CollapsibleHeaderProps {title: string;scrollY: Animated.Value;showNavigationHeader?: boolean;+ alwaysVisible?: boolean;+ headerButtons?: HeaderButton[];}-export function CollapsibleHeader({ title, scrollY, showNavigationHeader = false }: CollapsibleHeaderProps) {+export function CollapsibleHeader({+ title,+ scrollY,+ showNavigationHeader = false,+ alwaysVisible = false,+ headerButtons = []+}: CollapsibleHeaderProps) {const colors = useColors();- // Calculate header opacity based on scroll position+ // Calculate header opacity based on scroll position and transformconst headerOpacity = scrollY.interpolate({inputRange: [10, 60],outputRange: [0, 1],extrapolate: 'clamp',});+ const titleOpacity = scrollY.interpolate({+ inputRange: [10, 60],+ outputRange: [0, 1],+ extrapolate: 'clamp',+ });++ 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],+ });+const styles = StyleSheet.create({floatingHeader: {position: 'absolute',top: 0,left: 0,right: 0,- height: Platform.OS === 'ios' ? 96 : 64,- backgroundColor: colors.accentBackground,- alignItems: 'center',- justifyContent: 'flex-end',- paddingBottom: 12,- borderBottomWidth: 1,- borderBottomColor: colors.accentBorder,+ height: Platform.OS === 'ios' ? 100 : 64,+ flexDirection: 'row',+ alignItems: 'flex-end',+ justifyContent: 'center',+ paddingBottom: Platform.OS === 'ios' ? 12 : 16,zIndex: 100,+ paddingTop: Platform.OS === 'ios' ? 60 : 0,},floatingTitle: {- fontSize: 17,+ fontSize: Platform.OS === 'ios' ? 20 : 17,fontWeight: '600',color: colors.text,+ flex: 1,+ textAlign: 'center',+ marginHorizontal: 50,+ marginTop: 5,+ },+ headerButton: {+ position: 'absolute',+ bottom: Platform.OS === 'ios' ? 6 : 16,+ color: colors.primary,+ padding: 4,+ },+ leftButton: {+ left: 16,+ },+ rightButton: {+ right: 16,+ },+ headerBorder: {+ position: 'absolute',+ bottom: 0,+ left: 0,+ right: 0,+ height: 1,+ backgroundColor: colors.accentBorder,},});@@ -55,17 +110,38 @@ export function CollapsibleHeader({ title, scrollY, showNavigationHeader = falsestyle={[styles.floatingHeader,{- opacity: headerOpacity,+ backgroundColor: headerBackground,transform: [{- translateY: headerOpacity.interpolate({- inputRange: [0, 1],- outputRange: [-20, 0],- })+ translateY: headerTransform}]}]}>- <ThemedText style={styles.floatingTitle}>{title}</ThemedText>+ <Animated.View style={{ flex: 1, opacity: alwaysVisible ? titleOpacity : headerOpacity }}>+ <ThemedText style={styles.floatingTitle}>{title}</ThemedText>+ </Animated.View>++ {headerButtons.map((button, index) => (+ <TouchableOpacity+ key={`${button.icon}-${index}`}+ style={[+ styles.headerButton,+ button.position === 'left' ? styles.leftButton : styles.rightButton+ ]}+ onPress={button.onPress}+ >+ <MaterialIcons name={button.icon} size={28} color={colors.primary} />+ </TouchableOpacity>+ ))}++ <Animated.View+ style={[+ styles.headerBorder,+ {+ opacity: headerOpacity+ }+ ]}+ /></Animated.View></>);diff --git a/mobile-app/components/TitleContainer.tsx b/mobile-app/components/TitleContainer.tsxindex 31e036ede..872eb8dce 100644--- a/mobile-app/components/TitleContainer.tsx+++ b/mobile-app/components/TitleContainer.tsx@@ -10,7 +10,7 @@ interface TitleContainerProps {export function TitleContainer({ title, showLogo = true }: TitleContainerProps) {return (<View style={styles.titleContainer}>- {showLogo && <Logo width={40} height={40} />}+ {showLogo && <Logo width={40} height={40} style={styles.logo} />}<ThemedText type="title">{title}</ThemedText></View>);@@ -23,4 +23,7 @@ const styles = StyleSheet.create({gap: 8,marginBottom: 16,},+ logo: {+ marginBottom: 6,+ },});