@eslam-elmeniawy/react-native-common-components
Version:
Common `ReactNative` components packed in library for usage in projects.
44 lines (41 loc) • 1.52 kB
JavaScript
;
// External imports.
import * as React from 'react';
import { RefreshControl } from 'react-native';
import { withTheme } from 'react-native-paper';
import { KeyboardAwareScrollView } from 'react-native-keyboard-controller';
// Types imports.
// Internal imports.
import ResponsiveDimensions from "../../utils/ResponsiveDimensions.js";
import { jsx as _jsx } from "react/jsx-runtime";
const ScrollView = /*#__PURE__*/React.memo(props => {
const {
refreshing,
onRefresh,
refreshColor,
showsHorizontalScrollIndicator,
showsVerticalScrollIndicator,
keyboardShouldPersistTaps,
keyboardDismissMode,
refreshControl,
extraKeyboardSpace,
theme,
...other
} = props;
return /*#__PURE__*/_jsx(KeyboardAwareScrollView, {
showsHorizontalScrollIndicator: showsHorizontalScrollIndicator ?? false,
showsVerticalScrollIndicator: showsVerticalScrollIndicator ?? false,
keyboardShouldPersistTaps: keyboardShouldPersistTaps ?? 'handled',
keyboardDismissMode: keyboardDismissMode ?? 'none',
refreshControl: refreshControl ?? onRefresh ? /*#__PURE__*/_jsx(RefreshControl, {
colors: refreshColor ? [refreshColor] : [theme.colors.primary],
tintColor: refreshColor ?? theme.colors.primary,
refreshing: refreshing ?? false,
onRefresh: onRefresh
}) : undefined,
extraKeyboardSpace: extraKeyboardSpace ?? ResponsiveDimensions.vs(8),
...other
});
});
export default withTheme(ScrollView);
//# sourceMappingURL=ScrollView.js.map