Refactor minimal shell mode to refcounting (#10319)

This commit is contained in:
Samuel Newman
2026-04-21 13:04:02 -07:00
committed by GitHub
parent 6d53459e92
commit 3153ea4302
40 changed files with 152 additions and 393 deletions
-10
View File
@@ -1,6 +1,4 @@
import {useCallback} from 'react'
import {Plural, Trans} from '@lingui/react/macro'
import {useFocusEffect} from '@react-navigation/native'
import {
type CommonNavigatorParams,
@@ -8,13 +6,11 @@ import {
} from '#/lib/routes/types'
import {makeRecordUri} from '#/lib/strings/url-helpers'
import {usePostQuery} from '#/state/queries/post'
import {useSetMinimalShellMode} from '#/state/shell'
import {PostLikedBy as PostLikedByComponent} from '#/view/com/post-thread/PostLikedBy'
import * as Layout from '#/components/Layout'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'PostLikedBy'>
export const PostLikedByScreen = ({route}: Props) => {
const setMinimalShellMode = useSetMinimalShellMode()
const {name, rkey} = route.params
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
const {data: post} = usePostQuery(uri)
@@ -24,12 +20,6 @@ export const PostLikedByScreen = ({route}: Props) => {
likeCount = post.likeCount
}
useFocusEffect(
useCallback(() => {
setMinimalShellMode(false)
}, [setMinimalShellMode]),
)
return (
<Layout.Screen>
<Layout.Header.Outer>
-10
View File
@@ -1,6 +1,4 @@
import {useCallback} from 'react'
import {Plural, Trans} from '@lingui/react/macro'
import {useFocusEffect} from '@react-navigation/native'
import {
type CommonNavigatorParams,
@@ -8,13 +6,11 @@ import {
} from '#/lib/routes/types'
import {makeRecordUri} from '#/lib/strings/url-helpers'
import {usePostQuery} from '#/state/queries/post'
import {useSetMinimalShellMode} from '#/state/shell'
import {PostQuotes as PostQuotesComponent} from '#/view/com/post-thread/PostQuotes'
import * as Layout from '#/components/Layout'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'PostQuotes'>
export const PostQuotesScreen = ({route}: Props) => {
const setMinimalShellMode = useSetMinimalShellMode()
const {name, rkey} = route.params
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
const {data: post} = usePostQuery(uri)
@@ -24,12 +20,6 @@ export const PostQuotesScreen = ({route}: Props) => {
quoteCount = post.quoteCount
}
useFocusEffect(
useCallback(() => {
setMinimalShellMode(false)
}, [setMinimalShellMode]),
)
return (
<Layout.Screen>
<Layout.Header.Outer>
-10
View File
@@ -1,6 +1,4 @@
import {useCallback} from 'react'
import {Plural, Trans} from '@lingui/react/macro'
import {useFocusEffect} from '@react-navigation/native'
import {
type CommonNavigatorParams,
@@ -8,7 +6,6 @@ import {
} from '#/lib/routes/types'
import {makeRecordUri} from '#/lib/strings/url-helpers'
import {usePostQuery} from '#/state/queries/post'
import {useSetMinimalShellMode} from '#/state/shell'
import {PostRepostedBy as PostRepostedByComponent} from '#/view/com/post-thread/PostRepostedBy'
import * as Layout from '#/components/Layout'
@@ -16,7 +13,6 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'PostRepostedBy'>
export const PostRepostedByScreen = ({route}: Props) => {
const {name, rkey} = route.params
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
const setMinimalShellMode = useSetMinimalShellMode()
const {data: post} = usePostQuery(uri)
let quoteCount
@@ -24,12 +20,6 @@ export const PostRepostedByScreen = ({route}: Props) => {
quoteCount = post.repostCount
}
useFocusEffect(
useCallback(() => {
setMinimalShellMode(false)
}, [setMinimalShellMode]),
)
return (
<Layout.Screen>
<Layout.Header.Outer>