2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
2022-01-17 16:10:39 +00:00
|
|
|
import { StyleSheet, View, ViewStyle } from 'react-native';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
import { themes } from '../../constants/colors';
|
2022-03-25 18:09:02 +00:00
|
|
|
import { useTheme } from '../../theme';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
separator: {
|
|
|
|
height: StyleSheet.hairlineWidth
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
interface IListSeparator {
|
2022-01-17 16:10:39 +00:00
|
|
|
style?: ViewStyle;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
2022-03-25 18:09:02 +00:00
|
|
|
const ListSeparator = React.memo(({ style }: IListSeparator) => {
|
|
|
|
const { theme } = useTheme();
|
|
|
|
|
|
|
|
return <View style={[styles.separator, style, { backgroundColor: themes[theme].separatorColor }]} />;
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
ListSeparator.displayName = 'List.Separator';
|
|
|
|
|
2022-03-25 18:09:02 +00:00
|
|
|
export default ListSeparator;
|