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
|
|
|
|
2020-10-30 13:59:44 +00:00
|
|
|
import { withTheme } from '../../theme';
|
|
|
|
import scrollPersistTaps from '../../utils/scrollPersistTaps';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
paddingVertical: 16
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
interface IListContainer {
|
2022-01-17 16:10:39 +00:00
|
|
|
children: React.ReactNode;
|
|
|
|
testID?: string;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
const ListContainer = React.memo(({ 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}
|
2021-09-13 20:41:05 +00:00
|
|
|
{...props}>
|
2020-10-30 13:59:44 +00:00
|
|
|
{children}
|
|
|
|
</ScrollView>
|
|
|
|
));
|
|
|
|
|
|
|
|
ListContainer.displayName = 'List.Container';
|
|
|
|
|
|
|
|
export default withTheme(ListContainer);
|