2020-10-30 13:59:44 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { ScrollView, StyleSheet } from 'react-native';
|
|
|
|
import { withTheme } from '../../theme';
|
|
|
|
import scrollPersistTaps from '../../utils/scrollPersistTaps';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
paddingVertical: 16
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-07-21 13:54:39 +00:00
|
|
|
type TListContainer = {
|
|
|
|
children: JSX.Element;
|
|
|
|
}
|
|
|
|
const ListContainer = React.memo(({ children, ...props }: TListContainer) => (
|
|
|
|
// @ts-ignore
|
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}
|
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</ScrollView>
|
|
|
|
));
|
|
|
|
|
|
|
|
ListContainer.displayName = 'List.Container';
|
|
|
|
|
|
|
|
export default withTheme(ListContainer);
|