Skip to content

Commit

Permalink
Fix rough edges on iOS Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
duogenesis committed Oct 21, 2023
1 parent f789db4 commit 8e7642c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
7 changes: 4 additions & 3 deletions components/image-carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ImageCarousel = ({
}

{uuids !== undefined && uuids.length >= 2 &&
<Pressable onPressIn={goToPrevSlide} style={styles.leftPressable}>
<Pressable onPress={goToPrevSlide} style={styles.leftPressable}>
{!isMobile() &&
<View style={styles.leftButton}>
<ChevronLeft
Expand All @@ -87,13 +87,13 @@ const ImageCarousel = ({

{uuids !== undefined && uuids.length >= 1 &&
<Pressable
onPressIn={() => onChangeEmbiggened(uuids[activeIndex])}
onPress={() => onChangeEmbiggened(uuids[activeIndex])}
style={styles.middleButton}
/>
}

{uuids !== undefined && uuids.length >= 2 &&
<Pressable onPressIn={goToNextSlide} style={styles.rightPressable}>
<Pressable onPress={goToNextSlide} style={styles.rightPressable}>
{!isMobile() &&
<View style={styles.rightButton}>
<ChevronRight
Expand All @@ -112,6 +112,7 @@ const ImageCarousel = ({

const styles = StyleSheet.create({
container: {
userSelect: 'none',
width: '100%',
aspectRatio: 1,
},
Expand Down
6 changes: 3 additions & 3 deletions components/pinchy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ const Pinchy = ({uuid}: {uuid: string}) => {

const panResponder = useRef(
PanResponder.create({
onStartShouldSetPanResponder: () => true,
onMoveShouldSetPanResponder: () => true,
onStartShouldSetPanResponderCapture: (e) => (e.preventDefault(), true),
onPanResponderGrant: handleSingleTap,
onPanResponderMove: onPinchMove,
onPanResponderRelease: onPinchEnd,
Expand All @@ -253,7 +252,7 @@ const Pinchy = ({uuid}: {uuid: string}) => {
}, [viewportWidth, viewportHeight]);

return (
<View style={styles.container}>
<View style={styles.container} pointerEvents="box-none">
<FitWithinScreenImage
{...panResponder.panHandlers}
source={{ uri: `${IMAGES_URL}/original-${uuid}.jpg` }}
Expand All @@ -276,6 +275,7 @@ const Pinchy = ({uuid}: {uuid: string}) => {
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
touchAction: 'none',
flex: 1,
justifyContent: 'center',
alignItems: 'center',
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"expo-clipboard": "~4.3.1",
"expo-image-picker": "^14.3.2",
"expo-linear-gradient": "^12.3.0",
"expo-screen-orientation": "^6.0.5",
"expo-screen-orientation": "~6.0.6",
"expo-secure-store": "^12.3.1",
"expo-splash-screen": "^0.20.5",
"expo-status-bar": "^1.6.0",
"lodash": "^4.17.21",
"patch-package": "^6.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "0.72.5",
"react-native": "0.72.6",
"react-native-dropdown-picker": "^5.4.4",
"react-native-feather": "^1.1.2",
"react-native-svg": "^13.9.0",
Expand Down

0 comments on commit 8e7642c

Please sign in to comment.