Skip to content

Commit

Permalink
fix: ensure back compatibility with web
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak committed Jan 8, 2024
1 parent 6b829b2 commit 243350b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ const Button = ({
Animated.timing(elevation, {
toValue: 8,
duration: 200 * scale,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
useNativeDriver:
Platform.OS === 'web' ||
Platform.constants.reactNativeVersion.minor <= 72,
}).start();
}
};
Expand All @@ -172,7 +174,9 @@ const Button = ({
Animated.timing(elevation, {
toValue: 2,
duration: 150 * scale,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
useNativeDriver:
Platform.OS === 'web' ||
Platform.constants.reactNativeVersion.minor <= 72,
}).start();
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ const Card = ({
Animated.timing(elevation, {
toValue: isPressTypeIn ? 8 : cardElevation,
duration: animationDuration,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
useNativeDriver:
Platform.OS === 'web' ||
Platform.constants.reactNativeVersion.minor <= 72,
}).start();
}
};
Expand Down
8 changes: 6 additions & 2 deletions src/components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const Chip = ({
Animated.timing(elevation, {
toValue: 4,
duration: 200 * scale,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
useNativeDriver:
Platform.OS === 'web' ||
Platform.constants.reactNativeVersion.minor <= 72,
}).start();
};

Expand All @@ -161,7 +163,9 @@ const Chip = ({
Animated.timing(elevation, {
toValue: 0,
duration: 150 * scale,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
useNativeDriver:
Platform.OS === 'web' ||
Platform.constants.reactNativeVersion.minor <= 72,
}).start();
};

Expand Down

0 comments on commit 243350b

Please sign in to comment.