tooot/src/components/Menu/Container.tsx

39 lines
795 B
TypeScript
Raw Normal View History

2020-11-22 00:46:23 +01:00
import React from 'react'
2020-11-24 00:18:47 +01:00
import { StyleSheet, View } from 'react-native'
import { useTheme } from 'src/utils/styles/ThemeManager'
2020-11-30 00:24:53 +01:00
import { StyleConstants } from 'src/utils/styles/constants'
2020-11-22 00:46:23 +01:00
export interface Props {
children: React.ReactNode
marginTop?: boolean
}
const MenuContainer: React.FC<Props> = ({ ...props }) => {
2020-11-24 00:18:47 +01:00
const { theme } = useTheme()
return (
<View
style={[
styles.base,
{
borderTopColor: theme.separator,
2020-11-30 00:24:53 +01:00
marginTop: props.marginTop
? StyleConstants.Spacing.Global.PagePadding
: 0
}
]}
>
2020-11-24 00:18:47 +01:00
{props.children}
</View>
)
2020-11-22 00:46:23 +01:00
}
2020-11-24 00:18:47 +01:00
const styles = StyleSheet.create({
base: {
borderTopWidth: 1,
2020-12-02 00:16:27 +01:00
marginBottom: StyleConstants.Spacing.L
2020-11-24 00:18:47 +01:00
}
})
2020-11-22 00:46:23 +01:00
export default MenuContainer