From b9f9a4f8d7f9a1934fa1f52c8e1ed0b95a6fef8f Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 20 Feb 2018 17:43:22 -0800 Subject: [PATCH] Move some View style propTypes to InteractionPropTypes --- .../src/exports/View/ViewStylePropTypes.js | 18 ++--------- .../src/modules/InteractionPropTypes/index.js | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 packages/react-native-web/src/modules/InteractionPropTypes/index.js diff --git a/packages/react-native-web/src/exports/View/ViewStylePropTypes.js b/packages/react-native-web/src/exports/View/ViewStylePropTypes.js index 8a05b721..308ebaae 100644 --- a/packages/react-native-web/src/exports/View/ViewStylePropTypes.js +++ b/packages/react-native-web/src/exports/View/ViewStylePropTypes.js @@ -11,6 +11,7 @@ import AnimationPropTypes from '../../modules/AnimationPropTypes'; import BorderPropTypes from '../../modules/BorderPropTypes'; import ColorPropType from '../ColorPropType'; +import InteractionPropTypes from '../../modules/InteractionPropTypes'; import LayoutPropTypes from '../../modules/LayoutPropTypes'; import ShadowPropTypes from '../../modules/ShadowPropTypes'; import TransformPropTypes from '../../modules/TransformPropTypes'; @@ -21,6 +22,7 @@ const overscrollBehaviorType = oneOf(['auto', 'contain', 'none']); const ViewStylePropTypes = { ...AnimationPropTypes, ...BorderPropTypes, + ...InteractionPropTypes, ...LayoutPropTypes, ...ShadowPropTypes, ...TransformPropTypes, @@ -43,28 +45,12 @@ const ViewStylePropTypes = { backgroundSize: string, boxShadow: string, clip: string, - cursor: string, filter: string, outline: string, outlineColor: ColorPropType, overscrollBehavior: overscrollBehaviorType, overscrollBehaviorX: overscrollBehaviorType, overscrollBehaviorY: overscrollBehaviorType, - touchAction: oneOf([ - 'auto', - 'inherit', - 'manipulation', - 'none', - 'pan-down', - 'pan-left', - 'pan-right', - 'pan-up', - 'pan-x', - 'pan-y', - 'pinch-zoom' - ]), - userSelect: string, - willChange: string, WebkitMaskImage: string, WebkitOverflowScrolling: oneOf(['auto', 'touch']) }; diff --git a/packages/react-native-web/src/modules/InteractionPropTypes/index.js b/packages/react-native-web/src/modules/InteractionPropTypes/index.js new file mode 100644 index 00000000..3b32c31d --- /dev/null +++ b/packages/react-native-web/src/modules/InteractionPropTypes/index.js @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2017-present, Nicolas Gallagher. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +import { oneOf, string } from 'prop-types'; + +const InteractionPropTypes = { + cursor: string, + touchAction: oneOf([ + 'auto', + 'inherit', + 'manipulation', + 'none', + 'pan-down', + 'pan-left', + 'pan-right', + 'pan-up', + 'pan-x', + 'pan-y', + 'pinch-zoom' + ]), + userSelect: string, + willChange: string +}; + +export default InteractionPropTypes;