diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-15 18:17:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 18:17:03 -0800 |
commit | e749f2f3a52f5c1e137ce8262701b9c9df96324f (patch) | |
tree | 0ca385ae3306a0a2b1cc5ec1b0de953c183b07f6 /src/view/com/profile/ProfileSubpageHeader.tsx | |
parent | 03b20c70e48f07d6011f632a2aeac954b9de2d96 (diff) | |
download | voidsky-e749f2f3a52f5c1e137ce8262701b9c9df96324f.tar.zst |
Factor lightbox out into hook/context (#1919)
Diffstat (limited to 'src/view/com/profile/ProfileSubpageHeader.tsx')
-rw-r--r-- | src/view/com/profile/ProfileSubpageHeader.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/view/com/profile/ProfileSubpageHeader.tsx b/src/view/com/profile/ProfileSubpageHeader.tsx index e1b587beb..ef128e877 100644 --- a/src/view/com/profile/ProfileSubpageHeader.tsx +++ b/src/view/com/profile/ProfileSubpageHeader.tsx @@ -16,7 +16,7 @@ import {useStores} from 'state/index' import {NavigationProp} from 'lib/routes/types' import {BACK_HITSLOP} from 'lib/constants' import {isNative} from 'platform/detection' -import {ImagesLightbox} from 'state/models/ui/shell' +import {useLightboxControls, ImagesLightbox} from '#/state/lightbox' import {useLingui} from '@lingui/react' import {msg} from '@lingui/macro' import {useSetDrawerOpen} from '#/state/shell' @@ -50,6 +50,7 @@ export const ProfileSubpageHeader = observer(function HeaderImpl({ const navigation = useNavigation<NavigationProp>() const {_} = useLingui() const {isMobile} = useWebMediaQueries() + const {openLightbox} = useLightboxControls() const pal = usePalette('default') const canGoBack = navigation.canGoBack() @@ -69,9 +70,9 @@ export const ProfileSubpageHeader = observer(function HeaderImpl({ if ( avatar // TODO && !(view.moderation.avatar.blur && view.moderation.avatar.noOverride) ) { - store.shell.openLightbox(new ImagesLightbox([{uri: avatar}], 0)) + openLightbox(new ImagesLightbox([{uri: avatar}], 0)) } - }, [store, avatar]) + }, [openLightbox, avatar]) return ( <CenteredView style={pal.view}> |