1import React from 'react'; 2import {StyleProp, StyleSheet, View, ViewProps} from 'react-native'; 3import useColors from '@/hooks/useColors'; 4 5interface IDividerProps { 6 vertical?: boolean; 7 style?: StyleProp<ViewProps>; 8} 9export default function Divider(props: IDividerProps) { 10 const {vertical, style} = props; 11 const colors = useColors(); 12 13 return ( 14 <View 15 style={[ 16 vertical ? css.dividerVertical : css.divider, 17 { 18 backgroundColor: colors.divider ?? '#999999', 19 }, 20 style, 21 ]} 22 /> 23 ); 24} 25 26const css = StyleSheet.create({ 27 divider: { 28 width: '100%', 29 height: 1, 30 }, 31 dividerVertical: { 32 height: '100%', 33 width: 1, 34 }, 35}); 36