mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 23:45:21 +00:00
connecting contact screen
This commit is contained in:
parent
fc29f2b2e5
commit
192fcd1b6c
@ -1,4 +1,8 @@
|
|||||||
import React from 'react';
|
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 = {
|
export type ContactParams = {
|
||||||
guid: string;
|
guid: string;
|
||||||
@ -13,6 +17,14 @@ export type ContactParams = {
|
|||||||
offsync?: boolean;
|
offsync?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Profile() {
|
export function Profile({ close }) {
|
||||||
return <></>;
|
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>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -108,10 +108,13 @@ function ContactTab({ scheme }: { scheme: string }) {
|
|||||||
<NavigationContainer theme={scheme === 'dark' ? DarkTheme : DefaultTheme}>
|
<NavigationContainer theme={scheme === 'dark' ? DarkTheme : DefaultTheme}>
|
||||||
<ContactStack.Navigator initialRouteName="contacts" screenOptions={{ headerShown: false }}>
|
<ContactStack.Navigator initialRouteName="contacts" screenOptions={{ headerShown: false }}>
|
||||||
<ContactStack.Screen name="contacts" options={{ headerBackTitleVisible: 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>
|
||||||
<ContactStack.Screen name="registry" options={{ headerBackTitleVisible: false, ...TransitionPresets.ScaleFromCenterAndroid }}>
|
<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.Screen>
|
||||||
</ContactStack.Navigator>
|
</ContactStack.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
@ -143,6 +146,7 @@ function ProfileScreen({nav}) {
|
|||||||
id="ProfileDrawer"
|
id="ProfileDrawer"
|
||||||
drawerContent={Profile}
|
drawerContent={Profile}
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
|
drawerStyle: {width: 300},
|
||||||
drawerPosition: 'right',
|
drawerPosition: 'right',
|
||||||
drawerType: 'front',
|
drawerType: 'front',
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
@ -162,7 +166,7 @@ function RegistryScreen({nav}) {
|
|||||||
id="RegistryDrawer"
|
id="RegistryDrawer"
|
||||||
drawerContent={() => (
|
drawerContent={() => (
|
||||||
<Surface elevation={1}>
|
<Surface elevation={1}>
|
||||||
<Registry openContact={(params: ContactParams)=>{console.log('opencon', params)}} />
|
<Registry openContact={(params: ContactParams)=>{nav.profile.openDrawer()}} />
|
||||||
</Surface>
|
</Surface>
|
||||||
)}
|
)}
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
@ -186,7 +190,7 @@ function ContactsScreen({nav}) {
|
|||||||
id="ContactsDrawer"
|
id="ContactsDrawer"
|
||||||
drawerContent={() => (
|
drawerContent={() => (
|
||||||
<Surface elevation={1}>
|
<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>
|
</Surface>
|
||||||
)}
|
)}
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user