tooot/src/components/Separator.tsx

36 lines
906 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'
2022-12-03 21:14:00 +01:00
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
2021-01-04 18:29:02 +01:00
export interface Props {
extraMarginLeft?: number
extraMarginRight?: number
2022-12-03 21:14:00 +01:00
style?: StyleProp<ViewStyle>
2021-01-04 18:29:02 +01:00
}
2022-12-03 21:14:00 +01:00
const ComponentSeparator: React.FC<Props> = ({
extraMarginLeft = 0,
extraMarginRight = 0,
style
}) => {
const { colors } = useTheme()
2021-01-04 18:29:02 +01:00
2022-12-03 21:14:00 +01:00
return (
<View
style={[
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,
2022-12-03 21:14:00 +01:00
marginLeft: StyleConstants.Spacing.Global.PagePadding + extraMarginLeft,
marginRight: StyleConstants.Spacing.Global.PagePadding + extraMarginRight
}
]}
/>
)
}
2021-01-04 18:29:02 +01:00
export default ComponentSeparator