import React from 'react'; import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'; import { withTheme } from '../../core/theming'; import type { $RemoveChildren, Orientation, DimensionValue, Theme, } from '../../types'; import { Border } from '../../styles/styleElements'; type Props = $RemoveChildren & { orientation?: Orientation; size?: DimensionValue; style?: StyleProp; theme: Theme; // come up with a better name than 'raised' variant?: 'default' | 'raised'; }; const Divider = ({ orientation = 'horizontal', size = '100%', style = {}, theme, variant = 'default', ...rest }: Props) => { const isHorizontal = orientation === 'horizontal'; const isRaised = variant === 'raised'; const thickness = isRaised ? 5 : 4; //@ts-ignore const dynamicStyles: StyleProp = { width: isHorizontal ? size : thickness, height: isHorizontal ? thickness : size, backgroundColor: theme.material, }; return ( ); }; const styles = StyleSheet.create({ divider: { position: 'relative', }, }); export default withTheme(Divider);