Unify lightbox types
This commit is contained in:
+1
-11
@@ -1,16 +1,9 @@
|
||||
import React from 'react'
|
||||
import type {MeasuredDimensions} from 'react-native-reanimated'
|
||||
import {AppBskyActorDefs} from '@atproto/api'
|
||||
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {Dimensions} from '#/lib/media/types'
|
||||
|
||||
type ProfileImageLightbox = {
|
||||
type: 'profile-image'
|
||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||
thumbDims: null
|
||||
}
|
||||
|
||||
type ImagesLightboxItem = {
|
||||
uri: string
|
||||
thumbUri: string
|
||||
@@ -18,15 +11,12 @@ type ImagesLightboxItem = {
|
||||
dimensions: Dimensions | null
|
||||
}
|
||||
|
||||
type ImagesLightbox = {
|
||||
type: 'images'
|
||||
type Lightbox = {
|
||||
images: ImagesLightboxItem[]
|
||||
thumbDims: MeasuredDimensions | null
|
||||
index: number
|
||||
}
|
||||
|
||||
type Lightbox = ProfileImageLightbox | ImagesLightbox
|
||||
|
||||
const LightboxContext = React.createContext<{
|
||||
activeLightbox: Lightbox | null
|
||||
}>({
|
||||
|
||||
Reference in New Issue
Block a user