2020-10-30 13:59:44 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { ScrollView, StyleSheet } from 'react-native';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
2022-06-06 14:17:51 +00:00
|
|
|
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
paddingVertical: 16
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
interface IListContainer {
|
2022-03-25 18:09:02 +00:00
|
|
|
children: (React.ReactElement | null)[] | React.ReactElement | null;
|
2022-01-17 16:10:39 +00:00
|
|
|
testID?: string;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
2022-08-19 19:53:40 +00:00
|
|
|
const ListContainer = ({ children, ...props }: IListContainer) => (
|
2020-10-30 13:59:44 +00:00
|
|
|
<ScrollView
|
|
|
|
contentContainerStyle={styles.container}
|
|
|
|
scrollIndicatorInsets={{ right: 1 }} // https://github.com/facebook/react-native/issues/26610#issuecomment-539843444
|
|
|
|
{...scrollPersistTaps}
|
2022-08-08 21:02:08 +00:00
|
|
|
{...props}
|
|
|
|
>
|
2020-10-30 13:59:44 +00:00
|
|
|
{children}
|
|
|
|
</ScrollView>
|
2022-08-19 19:53:40 +00:00
|
|
|
);
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
ListContainer.displayName = 'List.Container';
|
|
|
|
|
2022-08-19 19:53:40 +00:00
|
|
|
export default ListContainer;
|