From b6c56b496db87c324af4f80c7563dd3bfa7adbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tar=C4=B1k=20=C3=87al=C4=B1=C5=9Fkan?= Date: Mon, 31 Jul 2023 21:30:17 +0300 Subject: [PATCH 1/2] fix(EmojiItem/Hook): update animation range --- src/components/EmojiItem/hooks/useEmojiItem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/EmojiItem/hooks/useEmojiItem.ts b/src/components/EmojiItem/hooks/useEmojiItem.ts index 22bb48d..9e78f39 100644 --- a/src/components/EmojiItem/hooks/useEmojiItem.ts +++ b/src/components/EmojiItem/hooks/useEmojiItem.ts @@ -47,7 +47,7 @@ const useEmojiItem = (props: EmojiItemProps) => { setTitlePosition(e.nativeEvent.layout.x - 4); }; - const reverseEnim = (scaleEmoji as any).value === 2 ? [2, 1, 0] : [0, 1, 2]; + const reverseEnim = (scaleEmoji as any).value === 2 ? [2, 1, 1] : [1, 1, 2]; useEffect(() => { scaleEmoji.value = withTiming(scaled ? 2 : 1, { From a94fff76d95a3eace4d19e235a7b886e0535986c Mon Sep 17 00:00:00 2001 From: reema-simform Date: Mon, 13 May 2024 15:29:22 +0530 Subject: [PATCH 2/2] feat: update reanimated and gesture versions --- babel.config.js | 3 + example/ios/Podfile | 5 ++ example/package.json | 7 +- example/src/component/Card/Card.tsx | 4 +- example/src/component/Card/styles.ts | 3 + package.json | 15 ++-- .../__snapshots__/ReactionView.test.tsx.snap | 80 ++++++++----------- 7 files changed, 60 insertions(+), 57 deletions(-) diff --git a/babel.config.js b/babel.config.js index f842b77..f494dfa 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,6 @@ module.exports = { presets: ['module:metro-react-native-babel-preset'], + plugins: [ + 'react-native-reanimated/plugin', + ], }; diff --git a/example/ios/Podfile b/example/ios/Podfile index 541aaa0..9fec60a 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -31,5 +31,10 @@ target 'reactions_example' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4' + end + end end end diff --git a/example/package.json b/example/package.json index 10c9cfa..ed4734e 100644 --- a/example/package.json +++ b/example/package.json @@ -13,8 +13,8 @@ "lodash": "^4.17.21", "react": "18.0.0", "react-native": "0.69.5", - "react-native-gesture-handler": "^2.6.0", - "react-native-reanimated": "^2.10.0" + "react-native-gesture-handler": "2.16.2", + "react-native-reanimated": "3.8.1" }, "devDependencies": { "@babel/core": "^7.12.9", @@ -36,7 +36,8 @@ "typescript": "^4.6.4" }, "resolutions": { - "@types/react": "*" + "@types/react": "*", + "react-native-reanimated": "3.8.1" }, "jest": { "preset": "react-native", diff --git a/example/src/component/Card/Card.tsx b/example/src/component/Card/Card.tsx index 7d9c91a..4f6b9b0 100644 --- a/example/src/component/Card/Card.tsx +++ b/example/src/component/Card/Card.tsx @@ -19,9 +19,9 @@ const Footer = ({ itemIndex={index} onTap={setSelectedEmoji} onShowDismissCard={onShowDismissCard}> - {selectedEmoji ? selectedEmoji?.emoji : Strings?.like} + {selectedEmoji ? selectedEmoji?.emoji : Strings?.like} - {Strings?.share} + {Strings?.share} ); diff --git a/example/src/component/Card/styles.ts b/example/src/component/Card/styles.ts index 5e3744e..bdc2e26 100644 --- a/example/src/component/Card/styles.ts +++ b/example/src/component/Card/styles.ts @@ -31,5 +31,8 @@ export const styles = StyleSheet.create({ width: scale(18), height: verticalScale(18), resizeMode: "contain" + }, + text: { + color: Colors.black } }) diff --git a/package.json b/package.json index 1fb6d87..7728e64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-reactions", - "version": "0.0.4", + "version": "1.0.0", "description": "A React Native component to provide animated reaction picker", "main": "lib/index", "types": "lib/index.d.ts", @@ -54,8 +54,8 @@ "peerDependencies": { "react": "*", "react-native": "*", - "react-native-gesture-handler": "^2.6.0", - "react-native-reanimated": "^2.10.0" + "react-native-gesture-handler": "2.16.2", + "react-native-reanimated": "3.8.1" }, "devDependencies": { "@commitlint/cli": "^16.1.0", @@ -65,8 +65,8 @@ "@types/jest": "^27.4.0", "babel-jest": "^27.4.6", "eslint-plugin-simple-import-sort": "^7.0.0", - "react-native-gesture-handler": "^2.6.0", - "react-native-reanimated": "^2.10.0", + "react-native-gesture-handler": "2.16.2", + "react-native-reanimated": "3.8.1", "husky": "^7.0.4", "jest": "^27.4.7", "lint-staged": "^11.1.2", @@ -86,7 +86,8 @@ "react-test-renderer": "18.0.0" }, "resolutions": { - "@types/react": "*" + "@types/react": "*", + "react-native-reanimated": "3.8.1" }, "jest": { "preset": "react-native", @@ -123,4 +124,4 @@ "@commitlint/config-conventional" ] } -} \ No newline at end of file +} diff --git a/src/components/ReactionView/__tests__/__snapshots__/ReactionView.test.tsx.snap b/src/components/ReactionView/__tests__/__snapshots__/ReactionView.test.tsx.snap index b8d377c..280c1a5 100644 --- a/src/components/ReactionView/__tests__/__snapshots__/ReactionView.test.tsx.snap +++ b/src/components/ReactionView/__tests__/__snapshots__/ReactionView.test.tsx.snap @@ -13,61 +13,51 @@ exports[`ReactionView component Match Snapshot 1`] = ` } > - - - Emoji Text - + } + accessible={true} + collapsable={false} + focusable={true} + hitSlop={ + Object { + "bottom": 20, + "left": 20, + "right": 20, + "top": 20, + } + } + onBlur={[Function]} + onClick={[Function]} + onFocus={[Function]} + onResponderGrant={[Function]} + onResponderMove={[Function]} + onResponderRelease={[Function]} + onResponderTerminate={[Function]} + onResponderTerminationRequest={[Function]} + onStartShouldSetResponder={[Function]} + > + + Emoji Text