|
1 | | -import * as React from 'react'; |
2 | | -import { StyleSheet, View, Text, SafeAreaView, Image } from 'react-native'; |
3 | | -import { assets } from './assets'; |
4 | | -import { CollapsedView } from 'react-native-accordion'; |
5 | | -import { useCallback } from 'react'; |
| 1 | +import { StatusBar } from 'expo-status-bar'; |
| 2 | +import React from 'react'; |
| 3 | +import { SafeAreaProvider } from 'react-native-safe-area-context'; |
| 4 | +import { BottomBarNavigator } from './navigation'; |
| 5 | +import { NavigationContainer } from '@react-navigation/native'; |
6 | 6 |
|
7 | | -const menu = [ |
8 | | - { |
9 | | - title: 'UI/UX Creative', |
10 | | - description: 'The hacking UI podcast', |
11 | | - image: assets.people_1, |
12 | | - time: '2 MINS AGO', |
13 | | - }, |
14 | | - { |
15 | | - title: 'Joni Ernest', |
16 | | - description: 'The wicked wall flowers club', |
17 | | - image: assets.people_2, |
18 | | - time: '15 MINS AGO', |
19 | | - }, |
20 | | - { |
21 | | - title: 'Emilie Lose ', |
22 | | - description: 'Icon design learning', |
23 | | - image: assets.people_3, |
24 | | - time: '45 MINS AGO', |
25 | | - }, |
26 | | -]; |
27 | | - |
28 | | -const App = () => { |
29 | | - const handleContentTouchable = useCallback( |
30 | | - () => ( |
31 | | - <View style={styles.row}> |
32 | | - <View style={styles.shape}> |
33 | | - <Image |
34 | | - source={assets.notification} |
35 | | - resizeMode={'contain'} |
36 | | - style={styles.icon} |
37 | | - /> |
38 | | - </View> |
39 | | - <Text style={styles.title}>Notifications</Text> |
40 | | - </View> |
41 | | - ), |
42 | | - [] |
43 | | - ); |
44 | | - |
45 | | - const handleContent = useCallback( |
46 | | - () => |
47 | | - menu.map(({ title, description, image }) => ( |
48 | | - <View style={styles.contentItem}> |
49 | | - <Image source={image} resizeMode={'contain'} style={styles.avatar} /> |
50 | | - <View style={{ flex: 1 }}> |
51 | | - <View style={styles.row}> |
52 | | - <Text style={styles.name}>{title}</Text> |
53 | | - <Text style={styles.notification}>2 MINS AGO</Text> |
54 | | - </View> |
55 | | - <View style={styles.item}> |
56 | | - <Text style={styles.description}>{description}</Text> |
57 | | - <View style={styles.circle}> |
58 | | - <Text style={styles.notification}>2</Text> |
59 | | - </View> |
60 | | - </View> |
61 | | - </View> |
62 | | - </View> |
63 | | - )), |
64 | | - [] |
65 | | - ); |
| 7 | +export default function App() { |
66 | 8 | return ( |
67 | | - <SafeAreaView style={styles.container}> |
68 | | - <CollapsedView |
69 | | - onChangeState={(value: boolean) => console.log(value)} |
70 | | - handleContentTouchable={handleContentTouchable} |
71 | | - renderContent={handleContent} |
72 | | - styleTouchable={styles.touchable} |
73 | | - styleContainer={styles.content} |
74 | | - /> |
75 | | - <CollapsedView |
76 | | - onChangeState={(value: boolean) => console.log(value)} |
77 | | - handleContentTouchable={handleContentTouchable} |
78 | | - renderContent={handleContent} |
79 | | - styleTouchable={styles.touchable} |
80 | | - styleContainer={styles.content} |
81 | | - /> |
82 | | - </SafeAreaView> |
| 9 | + <SafeAreaProvider> |
| 10 | + <NavigationContainer> |
| 11 | + <BottomBarNavigator /> |
| 12 | + </NavigationContainer> |
| 13 | + <StatusBar /> |
| 14 | + </SafeAreaProvider> |
83 | 15 | ); |
84 | | -}; |
85 | | -export default App; |
86 | | - |
87 | | -const styles = StyleSheet.create({ |
88 | | - container: { |
89 | | - flex: 1, |
90 | | - }, |
91 | | - content: { |
92 | | - paddingHorizontal: 12, |
93 | | - }, |
94 | | - touchable: { |
95 | | - backgroundColor: 'white', |
96 | | - }, |
97 | | - row: { |
98 | | - flexDirection: 'row', |
99 | | - justifyContent: 'flex-start', |
100 | | - alignItems: 'center', |
101 | | - }, |
102 | | - contentItem: { |
103 | | - flexDirection: 'row', |
104 | | - backgroundColor: 'red', |
105 | | - }, |
106 | | - |
107 | | - item: { |
108 | | - flexDirection: 'row', |
109 | | - justifyContent: 'space-between', |
110 | | - alignItems: 'center', |
111 | | - }, |
112 | | - shape: { |
113 | | - height: 34, |
114 | | - width: 34, |
115 | | - borderRadius: 8, |
116 | | - justifyContent: 'center', |
117 | | - alignItems: 'center', |
118 | | - backgroundColor: '#e5f6ff', |
119 | | - }, |
120 | | - |
121 | | - circle: { |
122 | | - height: 24, |
123 | | - width: 24, |
124 | | - borderRadius: 24 / 2, |
125 | | - justifyContent: 'center', |
126 | | - alignItems: 'center', |
127 | | - backgroundColor: '#2276fe', |
128 | | - }, |
129 | | - notification: { |
130 | | - color: 'white', |
131 | | - }, |
132 | | - icon: { |
133 | | - tintColor: '#00a1ed', |
134 | | - height: 18, |
135 | | - width: 18, |
136 | | - }, |
137 | | - avatar: { |
138 | | - height: 36, |
139 | | - width: 36, |
140 | | - borderRadius: 36 / 2, |
141 | | - }, |
142 | | - title: { |
143 | | - marginStart: 12, |
144 | | - fontSize: 20, |
145 | | - color: '#0b0e25', |
146 | | - }, |
147 | | - name: { |
148 | | - fontSize: 14, |
149 | | - color: '#0b0e25', |
150 | | - }, |
151 | | - description: { |
152 | | - fontSize: 14, |
153 | | - color: '#6da4ff', |
154 | | - }, |
155 | | -}); |
| 16 | +} |
0 commit comments