Skip to content

Commit df7df72

Browse files
committed
Design TabBottom
1 parent 6a7bc41 commit df7df72

File tree

6 files changed

+129
-41
lines changed

6 files changed

+129
-41
lines changed

src/navigation/TabNavigator.js

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,17 @@
1-
import React, {useContext} from 'react';
1+
import React from 'react';
22
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
3-
import {View, Text, StyleSheet} from 'react-native';
3+
import {View} from 'react-native';
44
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
55

66
import {primaryColor} from '../theme';
7-
8-
const styles = StyleSheet.create({
9-
container: {
10-
flex: 1,
11-
alignItems: 'center',
12-
justifyContent: 'center',
13-
},
14-
});
7+
import Home from '../screens/Home';
8+
import Message from '../screens/Message';
9+
import Post from '../screens/Post';
10+
import Notification from '../screens/Notification';
11+
import Profile from '../screens/Profile';
1512

1613
const Tab = createBottomTabNavigator();
1714

18-
function Feed() {
19-
return (
20-
<View style={styles.container}>
21-
<Text>Feed</Text>
22-
</View>
23-
);
24-
}
25-
26-
function Notifications() {
27-
return (
28-
<View style={styles.container}>
29-
<Text>Notifications</Text>
30-
</View>
31-
);
32-
}
33-
34-
function Profile() {
35-
return (
36-
<View style={styles.container}>
37-
<Text>Profile</Text>
38-
</View>
39-
);
40-
}
41-
4215
export default function TabNavigator(props) {
4316
return (
4417
<Tab.Navigator
@@ -55,27 +28,37 @@ export default function TabNavigator(props) {
5528
<FontAwesome5 name={'home'} color={color} size={size} />
5629
),
5730
}}
58-
children={() => <Feed {...props} />}
31+
children={() => <Home {...props} />}
32+
/>
33+
<Tab.Screen
34+
name="Message"
35+
options={{
36+
tabBarLabel: () => <View />,
37+
tabBarIcon: ({color, size}) => (
38+
<FontAwesome5 name={'comments'} color={color} size={size} />
39+
),
40+
}}
41+
children={() => <Message {...props} />}
5942
/>
6043
<Tab.Screen
61-
name="Notifications1"
44+
name="Post"
6245
options={{
6346
tabBarLabel: () => <View />,
6447
tabBarIcon: ({color, size}) => (
65-
<FontAwesome5 name={'heart'} color={color} size={size} />
48+
<FontAwesome5 name={'plus'} color={color} size={size} />
6649
),
6750
}}
68-
children={() => <Notifications {...props} />}
51+
children={() => <Post {...props} />}
6952
/>
7053
<Tab.Screen
71-
name="Notifications"
54+
name="Notification"
7255
options={{
7356
tabBarLabel: () => <View />,
7457
tabBarIcon: ({color, size}) => (
75-
<FontAwesome5 name={'heart'} color={color} size={size} />
58+
<FontAwesome5 name={'bell'} color={color} size={size} />
7659
),
7760
}}
78-
children={() => <Notifications {...props} />}
61+
children={() => <Notification {...props} />}
7962
/>
8063
<Tab.Screen
8164
name="Profile"

src/screens/Home.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, {Component} from 'react';
2+
import {Text, StyleSheet, View} from 'react-native';
3+
4+
export default class BirthdayScreen extends Component {
5+
render() {
6+
return (
7+
<View style={styles.container}>
8+
<Text> Home </Text>
9+
</View>
10+
);
11+
}
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
alignItems: 'center',
18+
justifyContent: 'center',
19+
backgroundColor: 'transparent',
20+
},
21+
});

src/screens/Message.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, {Component} from 'react';
2+
import {Text, StyleSheet, View} from 'react-native';
3+
4+
export default class BirthdayScreen extends Component {
5+
render() {
6+
return (
7+
<View style={styles.container}>
8+
<Text> Message </Text>
9+
</View>
10+
);
11+
}
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
alignItems: 'center',
18+
justifyContent: 'center',
19+
backgroundColor: 'transparent',
20+
},
21+
});

src/screens/Notification.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, {Component} from 'react';
2+
import {Text, StyleSheet, View} from 'react-native';
3+
4+
export default class BirthdayScreen extends Component {
5+
render() {
6+
return (
7+
<View style={styles.container}>
8+
<Text> Notification </Text>
9+
</View>
10+
);
11+
}
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
alignItems: 'center',
18+
justifyContent: 'center',
19+
backgroundColor: 'transparent',
20+
},
21+
});

src/screens/Post.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, {Component} from 'react';
2+
import {Text, StyleSheet, View} from 'react-native';
3+
4+
export default class BirthdayScreen extends Component {
5+
render() {
6+
return (
7+
<View style={styles.container}>
8+
<Text> Post </Text>
9+
</View>
10+
);
11+
}
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
alignItems: 'center',
18+
justifyContent: 'center',
19+
backgroundColor: 'transparent',
20+
},
21+
});

src/screens/Profile.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, {Component} from 'react';
2+
import {Text, StyleSheet, View} from 'react-native';
3+
4+
export default class BirthdayScreen extends Component {
5+
render() {
6+
return (
7+
<View style={styles.container}>
8+
<Text> Profile </Text>
9+
</View>
10+
);
11+
}
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
alignItems: 'center',
18+
justifyContent: 'center',
19+
backgroundColor: 'transparent',
20+
},
21+
});

0 commit comments

Comments
 (0)