2021-10-01 18:12:19 +00:00
|
|
|
import React from 'react';
|
2022-01-24 20:12:25 +00:00
|
|
|
import { StyleSheet, View, ViewStyle } from 'react-native';
|
2021-10-01 18:12:19 +00:00
|
|
|
|
2022-04-28 18:44:40 +00:00
|
|
|
import { themes } from '../../lib/constants';
|
2022-03-29 18:53:27 +00:00
|
|
|
import { useTheme } from '../../theme';
|
2021-10-01 18:12:19 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
separator: {
|
|
|
|
height: StyleSheet.hairlineWidth
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
interface IListSeparator {
|
2022-01-24 20:12:25 +00:00
|
|
|
style?: ViewStyle;
|
2021-10-01 18:12:19 +00:00
|
|
|
}
|
|
|
|
|
2022-03-29 18:53:27 +00:00
|
|
|
const ListSeparator = React.memo(({ style }: IListSeparator) => {
|
|
|
|
const { theme } = useTheme();
|
|
|
|
|
|
|
|
return <View style={[styles.separator, style, { backgroundColor: themes[theme].separatorColor }]} />;
|
|
|
|
});
|
2021-10-01 18:12:19 +00:00
|
|
|
|
|
|
|
ListSeparator.displayName = 'List.Separator';
|
|
|
|
|
2022-03-29 18:53:27 +00:00
|
|
|
export default ListSeparator;
|