tooot/src/components/Separator.tsx

33 lines
865 B
TypeScript
Raw Normal View History

2021-01-04 18:29:02 +01:00
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { StyleSheet, View } from 'react-native'
export interface Props {
extraMarginLeft?: number
extraMarginRight?: number
}
const ComponentSeparator = React.memo(
({ extraMarginLeft = 0, extraMarginRight = 0 }: Props) => {
2022-02-12 14:51:01 +01:00
const { colors } = useTheme()
2021-01-04 18:29:02 +01:00
return (
<View
style={{
2022-02-12 14:51:01 +01:00
backgroundColor: colors.backgroundDefault,
borderTopColor: colors.border,
2021-01-04 18:29:02 +01:00
borderTopWidth: StyleSheet.hairlineWidth,
marginLeft:
StyleConstants.Spacing.Global.PagePadding + extraMarginLeft,
marginRight:
StyleConstants.Spacing.Global.PagePadding + extraMarginRight
}}
/>
)
},
() => true
)
export default ComponentSeparator