/*
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React, { useState } from 'react';
import type {Node} from 'react';
import {
ScrollView,
StatusBar,
StyleSheet,
TouchableOpacity,
Text,
useColorScheme,
View,
} from 'react-native';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
import MenuDrawer from 'react-native-side-drawer'
const Drawer = (props) => {
const overlay = false
const position = 'left'
const drawerContent = () => {
const edges = position == 'right' ? ['bottom', 'top', 'right'] : ['bottom', 'top', 'left']
const baseStyle = {flex: 1, backgroundColor: 'blue', borderStyle: 'solid', borderWidth: 2, borderColor: 'black'}
return(
Overlay={overlay.toString()}
Position={position}
I will disappear if you click here
When using overlay you will need to account for SafeAreView and it needs unique styling
)
}
return (
{props.children}
);
}
const App: () => Node = () => {
const [openDrawer, setDrawerOpen] = useState(false)
const toggleDrawer = () => {
setDrawerOpen(!openDrawer)
}
return (
Press me to open the drawer
);
};
const styles = StyleSheet.create({
safeArea: {
flex: 1, backgroundColor: 'blue'
},
container: {
flex: 1, flexDirection: 'column', justifyItems: 'center', alignItems: 'center',
backgroundColor: 'white', padding: 30
},
text: {
paddingTop: 20
},
textLink: {
paddingTop: 20,
color: 'blue'
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
},
highlight: {
fontWeight: '700',
},
});
export default App;