diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-03-02 13:04:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-02 13:04:51 +0900 |
commit | ab2b454be8f15ccd4176edce2d28abdce501274b (patch) | |
tree | 41e198f85a4372950ce39a6613d231b2d5932be1 /src/Navigation.tsx | |
parent | 537ae578d6501319e07132ea8b12c280e0755fca (diff) | |
parent | b70c404d4b369d6fab0dfbafd6b31390ffd20014 (diff) | |
download | voidsky-ab2b454be8f15ccd4176edce2d28abdce501274b.tar.zst |
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/Navigation.tsx')
-rw-r--r-- | src/Navigation.tsx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 0aeeeb6ad..b30f8f982 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -77,6 +77,7 @@ import {PreferencesExternalEmbeds} from '#/view/screens/PreferencesExternalEmbed import {createNativeStackNavigatorWithAuth} from './view/shell/createNativeStackNavigatorWithAuth' import {msg} from '@lingui/macro' import {i18n, MessageDescriptor} from '@lingui/core' +import HashtagScreen from '#/screens/Hashtag' const navigationRef = createNavigationContainerRef<AllNavigatorParams>() @@ -262,6 +263,11 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) { requireAuth: true, }} /> + <Stack.Screen + name="Hashtag" + getComponent={() => HashtagScreen} + options={{title: title(msg`Hashtag`)}} + /> </> ) } @@ -479,12 +485,19 @@ const LINKING = { }, getStateFromPath(path: string) { + const [name, params] = router.matchPath(path) + // Any time we receive a url that starts with `intent/` we want to ignore it here. It will be handled in the // intent handler hook. We should check for the trailing slash, because if there isn't one then it isn't a valid // intent - if (path.includes('intent/')) return + // On web, there is no route state that's created by default, so we should initialize it as the home route. On + // native, since the home tab and the home screen are defined as initial routes, we don't need to return a state + // since it will be created by react-navigation. + if (path.includes('intent/')) { + if (isNative) return + return buildStateObject('Flat', 'Home', params) + } - const [name, params] = router.matchPath(path) if (isNative) { if (name === 'Search') { return buildStateObject('SearchTab', 'Search', params) |