verdnatura-chat/app/containers/List/ListSection.tsx

28 lines
609 B
TypeScript
Raw Normal View History

import React from 'react';
import { View, StyleSheet } from 'react-native';
import { withTheme } from '../../theme';
import { Header } from '.';
const styles = StyleSheet.create({
container: {
marginVertical: 16
}
});
2021-07-21 13:54:39 +00:00
interface IListSection {
children: JSX.Element;
title: string;
translateTitle: boolean;
}
const ListSection = React.memo(({ children, title, translateTitle }: IListSection) => (
<View style={styles.container}>
{title ? <Header {...{ title, translateTitle }} /> : null}
{children}
</View>
));
ListSection.displayName = 'List.Section';
export default withTheme(ListSection);