Files
frontend/src/components/common/Divider.tsx

40 lines
664 B
TypeScript
Raw Normal View History

/**
* Divider 线
*
*/
import React from 'react';
import { View, StyleSheet, ViewStyle } from 'react-native';
import { colors, spacing } from '../../theme';
interface DividerProps {
margin?: number;
color?: string;
style?: ViewStyle;
}
const Divider: React.FC<DividerProps> = ({
margin = spacing.lg,
color = colors.divider,
style,
}) => {
return (
<View
style={[
styles.divider,
{ marginVertical: margin, backgroundColor: color },
style,
]}
/>
);
};
const styles = StyleSheet.create({
divider: {
height: 1,
width: '100%',
},
});
export default Divider;