connecting contact screen

This commit is contained in:
Roland Osborne 2024-10-22 16:41:31 -07:00
parent fc29f2b2e5
commit 192fcd1b6c
2 changed files with 22 additions and 6 deletions

View File

@ -1,4 +1,8 @@
import React from 'react';
import { IconButton } from 'react-native-paper';
import { SafeAreaView, View } from 'react-native';
import { styles } from './Profile.styled';
import { useProfile } from './useProfile.hook';
export type ContactParams = {
guid: string;
@ -13,6 +17,14 @@ export type ContactParams = {
offsync?: boolean;
}
export function Profile() {
return <></>;
export function Profile({ close }) {
return (
<View style={styles.profile}>
<SafeAreaView style={styles.header}>
{ close && (
<IconButton style={styles.close} compact="true" mode="contained" icon="arrow-left" size={24} onPress={close} />
)}
</SafeAreaView>
</View>
)
}

View File

@ -108,10 +108,13 @@ function ContactTab({ scheme }: { scheme: string }) {
<NavigationContainer theme={scheme === 'dark' ? DarkTheme : DefaultTheme}>
<ContactStack.Navigator initialRouteName="contacts" screenOptions={{ headerShown: false }}>
<ContactStack.Screen name="contacts" options={{ headerBackTitleVisible: false }}>
{(props) => <Contacts openRegistry={()=>{props.navigation.navigate('registry')}} openContact={(params: ContactParams)=>{console.log('opencon', params)}} />}
{(props) => <Contacts openRegistry={()=>{props.navigation.navigate('registry')}} openContact={(params: ContactParams)=>{props.navigation.navigate('profile')}} />}
</ContactStack.Screen>
<ContactStack.Screen name="registry" options={{ headerBackTitleVisible: false, ...TransitionPresets.ScaleFromCenterAndroid }}>
{(props) => <Registry close={props.navigation.goBack} openContact={(params: ContactParams)=>{console.log('opencon', params)}} />}
{(props) => <Registry close={props.navigation.goBack} openContact={(params: ContactParams)=>{props.navigation.navigate('profile')}} />}
</ContactStack.Screen>
<ContactStack.Screen name="profile" options={{ headerBackTitleVisible: false, ...TransitionPresets.ScaleFromCenterAndroid }}>
{(props) => <Profile close={props.navigation.goBack} />}
</ContactStack.Screen>
</ContactStack.Navigator>
</NavigationContainer>
@ -143,6 +146,7 @@ function ProfileScreen({nav}) {
id="ProfileDrawer"
drawerContent={Profile}
screenOptions={{
drawerStyle: {width: 300},
drawerPosition: 'right',
drawerType: 'front',
headerShown: false,
@ -162,7 +166,7 @@ function RegistryScreen({nav}) {
id="RegistryDrawer"
drawerContent={() => (
<Surface elevation={1}>
<Registry openContact={(params: ContactParams)=>{console.log('opencon', params)}} />
<Registry openContact={(params: ContactParams)=>{nav.profile.openDrawer()}} />
</Surface>
)}
screenOptions={{
@ -186,7 +190,7 @@ function ContactsScreen({nav}) {
id="ContactsDrawer"
drawerContent={() => (
<Surface elevation={1}>
<Contacts openRegistry={()=>{nav.registry.openDrawer()}} openContact={(params: ContactParams)=>{console.log('opencon', params)}} />
<Contacts openRegistry={nav.registry.openDrawer} openContact={(params: ContactParams)=>{nav.profile.openDrawer()}} />
</Surface>
)}
screenOptions={{