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 { Header } from '.';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
marginVertical: 16
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
interface IListSection {
|
2022-03-25 18:09:02 +00:00
|
|
|
children: (React.ReactElement | null)[] | React.ReactElement | null;
|
2022-01-17 16:10:39 +00:00
|
|
|
title?: string;
|
|
|
|
translateTitle?: boolean;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
const ListSection = ({ children, title, translateTitle }: IListSection) => (
|
2020-10-30 13:59:44 +00:00
|
|
|
<View style={styles.container}>
|
|
|
|
{title ? <Header {...{ title, translateTitle }} /> : null}
|
|
|
|
{children}
|
|
|
|
</View>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
ListSection.displayName = 'List.Section';
|
|
|
|
|
2022-03-25 18:09:02 +00:00
|
|
|
export default ListSection;
|