2020-10-30 13:59:44 +00:00
|
|
|
import React from 'react';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { StyleSheet, View } from 'react-native';
|
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
import { withTheme } from '../../theme';
|
|
|
|
import { Header } from '.';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
marginVertical: 16
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
interface IListSection {
|
|
|
|
children: JSX.Element;
|
|
|
|
title: string;
|
|
|
|
translateTitle: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ListSection = React.memo(({ children, title, translateTitle }: IListSection) => (
|
2020-10-30 13:59:44 +00:00
|
|
|
<View style={styles.container}>
|
|
|
|
{title ? <Header {...{ title, translateTitle }} /> : null}
|
|
|
|
{children}
|
|
|
|
</View>
|
|
|
|
));
|
|
|
|
|
|
|
|
ListSection.displayName = 'List.Section';
|
|
|
|
|
|
|
|
export default withTheme(ListSection);
|