-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathApp.js
More file actions
36 lines (32 loc) · 814 Bytes
/
App.js
File metadata and controls
36 lines (32 loc) · 814 Bytes
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
import React, {useState} from 'react';
import {SafeAreaView, StyleSheet, View} from 'react-native';
import MockUI from './MockUI';
import SwipeButton from './SwipeButton';
const App = () => {
const [toggleState, setToggleState] = useState(false);
const handleToggle = (value) => setToggleState(value);
return (
<SafeAreaView>
<View
style={[
styles.root,
{backgroundColor: toggleState ? '#222' : '#ebedee'},
]}>
<MockUI />
<SwipeButton onToggle={handleToggle} />
<MockUI />
</View>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
root: {
width: '100%',
height: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
},
});
export default App;