refactor(lightbox): move pager files to features/lightbox/pager
This commit is contained in:
@@ -2,7 +2,6 @@ import {InteractionManager, View} from 'react-native'
|
||||
import {type AnimatedRef} from 'react-native-reanimated'
|
||||
import {Image} from 'expo-image'
|
||||
|
||||
import {type Dimensions} from '#/view/com/lightbox/ImageViewing/@types'
|
||||
import {atoms as a, tokens} from '#/alf'
|
||||
import {AutoSizedImage} from '#/components/images/AutoSizedImage'
|
||||
import {Gallery} from '#/components/images/Gallery'
|
||||
@@ -10,6 +9,7 @@ import {ImageLayoutGrid} from '#/components/images/ImageLayoutGrid'
|
||||
import {PostEmbedViewContext} from '#/components/Post/Embed/types'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {useLightboxControls} from '#/features/lightbox/state'
|
||||
import {type Dimensions} from '#/features/lightbox/types'
|
||||
import {type EmbedType} from '#/types/bsky/post'
|
||||
import {type CommonProps} from './types'
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ import {type StyleProp, View, type ViewStyle} from 'react-native'
|
||||
import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
|
||||
import {type AppBskyEmbedImages} from '@atproto/api'
|
||||
|
||||
import {type Dimensions} from '#/view/com/lightbox/ImageViewing/@types'
|
||||
import {atoms as a, useBreakpoints} from '#/alf'
|
||||
import {PostEmbedViewContext} from '#/components/Post/Embed/types'
|
||||
import {type Dimensions} from '#/features/lightbox/types'
|
||||
import {GalleryItem} from './ImageLayoutGridItem'
|
||||
|
||||
interface ImageLayoutGridProps {
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import {
|
||||
type Dimensions as ImageDimensions,
|
||||
type ImageSource,
|
||||
type LightboxTransforms,
|
||||
} from '../../@types'
|
||||
} from '../../types'
|
||||
import {
|
||||
applyRounding,
|
||||
createTransform,
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
prependTransform,
|
||||
readTransform,
|
||||
type TransformMatrix,
|
||||
} from '../../transforms'
|
||||
} from '../transforms'
|
||||
|
||||
const MIN_SCREEN_ZOOM = 2
|
||||
const MAX_ORIGINAL_IMAGE_ZOOM = 2
|
||||
+1
-1
@@ -30,7 +30,7 @@ import {
|
||||
type Dimensions as ImageDimensions,
|
||||
type ImageSource,
|
||||
type LightboxTransforms,
|
||||
} from '../../@types'
|
||||
} from '../../types'
|
||||
|
||||
const MAX_ORIGINAL_IMAGE_ZOOM = 2
|
||||
const MIN_SCREEN_ZOOM = 2
|
||||
+1
-1
@@ -10,7 +10,7 @@ import {
|
||||
type Dimensions as ImageDimensions,
|
||||
type ImageSource,
|
||||
type LightboxTransforms,
|
||||
} from '../../@types'
|
||||
} from '../../types'
|
||||
|
||||
type Props = {
|
||||
imageSrc: ImageSource
|
||||
+4
-4
@@ -51,14 +51,14 @@ import {useTheme} from '#/alf'
|
||||
import {setSystemUITheme} from '#/alf/util/systemUI'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {type Lightbox} from '#/features/lightbox/state'
|
||||
import {PlatformInfo} from '../../../../../modules/expo-bluesky-swiss-army'
|
||||
import {PlatformInfo} from '../../../../modules/expo-bluesky-swiss-army'
|
||||
import ImageDefaultHeader from '../../../view/com/lightbox/ImageViewing/components/ImageDefaultHeader'
|
||||
import {
|
||||
type ImageSource,
|
||||
type LightboxTransforms,
|
||||
type Transform,
|
||||
} from './@types'
|
||||
import ImageDefaultHeader from './components/ImageDefaultHeader'
|
||||
import ImageItem from './components/ImageItem/ImageItem'
|
||||
} from '../types'
|
||||
import ImageItem from './ImageItem/ImageItem'
|
||||
|
||||
type Rect = {x: number; y: number; width: number; height: number}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import {type Position} from './@types'
|
||||
import {type Position} from '../types'
|
||||
|
||||
export type TransformMatrix = [
|
||||
number,
|
||||
@@ -9,7 +9,7 @@ import {nanoid} from 'nanoid/non-secure'
|
||||
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {useHotkeysContext} from '#/lib/hotkeys'
|
||||
import {type ImageSource} from '#/view/com/lightbox/ImageViewing/@types'
|
||||
import {type ImageSource} from '#/features/lightbox/types'
|
||||
|
||||
export type Lightbox = {
|
||||
id: string
|
||||
|
||||
@@ -2,8 +2,8 @@ import {useCallback} from 'react'
|
||||
|
||||
import {shareImageModal} from '#/lib/media/manip'
|
||||
import {useSaveImageToMediaLibrary} from '#/lib/media/save-image'
|
||||
import ImageView from '#/features/lightbox/pager/ImagePager'
|
||||
import {useLightbox, useLightboxControls} from '#/features/lightbox/state'
|
||||
import ImageView from './ImageViewing'
|
||||
|
||||
export function Lightbox() {
|
||||
const {activeLightbox} = useLightbox()
|
||||
|
||||
@@ -30,7 +30,7 @@ import * as Menu from '#/components/Menu'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useLightbox, useLightboxControls} from '#/features/lightbox/state'
|
||||
import {type ImageSource} from './ImageViewing/@types'
|
||||
import {type ImageSource} from '#/features/lightbox/types'
|
||||
|
||||
export function Lightbox() {
|
||||
const {activeLightbox} = useLightbox()
|
||||
|
||||
Reference in New Issue
Block a user