Skip to content

Commit bac06bd

Browse files
authored
Switch sonner-native patch to target ESM source (bluesky-social#10668)
1 parent 3205fcd commit bac06bd

2 files changed

Lines changed: 32 additions & 15 deletions

File tree

patches/sonner-native@0.21.0.patch

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1-
diff --git a/lib/commonjs/toast.js b/lib/commonjs/toast.js
2-
index 121816a452339c1088aeba87928ff63a0bdacca5..47e74bce47323201f0bb4e5ed9dc55b373c07b97 100644
3-
--- a/lib/commonjs/toast.js
4-
+++ b/lib/commonjs/toast.js
5-
@@ -264,7 +264,7 @@ const Toast = exports.Toast = /*#__PURE__*/React.forwardRef(({
1+
diff --git a/lib/module/toast.js b/lib/module/toast.js
2+
index be089f3ff23017a6844e2010cedc547729e198aa..c2dd0fa2df93f929c33bf2bcc3e6f921941fa006 100644
3+
--- a/lib/module/toast.js
4+
+++ b/lib/module/toast.js
5+
@@ -1,8 +1,8 @@
6+
"use strict";
7+
8+
import * as React from 'react';
9+
-import { ActivityIndicator, Pressable, Text, View } from 'react-native';
10+
-import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
11+
+import { ActivityIndicator, Pressable, Text, View, Platform } from 'react-native';
12+
+import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming, FadeOut } from 'react-native-reanimated';
13+
import { ANIMATION_DURATION, useToastLayoutAnimations } from "./animations.js";
14+
import { toastDefaultValues } from "./constants.js";
15+
import { useToastContext } from "./context.js";
16+
@@ -258,7 +258,10 @@ export const Toast = /*#__PURE__*/React.forwardRef(({
617
...toastSwipeHandlerProps,
7-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
18+
children: /*#__PURE__*/_jsx(Animated.View, {
819
entering: entering,
920
- exiting: exiting,
10-
+ exiting: _reactNative.Platform.OS === 'android' ? undefined : exiting,
21+
+ exiting: Platform.select({
22+
+ android: undefined,
23+
+ default: exiting
24+
+ }),
1125
children: jsx
1226
})
1327
});
14-
@@ -274,7 +274,7 @@ const Toast = exports.Toast = /*#__PURE__*/React.forwardRef(({
15-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
28+
@@ -268,7 +271,10 @@ export const Toast = /*#__PURE__*/React.forwardRef(({
29+
children: /*#__PURE__*/_jsx(Animated.View, {
1630
style: [unstyled ? undefined : elevationStyle, defaultStyles.toast, toastStyleCtx, styles?.toast, style, wiggleAnimationStyle],
1731
entering: entering,
1832
- exiting: exiting,
19-
+ exiting: _reactNative.Platform.OS === 'android' ? undefined : exiting,
20-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
33+
+ exiting: Platform.select({
34+
+ android: undefined,
35+
+ default: exiting
36+
+ }),
37+
children: /*#__PURE__*/_jsxs(View, {
2138
style: [defaultStyles.toastContent, toastContentStyleCtx, styles?.toastContent],
22-
children: [promiseOptions || variant === 'loading' ? 'loading' in icons ? icons.loading : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {}) : icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
39+
children: [promiseOptions || variant === 'loading' ? 'loading' in icons ? icons.loading : /*#__PURE__*/_jsx(ActivityIndicator, {}) : icon ? /*#__PURE__*/_jsx(View, {

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)