Skip to content

Commit

Permalink
removed zoom, but swipe to dismiss also bugged
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan-cp committed May 22, 2024
1 parent 768f2f7 commit dc47ac4
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions apps/mobile/src/screens/NftDetailScreen/NftDetailSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useCallback, useMemo, useRef, useState } from 'react';
import { Dimensions, ScrollView, View } from 'react-native';
import FastImage from 'react-native-fast-image';
import Lightbox from 'react-native-lightbox-v2';
import Zoom from 'react-native-zoom-reanimated';
import { graphql, useFragment } from 'react-relay';
import { useNavigateToCommunityScreen } from 'src/hooks/useNavigateToCommunityScreen';
import { useToggleTokenAdmire } from 'src/hooks/useToggleTokenAdmire';
Expand Down Expand Up @@ -228,7 +227,6 @@ export function NftDetailSection({ onShare, queryRef }: Props) {
}, []);

const handleOpenLightbox = useCallback(() => {
updateThumbnailPosition();
setIsLightboxOpen(true);
}, [updateThumbnailPosition]);

Expand All @@ -239,16 +237,7 @@ export function NftDetailSection({ onShare, queryRef }: Props) {
const contentStyle = useMemo(
() => ({
width: width * 0.92,
}),
[]
);

const zoomContentContainerStyle = useMemo(
() => ({
display: 'flex' as const,
width: width,
flexGrow: 1,
backgroundColor: colors.black['800'],
backgroundColor: 'red',
}),
[]
);
Expand All @@ -257,19 +246,11 @@ export function NftDetailSection({ onShare, queryRef }: Props) {
() => (
<TokenFailureBoundary tokenRef={token} variant="large">
<NftDetailAssetCacheSwapper cachedPreviewAssetUrl={route.params.cachedPreviewAssetUrl}>
<Zoom
contentContainerStyle={zoomContentContainerStyle}
style={{ display: 'flex', flexGrow: 1 }}
doubleTapConfig={{
minZoomScale: 1,
}}
>
<NftDetailAsset tokenRef={token} />
</Zoom>
<NftDetailAsset tokenRef={token} />
</NftDetailAssetCacheSwapper>
</TokenFailureBoundary>
),
[token, route.params.cachedPreviewAssetUrl, zoomContentContainerStyle]
[token, route.params.cachedPreviewAssetUrl]
);

const tokenOrigin = useMemo(
Expand Down Expand Up @@ -308,14 +289,15 @@ export function NftDetailSection({ onShare, queryRef }: Props) {
onClose: handleCloseLightbox,
onOpen: handleOpenLightbox,
backgroundColor: colors.black['800'],
swipeToDismiss: false,
swipeToDismiss: true,
renderHeader: customHeader,
onLayout: updateThumbnailPosition,
doubleTapZoomEnabled: false,
renderContent: renderContent,
origin: tokenOrigin,
}}
>
<View ref={thumbnailRef} style={contentStyle} onLayout={updateThumbnailPosition}>
<View ref={thumbnailRef}>
<TokenFailureBoundary tokenRef={token} variant="large">
<NftDetailAssetCacheSwapper
cachedPreviewAssetUrl={route.params.cachedPreviewAssetUrl}
Expand All @@ -341,6 +323,7 @@ export function NftDetailSection({ onShare, queryRef }: Props) {
</Typography>
</View>
<GalleryTouchableOpacity
className="p-1"
onPress={handleMaximizeToggle}
eventElementId="NFT Detail Maximize Icon"
eventName="NFT Detail Maximize Icon Pressed"
Expand Down

0 comments on commit dc47ac4

Please sign in to comment.