2019-06-11 14:01:40 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View, StyleSheet } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
import { withTheme } from '../../theme';
|
2019-06-11 14:01:40 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
separator: {
|
2019-12-04 16:39:53 +00:00
|
|
|
height: StyleSheet.hairlineWidth
|
2019-06-11 14:01:40 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
const ListSeparator = React.memo(({ style, theme }) => (
|
2019-12-04 16:39:53 +00:00
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.separator,
|
|
|
|
style,
|
|
|
|
{ backgroundColor: themes[theme].separatorColor }
|
|
|
|
]}
|
|
|
|
/>
|
|
|
|
));
|
2019-06-11 14:01:40 +00:00
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
ListSeparator.propTypes = {
|
2019-12-04 16:39:53 +00:00
|
|
|
style: PropTypes.object,
|
|
|
|
theme: PropTypes.string
|
2019-06-11 14:01:40 +00:00
|
|
|
};
|
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
ListSeparator.displayName = 'List.Separator';
|
|
|
|
|
|
|
|
export default withTheme(ListSeparator);
|