-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
58 lines (55 loc) · 1.67 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React, { useContext } from 'react'
import { Alert, StatusBar, StyleSheet } from 'react-native'
import { ScrollView } from 'react-native-gesture-handler'
import CheckItem from './components/CheckItem'
import CheckSection from './components/CheckSection'
import ProfileSection from './components/ProfileSection'
import RecentContact from './components/RecentContact'
import SearchInput from './components/SearchInput'
import Slider from './components/Slider'
import TextedSwitch from './components/TextedSwitch'
import { ThemeContext } from './context/ThemeContext'
const App = () => {
const { isDark } = useContext(ThemeContext)
return (
<React.Fragment>
<StatusBar
backgroundColor={isDark ? '#1F1D2A' : '#fff'}
barStyle={isDark ? 'light-content' : 'dark-content'}
/>
<ScrollView
keyboardShouldPersistTaps="handled"
style={styles.container(isDark)}
contentContainerStyle={styles.contentContainer}>
<SearchInput />
<ProfileSection />
<CheckSection />
<RecentContact />
<CheckItem />
<TextedSwitch />
<Slider
label="SWIPE TO PAY"
onSuccessSwipe={() =>
Alert.alert(
'Payment Success!',
'Yay!',
[
{
text: ' ',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel'
},
{ text: 'Okay', onPress: () => console.log('OK Pressed') }
],
{ cancelable: false }
)}
/>
</ScrollView>
</React.Fragment>
)
}
export default App
const styles = StyleSheet.create({
container: (isDark) => ({ flex: 1, backgroundColor: isDark ? '#1F1D2A' : '#fff', paddingHorizontal: 16 }),
contentContainer: { paddingTop: 16, paddingBottom: 24 }
})