Skip to content

Commit a45fb7f

Browse files
committed
Do design header
1 parent 17425c4 commit a45fb7f

File tree

6 files changed

+82
-20
lines changed

6 files changed

+82
-20
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@
4545
11. Design UI
4646

4747
- https://www.youtube.com/watch?v=TkuQAjnaSbM
48+
49+
12. Asset free UI - UX
50+
51+
- https://www.vecteezy.com/vector-art/251964-mobile-payment-online-service-for-modern-business-website-socia

src/navigation/ContentDrawer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ import {Text, Button} from 'react-native';
55
import {CTX} from '../tools/context';
66

77
export default function CustomDrawerContent({progress, ...rest}) {
8-
const {navigation} = rest;
8+
const {navigation, closeDrawer} = rest;
99
const {navigate} = navigation;
1010

1111
const authContext = useContext(CTX);
1212
const {_logout} = authContext;
1313

1414
// const {loading, error, data} = useQuery(GET_GREETING);
15+
function _onClose() {
16+
closeDrawer();
17+
}
1518

1619
function _onLogout() {
1720
_logout();
18-
console.log(navigate);
1921
navigate('Login');
2022
}
23+
2124
const translateX = Animated.interpolate(progress, {
2225
inputRange: [0, 1],
2326
outputRange: [-100, 0],
@@ -32,6 +35,7 @@ export default function CustomDrawerContent({progress, ...rest}) {
3235
transform: [{translateX}],
3336
}}>
3437
<Text>Hello</Text>
38+
<Button onPress={_onClose} title="Close" color="#841584" />
3539
<Button onPress={_onLogout} title="Log out" color="#841584" />
3640
</Animated.View>
3741
);

src/navigation/DashboardNavigator.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
11
import React from 'react';
22
import {createStackNavigator} from '@react-navigation/stack';
3+
import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5';
34

45
import TabNavigator from './TabNavigator';
56

67
const Stack = createStackNavigator();
78

89
export default function DashboardStackNavigator(props) {
10+
const {toggleDrawer} = props;
11+
912
return (
1013
<Stack.Navigator>
1114
<Stack.Screen
1215
name="DashboardTabNavigator"
16+
options={{
17+
title: 'Chnirt',
18+
headerTitleAlign: 'left',
19+
headerStyle: {backgroundColor: '#fff'},
20+
headerLeft: () => (
21+
<FontAwesome5Icon
22+
style={{paddingLeft: 20}}
23+
name={'bars'}
24+
// color={'red'}
25+
size={24}
26+
onPress={toggleDrawer}
27+
/>
28+
),
29+
headerRight: () => (
30+
<FontAwesome5Icon
31+
style={{paddingRight: 20}}
32+
name={'bell'}
33+
// color={'red'}
34+
size={24}
35+
onPress={toggleDrawer}
36+
/>
37+
),
38+
}}
1339
children={() => <TabNavigator {...props} />}
1440
/>
1541
</Stack.Navigator>

src/navigation/DrawerNavigator.js

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,41 @@ const Drawer = createDrawerNavigator();
1010
export default function DrawerNavigator(props) {
1111
return (
1212
<Drawer.Navigator
13+
// headerLeft={() => (
14+
// <Icon
15+
// style={{paddingLeft: 10}}
16+
// onPress={() => navigation.openDrawer()}
17+
// name={Platform.OS === 'ios' ? 'ios-menu' : 'md-menu'}
18+
// size={30}
19+
// />
20+
// )}
21+
// headerMode="screen"
22+
// screenOptions={{
23+
// headerTintColor: 'white',
24+
// headerStyle: {backgroundColor: 'tomato'},
25+
// }}
1326
// drawerStyle={{
1427
// backgroundColor: '#c6cbef',
1528
// width: 240,
1629
// }}
17-
// drawerContentOptions={{
18-
// activeTintColor: primaryColor,
19-
// itemStyle: {marginVertical: 0},
20-
// }}
21-
// navigationOptions={{
22-
// headerStyle: {
23-
// backgroundColor: 'red',
24-
// },
25-
// headerRight: <FontAwesome5 name={'user'} color={'red'} size={24} />,
26-
// }}
27-
headerRight={() => <FontAwesome5 name={'user'} color={'red'} size={24} />}
28-
drawerContent={() => <CustomDrawerContent {...props} />}>
30+
drawerContentOptions={{
31+
// activeTintColor: primaryColor,
32+
itemStyle: {marginVertical: 0},
33+
}}
34+
drawerContent={newProps => (
35+
<CustomDrawerContent
36+
{...props}
37+
closeDrawer={newProps.navigation.closeDrawer}
38+
/>
39+
)}>
2940
<Drawer.Screen
3041
name="Dashboard"
31-
children={() => <DashboardNavigator {...props} />}
42+
children={newProps => (
43+
<DashboardNavigator
44+
{...props}
45+
toggleDrawer={newProps.navigation.toggleDrawer}
46+
/>
47+
)}
3248
/>
3349
</Drawer.Navigator>
3450
);

src/navigation/TabNavigator.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,37 @@ function Profile() {
4242
export default function TabNavigator(props) {
4343
return (
4444
<Tab.Navigator
45-
initialRouteName="Feed"
45+
initialRouteName="Profile"
46+
navigationOptions={{title: 'routeName'}}
4647
tabBarOptions={{
4748
activeTintColor: primaryColor,
4849
}}>
4950
<Tab.Screen
5051
name="Feed"
5152
options={{
52-
tabBarLabel: 'Home',
53+
tabBarLabel: () => <View />,
5354
tabBarIcon: ({color, size}) => (
5455
<FontAwesome5 name={'home'} color={color} size={size} />
5556
),
5657
}}
5758
children={() => <Feed {...props} />}
5859
/>
60+
<Tab.Screen
61+
name="Notifications1"
62+
options={{
63+
tabBarLabel: () => <View />,
64+
tabBarIcon: ({color, size}) => (
65+
<FontAwesome5 name={'heart'} color={color} size={size} />
66+
),
67+
}}
68+
children={() => <Notifications {...props} />}
69+
/>
5970
<Tab.Screen
6071
name="Notifications"
6172
options={{
62-
tabBarLabel: 'Notifications',
73+
tabBarLabel: () => <View />,
6374
tabBarIcon: ({color, size}) => (
64-
<FontAwesome5 name={'bell'} color={color} size={size} />
75+
<FontAwesome5 name={'heart'} color={color} size={size} />
6576
),
6677
}}
6778
children={() => <Notifications {...props} />}
@@ -70,7 +81,7 @@ export default function TabNavigator(props) {
7081
name="Profile"
7182
component={Profile}
7283
options={{
73-
tabBarLabel: 'Profile',
84+
tabBarLabel: () => <View />,
7485
tabBarIcon: ({color, size}) => (
7586
<FontAwesome5 name={'user'} color={color} size={size} />
7687
),

src/theme/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
const primaryColor = '#e91e63';
2+
const secondaryColor = '#3E54DA';
23

34
export {primaryColor};

0 commit comments

Comments
 (0)