fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/app.config.js b/app.config.js
|
||||
index 246d8abd3..56f42202b 100644
|
||||
index 246d8abd3..24a1887f6 100644
|
||||
--- a/app.config.js
|
||||
+++ b/app.config.js
|
||||
@@ -40,7 +40,7 @@ module.exports = function (_config) {
|
||||
@@ -11,34 +11,3 @@ index 246d8abd3..56f42202b 100644
|
||||
userInterfaceStyle: 'automatic',
|
||||
primaryColor: '#1083fe',
|
||||
newArchEnabled: false,
|
||||
@@ -213,9 +213,9 @@ module.exports = function (_config) {
|
||||
: undefined,
|
||||
codeSigningMetadata: UPDATES_ENABLED
|
||||
? {
|
||||
- keyid: 'main',
|
||||
- alg: 'rsa-v1_5-sha256',
|
||||
- }
|
||||
+ keyid: 'main',
|
||||
+ alg: 'rsa-v1_5-sha256',
|
||||
+ }
|
||||
: undefined,
|
||||
checkAutomatically: 'NEVER',
|
||||
},
|
||||
@@ -225,7 +225,7 @@ module.exports = function (_config) {
|
||||
'expo-web-browser',
|
||||
[
|
||||
'react-native-edge-to-edge',
|
||||
- {android: {enforceNavigationBarContrast: false}},
|
||||
+ { android: { enforceNavigationBarContrast: false } },
|
||||
],
|
||||
USE_SENTRY && [
|
||||
'@sentry/react-native/expo',
|
||||
@@ -386,7 +386,7 @@ module.exports = function (_config) {
|
||||
},
|
||||
},
|
||||
],
|
||||
- ['expo-screen-orientation', {initialOrientation: 'PORTRAIT_UP'}],
|
||||
+ ['expo-screen-orientation', { initialOrientation: 'PORTRAIT_UP' }],
|
||||
['expo-location'],
|
||||
].filter(Boolean),
|
||||
extra: {
|
||||
|
||||
@@ -1,763 +1,19 @@
|
||||
diff --git a/src/Navigation.tsx b/src/Navigation.tsx
|
||||
index fa33a9d56..c48d078d4 100644
|
||||
index fa33a9d56..59f54d0b0 100644
|
||||
--- a/src/Navigation.tsx
|
||||
+++ b/src/Navigation.tsx
|
||||
@@ -1,8 +1,8 @@
|
||||
-import {type JSX, useCallback, useRef} from 'react'
|
||||
-import {Linking} from 'react-native'
|
||||
+import { type JSX, useCallback, useRef } from 'react'
|
||||
+import { Linking } from 'react-native'
|
||||
import * as Notifications from 'expo-notifications'
|
||||
-import {i18n, type MessageDescriptor} from '@lingui/core'
|
||||
-import {msg} from '@lingui/macro'
|
||||
+import { i18n, type MessageDescriptor } from '@lingui/core'
|
||||
+import { msg } from '@lingui/macro'
|
||||
import {
|
||||
type BottomTabBarProps,
|
||||
createBottomTabNavigator,
|
||||
@@ -17,17 +17,17 @@ import {
|
||||
StackActions,
|
||||
} from '@react-navigation/native'
|
||||
|
||||
-import {timeout} from '#/lib/async/timeout'
|
||||
-import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
||||
+import { timeout } from '#/lib/async/timeout'
|
||||
+import { useColorSchemeStyle } from '#/lib/hooks/useColorSchemeStyle'
|
||||
import {
|
||||
getNotificationPayload,
|
||||
type NotificationPayload,
|
||||
notificationToURL,
|
||||
storePayloadForAccountSwitch,
|
||||
} from '#/lib/hooks/useNotificationHandler'
|
||||
-import {useWebScrollRestoration} from '#/lib/hooks/useWebScrollRestoration'
|
||||
-import {logger as notyLogger} from '#/lib/notifications/util'
|
||||
-import {buildStateObject} from '#/lib/routes/helpers'
|
||||
+import { useWebScrollRestoration } from '#/lib/hooks/useWebScrollRestoration'
|
||||
+import { logger as notyLogger } from '#/lib/notifications/util'
|
||||
+import { buildStateObject } from '#/lib/routes/helpers'
|
||||
import {
|
||||
type AllNavigatorParams,
|
||||
type BottomTabNavigatorParams,
|
||||
@@ -38,106 +38,107 @@ import {
|
||||
type NotificationsTabNavigatorParams,
|
||||
type SearchTabNavigatorParams,
|
||||
} from '#/lib/routes/types'
|
||||
-import {type RouteParams, type State} from '#/lib/routes/types'
|
||||
-import {attachRouteToLogEvents, logEvent} from '#/lib/statsig/statsig'
|
||||
-import {bskyTitle} from '#/lib/strings/headings'
|
||||
-import {logger} from '#/logger'
|
||||
-import {isNative, isWeb} from '#/platform/detection'
|
||||
-import {useUnreadNotifications} from '#/state/queries/notifications/unread'
|
||||
-import {useSession} from '#/state/session'
|
||||
+import { type RouteParams, type State } from '#/lib/routes/types'
|
||||
+import { attachRouteToLogEvents, logEvent } from '#/lib/statsig/statsig'
|
||||
+import { bskyTitle } from '#/lib/strings/headings'
|
||||
+import { logger } from '#/logger'
|
||||
+import { isNative, isWeb } from '#/platform/detection'
|
||||
+import { useUnreadNotifications } from '#/state/queries/notifications/unread'
|
||||
+import { useSession } from '#/state/session'
|
||||
import {
|
||||
@@ -49,6 +49,7 @@ import {
|
||||
shouldRequestEmailConfirmation,
|
||||
snoozeEmailConfirmationPrompt,
|
||||
} from '#/state/shell/reminders'
|
||||
-import {CommunityGuidelinesScreen} from '#/view/screens/CommunityGuidelines'
|
||||
-import {CopyrightPolicyScreen} from '#/view/screens/CopyrightPolicy'
|
||||
-import {DebugModScreen} from '#/view/screens/DebugMod'
|
||||
-import {FeedsScreen} from '#/view/screens/Feeds'
|
||||
-import {HomeScreen} from '#/view/screens/Home'
|
||||
-import {ListsScreen} from '#/view/screens/Lists'
|
||||
-import {ModerationBlockedAccounts} from '#/view/screens/ModerationBlockedAccounts'
|
||||
-import {ModerationModlistsScreen} from '#/view/screens/ModerationModlists'
|
||||
-import {ModerationMutedAccounts} from '#/view/screens/ModerationMutedAccounts'
|
||||
-import {NotFoundScreen} from '#/view/screens/NotFound'
|
||||
-import {NotificationsScreen} from '#/view/screens/Notifications'
|
||||
-import {PostThreadScreen} from '#/view/screens/PostThread'
|
||||
-import {PrivacyPolicyScreen} from '#/view/screens/PrivacyPolicy'
|
||||
-import {ProfileScreen} from '#/view/screens/Profile'
|
||||
-import {ProfileFeedLikedByScreen} from '#/view/screens/ProfileFeedLikedBy'
|
||||
-import {Storybook} from '#/view/screens/Storybook'
|
||||
-import {SupportScreen} from '#/view/screens/Support'
|
||||
-import {TermsOfServiceScreen} from '#/view/screens/TermsOfService'
|
||||
-import {BottomBar} from '#/view/shell/bottom-bar/BottomBar'
|
||||
-import {createNativeStackNavigatorWithAuth} from '#/view/shell/createNativeStackNavigatorWithAuth'
|
||||
-import {BookmarksScreen} from '#/screens/Bookmarks'
|
||||
-import {SharedPreferencesTesterScreen} from '#/screens/E2E/SharedPreferencesTesterScreen'
|
||||
+import { LicenseScreen } from '#/view/screens/License'
|
||||
+import { CommunityGuidelinesScreen } from '#/view/screens/CommunityGuidelines'
|
||||
+import { CopyrightPolicyScreen } from '#/view/screens/CopyrightPolicy'
|
||||
+import { DebugModScreen } from '#/view/screens/DebugMod'
|
||||
+import { FeedsScreen } from '#/view/screens/Feeds'
|
||||
+import { HomeScreen } from '#/view/screens/Home'
|
||||
+import { ListsScreen } from '#/view/screens/Lists'
|
||||
+import { ModerationBlockedAccounts } from '#/view/screens/ModerationBlockedAccounts'
|
||||
+import { ModerationModlistsScreen } from '#/view/screens/ModerationModlists'
|
||||
+import { ModerationMutedAccounts } from '#/view/screens/ModerationMutedAccounts'
|
||||
+import { NotFoundScreen } from '#/view/screens/NotFound'
|
||||
+import { NotificationsScreen } from '#/view/screens/Notifications'
|
||||
+import { PostThreadScreen } from '#/view/screens/PostThread'
|
||||
+import { PrivacyPolicyScreen } from '#/view/screens/PrivacyPolicy'
|
||||
+import { ProfileScreen } from '#/view/screens/Profile'
|
||||
+import { ProfileFeedLikedByScreen } from '#/view/screens/ProfileFeedLikedBy'
|
||||
+import { Storybook } from '#/view/screens/Storybook'
|
||||
+import { SupportScreen } from '#/view/screens/Support'
|
||||
+import { TermsOfServiceScreen } from '#/view/screens/TermsOfService'
|
||||
+import { BottomBar } from '#/view/shell/bottom-bar/BottomBar'
|
||||
+import { createNativeStackNavigatorWithAuth } from '#/view/shell/createNativeStackNavigatorWithAuth'
|
||||
+import { BookmarksScreen } from '#/screens/Bookmarks'
|
||||
+import { SharedPreferencesTesterScreen } from '#/screens/E2E/SharedPreferencesTesterScreen'
|
||||
import HashtagScreen from '#/screens/Hashtag'
|
||||
-import {LogScreen} from '#/screens/Log'
|
||||
-import {MessagesScreen} from '#/screens/Messages/ChatList'
|
||||
-import {MessagesConversationScreen} from '#/screens/Messages/Conversation'
|
||||
-import {MessagesInboxScreen} from '#/screens/Messages/Inbox'
|
||||
-import {MessagesSettingsScreen} from '#/screens/Messages/Settings'
|
||||
-import {ModerationScreen} from '#/screens/Moderation'
|
||||
-import {Screen as ModerationVerificationSettings} from '#/screens/Moderation/VerificationSettings'
|
||||
-import {Screen as ModerationInteractionSettings} from '#/screens/ModerationInteractionSettings'
|
||||
-import {NotificationsActivityListScreen} from '#/screens/Notifications/ActivityList'
|
||||
-import {PostLikedByScreen} from '#/screens/Post/PostLikedBy'
|
||||
-import {PostQuotesScreen} from '#/screens/Post/PostQuotes'
|
||||
-import {PostRepostedByScreen} from '#/screens/Post/PostRepostedBy'
|
||||
-import {ProfileKnownFollowersScreen} from '#/screens/Profile/KnownFollowers'
|
||||
-import {ProfileFeedScreen} from '#/screens/Profile/ProfileFeed'
|
||||
-import {ProfileFollowersScreen} from '#/screens/Profile/ProfileFollowers'
|
||||
-import {ProfileFollowsScreen} from '#/screens/Profile/ProfileFollows'
|
||||
-import {ProfileLabelerLikedByScreen} from '#/screens/Profile/ProfileLabelerLikedBy'
|
||||
-import {ProfileSearchScreen} from '#/screens/Profile/ProfileSearch'
|
||||
-import {ProfileListScreen} from '#/screens/ProfileList'
|
||||
-import {SavedFeeds} from '#/screens/SavedFeeds'
|
||||
-import {SearchScreen} from '#/screens/Search'
|
||||
-import {AboutSettingsScreen} from '#/screens/Settings/AboutSettings'
|
||||
-import {AccessibilitySettingsScreen} from '#/screens/Settings/AccessibilitySettings'
|
||||
-import {AccountSettingsScreen} from '#/screens/Settings/AccountSettings'
|
||||
-import {ActivityPrivacySettingsScreen} from '#/screens/Settings/ActivityPrivacySettings'
|
||||
-import {AppearanceSettingsScreen} from '#/screens/Settings/AppearanceSettings'
|
||||
-import {AppIconSettingsScreen} from '#/screens/Settings/AppIconSettings'
|
||||
-import {AppPasswordsScreen} from '#/screens/Settings/AppPasswords'
|
||||
-import {ContentAndMediaSettingsScreen} from '#/screens/Settings/ContentAndMediaSettings'
|
||||
-import {ExternalMediaPreferencesScreen} from '#/screens/Settings/ExternalMediaPreferences'
|
||||
-import {FollowingFeedPreferencesScreen} from '#/screens/Settings/FollowingFeedPreferences'
|
||||
-import {InterestsSettingsScreen} from '#/screens/Settings/InterestsSettings'
|
||||
-import {LanguageSettingsScreen} from '#/screens/Settings/LanguageSettings'
|
||||
-import {LegacyNotificationSettingsScreen} from '#/screens/Settings/LegacyNotificationSettings'
|
||||
-import {NotificationSettingsScreen} from '#/screens/Settings/NotificationSettings'
|
||||
-import {ActivityNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/ActivityNotificationSettings'
|
||||
-import {LikeNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/LikeNotificationSettings'
|
||||
-import {LikesOnRepostsNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings'
|
||||
-import {MentionNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/MentionNotificationSettings'
|
||||
-import {MiscellaneousNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/MiscellaneousNotificationSettings'
|
||||
-import {NewFollowerNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/NewFollowerNotificationSettings'
|
||||
-import {QuoteNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/QuoteNotificationSettings'
|
||||
-import {ReplyNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/ReplyNotificationSettings'
|
||||
-import {RepostNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/RepostNotificationSettings'
|
||||
-import {RepostsOnRepostsNotificationSettingsScreen} from '#/screens/Settings/NotificationSettings/RepostsOnRepostsNotificationSettings'
|
||||
-import {PrivacyAndSecuritySettingsScreen} from '#/screens/Settings/PrivacyAndSecuritySettings'
|
||||
-import {SettingsScreen} from '#/screens/Settings/Settings'
|
||||
-import {ThreadPreferencesScreen} from '#/screens/Settings/ThreadPreferences'
|
||||
+import { LogScreen } from '#/screens/Log'
|
||||
+import { MessagesScreen } from '#/screens/Messages/ChatList'
|
||||
+import { MessagesConversationScreen } from '#/screens/Messages/Conversation'
|
||||
+import { MessagesInboxScreen } from '#/screens/Messages/Inbox'
|
||||
+import { MessagesSettingsScreen } from '#/screens/Messages/Settings'
|
||||
+import { ModerationScreen } from '#/screens/Moderation'
|
||||
+import { Screen as ModerationVerificationSettings } from '#/screens/Moderation/VerificationSettings'
|
||||
+import { Screen as ModerationInteractionSettings } from '#/screens/ModerationInteractionSettings'
|
||||
+import { NotificationsActivityListScreen } from '#/screens/Notifications/ActivityList'
|
||||
+import { PostLikedByScreen } from '#/screens/Post/PostLikedBy'
|
||||
+import { PostQuotesScreen } from '#/screens/Post/PostQuotes'
|
||||
+import { PostRepostedByScreen } from '#/screens/Post/PostRepostedBy'
|
||||
+import { ProfileKnownFollowersScreen } from '#/screens/Profile/KnownFollowers'
|
||||
+import { ProfileFeedScreen } from '#/screens/Profile/ProfileFeed'
|
||||
+import { ProfileFollowersScreen } from '#/screens/Profile/ProfileFollowers'
|
||||
+import { ProfileFollowsScreen } from '#/screens/Profile/ProfileFollows'
|
||||
+import { ProfileLabelerLikedByScreen } from '#/screens/Profile/ProfileLabelerLikedBy'
|
||||
+import { ProfileSearchScreen } from '#/screens/Profile/ProfileSearch'
|
||||
+import { ProfileListScreen } from '#/screens/ProfileList'
|
||||
+import { SavedFeeds } from '#/screens/SavedFeeds'
|
||||
+import { SearchScreen } from '#/screens/Search'
|
||||
+import { AboutSettingsScreen } from '#/screens/Settings/AboutSettings'
|
||||
+import { AccessibilitySettingsScreen } from '#/screens/Settings/AccessibilitySettings'
|
||||
+import { AccountSettingsScreen } from '#/screens/Settings/AccountSettings'
|
||||
+import { ActivityPrivacySettingsScreen } from '#/screens/Settings/ActivityPrivacySettings'
|
||||
+import { AppearanceSettingsScreen } from '#/screens/Settings/AppearanceSettings'
|
||||
+import { AppIconSettingsScreen } from '#/screens/Settings/AppIconSettings'
|
||||
+import { AppPasswordsScreen } from '#/screens/Settings/AppPasswords'
|
||||
+import { ContentAndMediaSettingsScreen } from '#/screens/Settings/ContentAndMediaSettings'
|
||||
+import { ExternalMediaPreferencesScreen } from '#/screens/Settings/ExternalMediaPreferences'
|
||||
+import { FollowingFeedPreferencesScreen } from '#/screens/Settings/FollowingFeedPreferences'
|
||||
+import { InterestsSettingsScreen } from '#/screens/Settings/InterestsSettings'
|
||||
+import { LanguageSettingsScreen } from '#/screens/Settings/LanguageSettings'
|
||||
+import { LegacyNotificationSettingsScreen } from '#/screens/Settings/LegacyNotificationSettings'
|
||||
+import { NotificationSettingsScreen } from '#/screens/Settings/NotificationSettings'
|
||||
+import { ActivityNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/ActivityNotificationSettings'
|
||||
+import { LikeNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/LikeNotificationSettings'
|
||||
+import { LikesOnRepostsNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings'
|
||||
+import { MentionNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/MentionNotificationSettings'
|
||||
+import { MiscellaneousNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/MiscellaneousNotificationSettings'
|
||||
+import { NewFollowerNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/NewFollowerNotificationSettings'
|
||||
+import { QuoteNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/QuoteNotificationSettings'
|
||||
+import { ReplyNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/ReplyNotificationSettings'
|
||||
+import { RepostNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/RepostNotificationSettings'
|
||||
+import { RepostsOnRepostsNotificationSettingsScreen } from '#/screens/Settings/NotificationSettings/RepostsOnRepostsNotificationSettings'
|
||||
+import { PrivacyAndSecuritySettingsScreen } from '#/screens/Settings/PrivacyAndSecuritySettings'
|
||||
+import { SettingsScreen } from '#/screens/Settings/Settings'
|
||||
+import { ThreadPreferencesScreen } from '#/screens/Settings/ThreadPreferences'
|
||||
import {
|
||||
StarterPackScreen,
|
||||
StarterPackScreenShort,
|
||||
} from '#/screens/StarterPack/StarterPackScreen'
|
||||
-import {Wizard} from '#/screens/StarterPack/Wizard'
|
||||
+import { Wizard } from '#/screens/StarterPack/Wizard'
|
||||
import TopicScreen from '#/screens/Topic'
|
||||
-import {VideoFeed} from '#/screens/VideoFeed'
|
||||
-import {type Theme, useTheme} from '#/alf'
|
||||
+import { VideoFeed } from '#/screens/VideoFeed'
|
||||
+import { type Theme, useTheme } from '#/alf'
|
||||
import {
|
||||
EmailDialogScreenID,
|
||||
useEmailDialogControl,
|
||||
} from '#/components/dialogs/EmailDialog'
|
||||
-import {router} from '#/routes'
|
||||
-import {Referrer} from '../modules/expo-bluesky-swiss-army'
|
||||
-import {useAccountSwitcher} from './lib/hooks/useAccountSwitcher'
|
||||
-import {useNonReactiveCallback} from './lib/hooks/useNonReactiveCallback'
|
||||
-import {useLoggedOutViewControls} from './state/shell/logged-out'
|
||||
-import {useCloseAllActiveElements} from './state/util'
|
||||
+import { router } from '#/routes'
|
||||
+import { Referrer } from '../modules/expo-bluesky-swiss-army'
|
||||
+import { useAccountSwitcher } from './lib/hooks/useAccountSwitcher'
|
||||
+import { useNonReactiveCallback } from './lib/hooks/useNonReactiveCallback'
|
||||
+import { useLoggedOutViewControls } from './state/shell/logged-out'
|
||||
+import { useCloseAllActiveElements } from './state/util'
|
||||
|
||||
const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
|
||||
|
||||
@@ -164,32 +165,32 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
|
||||
<Stack.Screen
|
||||
name="NotFound"
|
||||
getComponent={() => NotFoundScreen}
|
||||
- options={{title: title(msg`Not Found`)}}
|
||||
+ options={{ title: title(msg`Not Found`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Lists"
|
||||
component={ListsScreen}
|
||||
- options={{title: title(msg`Lists`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Lists`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Moderation"
|
||||
getComponent={() => ModerationScreen}
|
||||
- options={{title: title(msg`Moderation`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Moderation`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ModerationModlists"
|
||||
getComponent={() => ModerationModlistsScreen}
|
||||
- options={{title: title(msg`Moderation Lists`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Moderation Lists`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ModerationMutedAccounts"
|
||||
getComponent={() => ModerationMutedAccounts}
|
||||
- options={{title: title(msg`Muted Accounts`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Muted Accounts`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ModerationBlockedAccounts"
|
||||
getComponent={() => ModerationBlockedAccounts}
|
||||
- options={{title: title(msg`Blocked Accounts`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Blocked Accounts`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ModerationInteractionSettings"
|
||||
@@ -210,150 +211,150 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
|
||||
<Stack.Screen
|
||||
name="Settings"
|
||||
getComponent={() => SettingsScreen}
|
||||
- options={{title: title(msg`Settings`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Settings`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="LanguageSettings"
|
||||
getComponent={() => LanguageSettingsScreen}
|
||||
- options={{title: title(msg`Language Settings`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Language Settings`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Profile"
|
||||
getComponent={() => ProfileScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: bskyTitle(`@${route.params.name}`, unreadCountLabel),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileFollowers"
|
||||
getComponent={() => ProfileFollowersScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`People following @${route.params.name}`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileFollows"
|
||||
getComponent={() => ProfileFollowsScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`People followed by @${route.params.name}`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileKnownFollowers"
|
||||
getComponent={() => ProfileKnownFollowersScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`Followers of @${route.params.name} that you know`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileList"
|
||||
getComponent={() => ProfileListScreen}
|
||||
- options={{title: title(msg`List`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`List`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileSearch"
|
||||
getComponent={() => ProfileSearchScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`Search @${route.params.name}'s posts`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PostThread"
|
||||
getComponent={() => PostThreadScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`Post by @${route.params.name}`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PostLikedBy"
|
||||
getComponent={() => PostLikedByScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`Post by @${route.params.name}`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PostRepostedBy"
|
||||
getComponent={() => PostRepostedByScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`Post by @${route.params.name}`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PostQuotes"
|
||||
getComponent={() => PostQuotesScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
title: title(msg`Post by @${route.params.name}`),
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileFeed"
|
||||
getComponent={() => ProfileFeedScreen}
|
||||
- options={{title: title(msg`Feed`)}}
|
||||
+ options={{ title: title(msg`Feed`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileFeedLikedBy"
|
||||
getComponent={() => ProfileFeedLikedByScreen}
|
||||
- options={{title: title(msg`Liked by`)}}
|
||||
+ options={{ title: title(msg`Liked by`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ProfileLabelerLikedBy"
|
||||
getComponent={() => ProfileLabelerLikedByScreen}
|
||||
- options={{title: title(msg`Liked by`)}}
|
||||
+ options={{ title: title(msg`Liked by`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Debug"
|
||||
getComponent={() => Storybook}
|
||||
- options={{title: title(msg`Storybook`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Storybook`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="DebugMod"
|
||||
getComponent={() => DebugModScreen}
|
||||
- options={{title: title(msg`Moderation states`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Moderation states`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="SharedPreferencesTester"
|
||||
getComponent={() => SharedPreferencesTesterScreen}
|
||||
- options={{title: title(msg`Shared Preferences Tester`)}}
|
||||
+ options={{ title: title(msg`Shared Preferences Tester`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Log"
|
||||
getComponent={() => LogScreen}
|
||||
- options={{title: title(msg`Log`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Log`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Support"
|
||||
getComponent={() => SupportScreen}
|
||||
- options={{title: title(msg`Support`)}}
|
||||
+ options={{ title: title(msg`Support`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PrivacyPolicy"
|
||||
getComponent={() => PrivacyPolicyScreen}
|
||||
- options={{title: title(msg`Privacy Policy`)}}
|
||||
+ options={{ title: title(msg`Privacy Policy`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="TermsOfService"
|
||||
getComponent={() => TermsOfServiceScreen}
|
||||
- options={{title: title(msg`Terms of Service`)}}
|
||||
+ options={{ title: title(msg`Terms of Service`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="CommunityGuidelines"
|
||||
getComponent={() => CommunityGuidelinesScreen}
|
||||
- options={{title: title(msg`Community Guidelines`)}}
|
||||
+ options={{ title: title(msg`Community Guidelines`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="CopyrightPolicy"
|
||||
getComponent={() => CopyrightPolicyScreen}
|
||||
- options={{title: title(msg`Copyright Policy`)}}
|
||||
+ options={{ title: title(msg`Copyright Policy`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="AppPasswords"
|
||||
getComponent={() => AppPasswordsScreen}
|
||||
- options={{title: title(msg`App Passwords`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`App Passwords`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="SavedFeeds"
|
||||
getComponent={() => SavedFeeds}
|
||||
- options={{title: title(msg`Edit My Feeds`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Edit My Feeds`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PreferencesFollowingFeed"
|
||||
@@ -366,7 +367,7 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
|
||||
<Stack.Screen
|
||||
name="PreferencesThreads"
|
||||
getComponent={() => ThreadPreferencesScreen}
|
||||
- options={{title: title(msg`Threads Preferences`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Threads Preferences`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="PreferencesExternalEmbeds"
|
||||
@@ -419,7 +420,7 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
|
||||
<Stack.Screen
|
||||
name="NotificationSettings"
|
||||
getComponent={() => NotificationSettingsScreen}
|
||||
- options={{title: title(msg`Notification settings`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Notification settings`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="ReplyNotificationSettings"
|
||||
@@ -536,62 +537,62 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
|
||||
<Stack.Screen
|
||||
name="Hashtag"
|
||||
getComponent={() => HashtagScreen}
|
||||
- options={{title: title(msg`Hashtag`)}}
|
||||
+ options={{ title: title(msg`Hashtag`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Topic"
|
||||
getComponent={() => TopicScreen}
|
||||
- options={{title: title(msg`Topic`)}}
|
||||
+ options={{ title: title(msg`Topic`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="MessagesConversation"
|
||||
getComponent={() => MessagesConversationScreen}
|
||||
- options={{title: title(msg`Chat`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Chat`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="MessagesSettings"
|
||||
getComponent={() => MessagesSettingsScreen}
|
||||
- options={{title: title(msg`Chat settings`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Chat settings`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="MessagesInbox"
|
||||
getComponent={() => MessagesInboxScreen}
|
||||
- options={{title: title(msg`Chat request inbox`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Chat request inbox`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="NotificationsActivityList"
|
||||
getComponent={() => NotificationsActivityListScreen}
|
||||
- options={{title: title(msg`Notifications`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Notifications`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="LegacyNotificationSettings"
|
||||
getComponent={() => LegacyNotificationSettingsScreen}
|
||||
- options={{title: title(msg`Notification settings`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Notification settings`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Feeds"
|
||||
getComponent={() => FeedsScreen}
|
||||
- options={{title: title(msg`Feeds`)}}
|
||||
+ options={{ title: title(msg`Feeds`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="StarterPack"
|
||||
getComponent={() => StarterPackScreen}
|
||||
- options={{title: title(msg`Starter Pack`)}}
|
||||
+ options={{ title: title(msg`Starter Pack`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="StarterPackShort"
|
||||
getComponent={() => StarterPackScreenShort}
|
||||
- options={{title: title(msg`Starter Pack`)}}
|
||||
+ options={{ title: title(msg`Starter Pack`) }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="StarterPackWizard"
|
||||
getComponent={() => Wizard}
|
||||
- options={{title: title(msg`Create a starter pack`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Create a starter pack`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="StarterPackEdit"
|
||||
getComponent={() => Wizard}
|
||||
- options={{title: title(msg`Edit your starter pack`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Edit your starter pack`), requireAuth: true }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="VideoFeed"
|
||||
@@ -629,7 +630,7 @@ function TabsNavigator() {
|
||||
<Tab.Navigator
|
||||
initialRouteName="HomeTab"
|
||||
backBehavior="initialRoute"
|
||||
- screenOptions={{headerShown: false, lazy: true}}
|
||||
+ screenOptions={{ headerShown: false, lazy: true }}
|
||||
tabBar={tabBar}>
|
||||
<Tab.Screen name="HomeTab" getComponent={() => HomeTabNavigator} />
|
||||
<Tab.Screen name="SearchTab" getComponent={() => SearchTabNavigator} />
|
||||
@@ -663,6 +664,8 @@ function HomeTabNavigator() {
|
||||
return (
|
||||
<HomeTab.Navigator screenOptions={screenOptions(t)} initialRouteName="Home">
|
||||
<HomeTab.Screen name="Home" getComponent={() => HomeScreen} />
|
||||
+ <HomeTab.Screen name="TermsOfService" component={TermsOfServiceScreen} />
|
||||
+ <HomeTab.Screen name="License" component={LicenseScreen} />
|
||||
<HomeTab.Screen name="Start" getComponent={() => HomeScreen} />
|
||||
{commonScreens(HomeTab as typeof Flat)}
|
||||
</HomeTab.Navigator>
|
||||
@@ -690,7 +693,7 @@ function NotificationsTabNavigator() {
|
||||
<NotificationsTab.Screen
|
||||
name="Notifications"
|
||||
getComponent={() => NotificationsScreen}
|
||||
- options={{requireAuth: true}}
|
||||
+ options={{ requireAuth: true }}
|
||||
/>
|
||||
{commonScreens(NotificationsTab as typeof Flat)}
|
||||
</NotificationsTab.Navigator>
|
||||
@@ -708,7 +711,7 @@ function MyProfileTabNavigator() {
|
||||
// gives us typechecking for initialParams -sfn
|
||||
name={'MyProfile' as 'Profile'}
|
||||
getComponent={() => ProfileScreen}
|
||||
- initialParams={{name: 'me', hideBackButton: true}}
|
||||
+ initialParams={{ name: 'me', hideBackButton: true }}
|
||||
/>
|
||||
{commonScreens(MyProfileTab as unknown as typeof Flat)}
|
||||
</MyProfileTab.Navigator>
|
||||
@@ -724,7 +727,7 @@ function MessagesTabNavigator() {
|
||||
<MessagesTab.Screen
|
||||
name="Messages"
|
||||
getComponent={() => MessagesScreen}
|
||||
- options={({route}) => ({
|
||||
+ options={({ route }) => ({
|
||||
requireAuth: true,
|
||||
animationTypeForReplace: route.params?.animation ?? 'push',
|
||||
})}
|
||||
@@ -751,27 +754,27 @@ const FlatNavigator = () => {
|
||||
<Flat.Screen
|
||||
name="Home"
|
||||
getComponent={() => HomeScreen}
|
||||
- options={{title: title(msg`Home`)}}
|
||||
+ options={{ title: title(msg`Home`) }}
|
||||
/>
|
||||
<Flat.Screen
|
||||
name="Search"
|
||||
getComponent={() => SearchScreen}
|
||||
- options={{title: title(msg`Explore`)}}
|
||||
+ options={{ title: title(msg`Explore`) }}
|
||||
/>
|
||||
<Flat.Screen
|
||||
name="Notifications"
|
||||
getComponent={() => NotificationsScreen}
|
||||
- options={{title: title(msg`Notifications`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Notifications`), requireAuth: true }}
|
||||
/>
|
||||
<Flat.Screen
|
||||
name="Messages"
|
||||
getComponent={() => MessagesScreen}
|
||||
- options={{title: title(msg`Messages`), requireAuth: true}}
|
||||
+ options={{ title: title(msg`Messages`), requireAuth: true }}
|
||||
/>
|
||||
<Flat.Screen
|
||||
name="Start"
|
||||
getComponent={() => HomeScreen}
|
||||
- options={{title: title(msg`Home`)}}
|
||||
+ options={{ title: title(msg`Home`) }}
|
||||
/>
|
||||
{commonScreens(Flat, numUnread)}
|
||||
</Flat.Navigator>
|
||||
@@ -849,11 +852,11 @@ const LINKING = {
|
||||
*/
|
||||
let lastHandledNotificationDateDedupe: number | undefined
|
||||
|
||||
-function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
+function RoutesContainer({ children }: React.PropsWithChildren<{}>) {
|
||||
const theme = useColorSchemeStyle(DefaultTheme, DarkTheme)
|
||||
- const {currentAccount, accounts} = useSession()
|
||||
- const {onPressSwitchAccount} = useAccountSwitcher()
|
||||
- const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
+ const { currentAccount, accounts } = useSession()
|
||||
+ const { onPressSwitchAccount } = useAccountSwitcher()
|
||||
+ const { setShowLoggedOut } = useLoggedOutViewControls()
|
||||
const prevLoggedRouteName = useRef<string | undefined>(undefined)
|
||||
const emailDialogControl = useEmailDialogControl()
|
||||
const closeAllActiveElements = useCloseAllActiveElements()
|
||||
@@ -865,8 +868,8 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
* after an async call - sfn
|
||||
*/
|
||||
const handleChatMessage = useNonReactiveCallback(
|
||||
- (payload: Extract<NotificationPayload, {reason: 'chat-message'}>) => {
|
||||
- notyLogger.debug(`handleChatMessage`, {payload})
|
||||
+ (payload: Extract<NotificationPayload, { reason: 'chat-message' }>) => {
|
||||
+ notyLogger.debug(`handleChatMessage`, { payload })
|
||||
|
||||
if (payload.recipientDid !== currentAccount?.did) {
|
||||
// handled in useNotificationHandler after account switch finishes
|
||||
@@ -907,7 +910,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
const response = await Notifications.getLastNotificationResponseAsync()
|
||||
|
||||
if (response) {
|
||||
- notyLogger.debug(`handlePushNotificationEntry: response`, {response})
|
||||
+ notyLogger.debug(`handlePushNotificationEntry: response`, { response })
|
||||
|
||||
if (response.notification.date === lastHandledNotificationDateDedupe)
|
||||
return
|
||||
@@ -918,8 +921,8 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
if (payload) {
|
||||
notyLogger.metric(
|
||||
'notifications:openApp',
|
||||
- {reason: payload.reason, causedBoot: true},
|
||||
- {statsig: false},
|
||||
+ { reason: payload.reason, causedBoot: true },
|
||||
+ { statsig: false },
|
||||
)
|
||||
|
||||
if (payload.reason === 'chat-message') {
|
||||
@@ -933,7 +936,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
} else if (path) {
|
||||
const [screen, params] = router.matchPath(path)
|
||||
// @ts-expect-error nested navigators aren't typed -sfn
|
||||
- navigate('HomeTab', {screen, params})
|
||||
+ navigate('HomeTab', { screen, params })
|
||||
notyLogger.debug(`handlePushNotificationEntry: navigate`, {
|
||||
screen,
|
||||
params,
|
||||
@@ -963,8 +966,8 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
onStateChange={() => {
|
||||
logger.metric(
|
||||
'router:navigate',
|
||||
- {from: prevLoggedRouteName.current},
|
||||
- {statsig: false},
|
||||
+ { from: prevLoggedRouteName.current },
|
||||
+ { statsig: false },
|
||||
)
|
||||
prevLoggedRouteName.current = getCurrentRouteName()
|
||||
}}
|
||||
@@ -972,7 +975,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||
attachRouteToLogEvents(getCurrentRouteName)
|
||||
logModuleInitTime()
|
||||
onReady()
|
||||
- logger.metric('router:navigate', {}, {statsig: false})
|
||||
+ logger.metric('router:navigate', {}, { statsig: false })
|
||||
handlePushNotificationEntry()
|
||||
}}
|
||||
// WARNING: Implicit navigation to nested navigators is depreciated in React Navigation 7.x
|
||||
@@ -1040,7 +1043,7 @@ function reset(): Promise<void> {
|
||||
navigationRef.dispatch(
|
||||
CommonActions.reset({
|
||||
index: 0,
|
||||
- routes: [{name: isNative ? 'HomeTab' : 'Home'}],
|
||||
+ routes: [{ name: isNative ? 'HomeTab' : 'Home' }],
|
||||
}),
|
||||
)
|
||||
return Promise.race([
|
||||
+import {LicenseScreen} from '#/view/screens/License'
|
||||
import {CommunityGuidelinesScreen} from '#/view/screens/CommunityGuidelines'
|
||||
import {CopyrightPolicyScreen} from '#/view/screens/CopyrightPolicy'
|
||||
import {DebugModScreen} from '#/view/screens/DebugMod'
|
||||
diff --git a/src/lib/routes/types.ts b/src/lib/routes/types.ts
|
||||
index c315a8341..dc84545f7 100644
|
||||
index c315a8341..9b2f50a83 100644
|
||||
--- a/src/lib/routes/types.ts
|
||||
+++ b/src/lib/routes/types.ts
|
||||
@@ -1,9 +1,9 @@
|
||||
-import {type NavigationState, type PartialState} from '@react-navigation/native'
|
||||
-import {type NativeStackNavigationProp} from '@react-navigation/native-stack'
|
||||
+import { type NavigationState, type PartialState } from '@react-navigation/native'
|
||||
+import { type NativeStackNavigationProp } from '@react-navigation/native-stack'
|
||||
|
||||
-import {type VideoFeedSourceContext} from '#/screens/VideoFeed/types'
|
||||
+import { type VideoFeedSourceContext } from '#/screens/VideoFeed/types'
|
||||
|
||||
-export type {NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
+export type { NativeStackScreenProps } from '@react-navigation/native-stack'
|
||||
|
||||
export type CommonNavigatorParams = {
|
||||
NotFound: undefined
|
||||
@@ -15,23 +15,23 @@ export type CommonNavigatorParams = {
|
||||
ModerationInteractionSettings: undefined
|
||||
ModerationVerificationSettings: undefined
|
||||
Settings: undefined
|
||||
- Profile: {name: string; hideBackButton?: boolean}
|
||||
- ProfileFollowers: {name: string}
|
||||
- ProfileFollows: {name: string}
|
||||
- ProfileKnownFollowers: {name: string}
|
||||
- ProfileSearch: {name: string; q?: string}
|
||||
- ProfileList: {name: string; rkey: string}
|
||||
- PostThread: {name: string; rkey: string}
|
||||
- PostLikedBy: {name: string; rkey: string}
|
||||
- PostRepostedBy: {name: string; rkey: string}
|
||||
- PostQuotes: {name: string; rkey: string}
|
||||
+ Profile: { name: string; hideBackButton?: boolean }
|
||||
+ ProfileFollowers: { name: string }
|
||||
+ ProfileFollows: { name: string }
|
||||
+ ProfileKnownFollowers: { name: string }
|
||||
+ ProfileSearch: { name: string; q?: string }
|
||||
+ ProfileList: { name: string; rkey: string }
|
||||
+ PostThread: { name: string; rkey: string }
|
||||
+ PostLikedBy: { name: string; rkey: string }
|
||||
+ PostRepostedBy: { name: string; rkey: string }
|
||||
+ PostQuotes: { name: string; rkey: string }
|
||||
ProfileFeed: {
|
||||
name: string
|
||||
rkey: string
|
||||
feedCacheKey?: 'discover' | 'explore' | undefined
|
||||
}
|
||||
- ProfileFeedLikedBy: {name: string; rkey: string}
|
||||
- ProfileLabelerLikedBy: {name: string}
|
||||
+ ProfileFeedLikedBy: { name: string; rkey: string }
|
||||
+ ProfileLabelerLikedBy: { name: string }
|
||||
Debug: undefined
|
||||
DebugMod: undefined
|
||||
SharedPreferencesTester: undefined
|
||||
@@ -39,6 +39,7 @@ export type CommonNavigatorParams = {
|
||||
Support: undefined
|
||||
PrivacyPolicy: undefined
|
||||
@@ -766,117 +22,18 @@ index c315a8341..dc84545f7 100644
|
||||
CommunityGuidelines: undefined
|
||||
CopyrightPolicy: undefined
|
||||
LanguageSettings: undefined
|
||||
@@ -67,24 +68,24 @@ export type CommonNavigatorParams = {
|
||||
InterestsSettings: undefined
|
||||
AboutSettings: undefined
|
||||
AppIconSettings: undefined
|
||||
- Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
|
||||
- Hashtag: {tag: string; author?: string}
|
||||
- Topic: {topic: string}
|
||||
- MessagesConversation: {conversation: string; embed?: string; accept?: true}
|
||||
+ Search: { q?: string; tab?: 'user' | 'profile' | 'feed' }
|
||||
+ Hashtag: { tag: string; author?: string }
|
||||
+ Topic: { topic: string }
|
||||
+ MessagesConversation: { conversation: string; embed?: string; accept?: true }
|
||||
MessagesSettings: undefined
|
||||
MessagesInbox: undefined
|
||||
- NotificationsActivityList: {posts: string}
|
||||
+ NotificationsActivityList: { posts: string }
|
||||
LegacyNotificationSettings: undefined
|
||||
Feeds: undefined
|
||||
- Start: {name: string; rkey: string}
|
||||
- StarterPack: {name: string; rkey: string; new?: boolean}
|
||||
- StarterPackShort: {code: string}
|
||||
+ Start: { name: string; rkey: string }
|
||||
+ StarterPack: { name: string; rkey: string; new?: boolean }
|
||||
+ StarterPackShort: { code: string }
|
||||
StarterPackWizard: {
|
||||
fromDialog?: boolean
|
||||
targetDid?: string
|
||||
onSuccess?: () => void
|
||||
}
|
||||
- StarterPackEdit: {rkey?: string}
|
||||
+ StarterPackEdit: { rkey?: string }
|
||||
VideoFeed: VideoFeedSourceContext
|
||||
Bookmarks: undefined
|
||||
}
|
||||
@@ -102,7 +103,7 @@ export type HomeTabNavigatorParams = CommonNavigatorParams & {
|
||||
}
|
||||
|
||||
export type SearchTabNavigatorParams = CommonNavigatorParams & {
|
||||
- Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
|
||||
+ Search: { q?: string; tab?: 'user' | 'profile' | 'feed' }
|
||||
}
|
||||
|
||||
export type NotificationsTabNavigatorParams = CommonNavigatorParams & {
|
||||
@@ -110,32 +111,32 @@ export type NotificationsTabNavigatorParams = CommonNavigatorParams & {
|
||||
}
|
||||
|
||||
export type MyProfileTabNavigatorParams = CommonNavigatorParams & {
|
||||
- MyProfile: {name: 'me'; hideBackButton: true}
|
||||
+ MyProfile: { name: 'me'; hideBackButton: true }
|
||||
}
|
||||
|
||||
export type MessagesTabNavigatorParams = CommonNavigatorParams & {
|
||||
- Messages: {pushToConversation?: string; animation?: 'push' | 'pop'}
|
||||
+ Messages: { pushToConversation?: string; animation?: 'push' | 'pop' }
|
||||
}
|
||||
|
||||
export type FlatNavigatorParams = CommonNavigatorParams & {
|
||||
Home: undefined
|
||||
- Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
|
||||
+ Search: { q?: string; tab?: 'user' | 'profile' | 'feed' }
|
||||
Feeds: undefined
|
||||
Notifications: undefined
|
||||
- Messages: {pushToConversation?: string; animation?: 'push' | 'pop'}
|
||||
+ Messages: { pushToConversation?: string; animation?: 'push' | 'pop' }
|
||||
}
|
||||
|
||||
export type AllNavigatorParams = CommonNavigatorParams & {
|
||||
HomeTab: undefined
|
||||
Home: undefined
|
||||
SearchTab: undefined
|
||||
- Search: {q?: string; tab?: 'user' | 'profile' | 'feed'}
|
||||
+ Search: { q?: string; tab?: 'user' | 'profile' | 'feed' }
|
||||
Feeds: undefined
|
||||
NotificationsTab: undefined
|
||||
Notifications: undefined
|
||||
MyProfileTab: undefined
|
||||
MessagesTab: undefined
|
||||
- Messages: {animation?: 'push' | 'pop'}
|
||||
+ Messages: { animation?: 'push' | 'pop' }
|
||||
}
|
||||
|
||||
// NOTE
|
||||
@@ -149,7 +150,7 @@ export type State =
|
||||
| Omit<PartialState<NavigationState>, 'stale'>
|
||||
|
||||
export type RouteParams = Record<string, string>
|
||||
-export type MatchResult = {params: RouteParams}
|
||||
+export type MatchResult = { params: RouteParams }
|
||||
export type Route = {
|
||||
match: (path: string) => MatchResult | undefined
|
||||
build: (params?: Record<string, any>) => string
|
||||
diff --git a/src/routes.ts b/src/routes.ts
|
||||
index 1ed913bb2..3fe7041da 100644
|
||||
index 1ed913bb2..77ea6deca 100644
|
||||
--- a/src/routes.ts
|
||||
+++ b/src/routes.ts
|
||||
@@ -1,5 +1,5 @@
|
||||
-import {Router} from '#/lib/routes/router'
|
||||
-import {type FlatNavigatorParams} from './lib/routes/types'
|
||||
+import { Router } from '#/lib/routes/router'
|
||||
+import { type FlatNavigatorParams } from './lib/routes/types'
|
||||
|
||||
type AllNavigatableRoutes = Omit<
|
||||
FlatNavigatorParams,
|
||||
@@ -71,8 +71,9 @@ export const router = new Router<AllNavigatableRoutes>({
|
||||
@@ -71,8 +71,8 @@ export const router = new Router<AllNavigatableRoutes>({
|
||||
MiscellaneousNotificationSettings: '/settings/notifications/miscellaneous',
|
||||
// support
|
||||
Support: '/support',
|
||||
- PrivacyPolicy: '/support/privacy',
|
||||
- TermsOfService: '/support/tos',
|
||||
+ PrivacyPolicy: 'https://syu.is/about/support/privacy-policy',
|
||||
TermsOfService: '/support/tos',
|
||||
+ License: '/support/license',
|
||||
+ TermsOfService: 'https://syu.is/about/support/tos',
|
||||
CommunityGuidelines: '/support/community-guidelines',
|
||||
CopyrightPolicy: '/support/copyright',
|
||||
// hashtags
|
||||
|
||||
@@ -1,54 +1,11 @@
|
||||
diff --git a/src/view/com/auth/SplashScreen.tsx b/src/view/com/auth/SplashScreen.tsx
|
||||
index 3442d1bdf..034310a17 100644
|
||||
index 3442d1bdf..dd2d1fdfb 100644
|
||||
--- a/src/view/com/auth/SplashScreen.tsx
|
||||
+++ b/src/view/com/auth/SplashScreen.tsx
|
||||
@@ -1,18 +1,18 @@
|
||||
-import {View} from 'react-native'
|
||||
-import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'
|
||||
-import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
-import {msg, Trans} from '@lingui/macro'
|
||||
-import {useLingui} from '@lingui/react'
|
||||
+import { View } from 'react-native'
|
||||
+import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'
|
||||
+import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
+import { msg, Trans } from '@lingui/macro'
|
||||
+import { useLingui } from '@lingui/react'
|
||||
|
||||
-import {useHaptics} from '#/lib/haptics'
|
||||
-import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
-import {CenteredView} from '#/view/com/util/Views'
|
||||
-import {Logo} from '#/view/icons/Logo'
|
||||
-import {Logotype} from '#/view/icons/Logotype'
|
||||
-import {atoms as a, useTheme} from '#/alf'
|
||||
-import {AppLanguageDropdown} from '#/components/AppLanguageDropdown'
|
||||
-import {Button, ButtonText} from '#/components/Button'
|
||||
-import {Text} from '#/components/Typography'
|
||||
+import { useHaptics } from '#/lib/haptics'
|
||||
+import { ErrorBoundary } from '#/view/com/util/ErrorBoundary'
|
||||
+import { CenteredView } from '#/view/com/util/Views'
|
||||
+import { Logo } from '#/view/icons/Logo'
|
||||
+import { Logotype } from '#/view/icons/Logotype'
|
||||
+import { atoms as a, useTheme } from '#/alf'
|
||||
+import { AppLanguageDropdown } from '#/components/AppLanguageDropdown'
|
||||
+import { Button, ButtonText } from '#/components/Button'
|
||||
+import { Text } from '#/components/Typography'
|
||||
|
||||
export const SplashScreen = ({
|
||||
onPressSignin,
|
||||
@@ -22,7 +22,7 @@ export const SplashScreen = ({
|
||||
onPressCreateAccount: () => void
|
||||
}) => {
|
||||
const t = useTheme()
|
||||
- const {_} = useLingui()
|
||||
+ const { _ } = useLingui()
|
||||
|
||||
const playHaptic = useHaptics()
|
||||
const insets = useSafeAreaInsets()
|
||||
@@ -102,7 +102,18 @@ export const SplashScreen = ({
|
||||
@@ -102,6 +102,17 @@ export const SplashScreen = ({
|
||||
<AppLanguageDropdown />
|
||||
</View>
|
||||
</View>
|
||||
- <View style={{height: insets.bottom}} />
|
||||
+ <View
|
||||
+ style={[
|
||||
+ a.px_lg,
|
||||
@@ -60,7 +17,6 @@ index 3442d1bdf..034310a17 100644
|
||||
+ © syui
|
||||
+ </Text>
|
||||
+ </View>
|
||||
+ <View style={{ height: insets.bottom }} />
|
||||
<View style={{height: insets.bottom}} />
|
||||
</ErrorBoundary>
|
||||
</Animated.View>
|
||||
</CenteredView>
|
||||
|
||||
@@ -1,73 +1,7 @@
|
||||
diff --git a/src/screens/Settings/AboutSettings.tsx b/src/screens/Settings/AboutSettings.tsx
|
||||
index 6b8257b91..3daf2b192 100644
|
||||
index 6b8257b91..e21b4900d 100644
|
||||
--- a/src/screens/Settings/AboutSettings.tsx
|
||||
+++ b/src/screens/Settings/AboutSettings.tsx
|
||||
@@ -1,40 +1,40 @@
|
||||
-import {useMemo} from 'react'
|
||||
-import {Platform} from 'react-native'
|
||||
-import {setStringAsync} from 'expo-clipboard'
|
||||
+import { useMemo } from 'react'
|
||||
+import { Platform } from 'react-native'
|
||||
+import { setStringAsync } from 'expo-clipboard'
|
||||
import * as FileSystem from 'expo-file-system/legacy'
|
||||
-import {Image} from 'expo-image'
|
||||
-import {msg, Trans} from '@lingui/macro'
|
||||
-import {useLingui} from '@lingui/react'
|
||||
-import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
-import {useMutation} from '@tanstack/react-query'
|
||||
-import {Statsig} from 'statsig-react-native-expo'
|
||||
+import { Image } from 'expo-image'
|
||||
+import { msg, Trans } from '@lingui/macro'
|
||||
+import { useLingui } from '@lingui/react'
|
||||
+import { type NativeStackScreenProps } from '@react-navigation/native-stack'
|
||||
+import { useMutation } from '@tanstack/react-query'
|
||||
+import { Statsig } from 'statsig-react-native-expo'
|
||||
|
||||
-import {STATUS_PAGE_URL} from '#/lib/constants'
|
||||
-import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
-import {isAndroid, isIOS, isNative} from '#/platform/detection'
|
||||
+import { STATUS_PAGE_URL } from '#/lib/constants'
|
||||
+import { type CommonNavigatorParams } from '#/lib/routes/types'
|
||||
+import { isAndroid, isIOS, isNative } from '#/platform/detection'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as SettingsList from '#/screens/Settings/components/SettingsList'
|
||||
-import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom'
|
||||
-import {BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon} from '#/components/icons/BroomSparkle'
|
||||
-import {CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon} from '#/components/icons/CodeLines'
|
||||
-import {Globe_Stroke2_Corner0_Rounded as GlobeIcon} from '#/components/icons/Globe'
|
||||
-import {Newspaper_Stroke2_Corner2_Rounded as NewspaperIcon} from '#/components/icons/Newspaper'
|
||||
-import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench'
|
||||
+import { Atom_Stroke2_Corner0_Rounded as AtomIcon } from '#/components/icons/Atom'
|
||||
+import { BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon } from '#/components/icons/BroomSparkle'
|
||||
+import { CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon } from '#/components/icons/CodeLines'
|
||||
+import { Globe_Stroke2_Corner0_Rounded as GlobeIcon } from '#/components/icons/Globe'
|
||||
+import { Newspaper_Stroke2_Corner2_Rounded as NewspaperIcon } from '#/components/icons/Newspaper'
|
||||
+import { Wrench_Stroke2_Corner2_Rounded as WrenchIcon } from '#/components/icons/Wrench'
|
||||
import * as Layout from '#/components/Layout'
|
||||
-import {Loader} from '#/components/Loader'
|
||||
+import { Loader } from '#/components/Loader'
|
||||
import * as env from '#/env'
|
||||
-import {useDemoMode} from '#/storage/hooks/demo-mode'
|
||||
-import {useDevMode} from '#/storage/hooks/dev-mode'
|
||||
-import {OTAInfo} from './components/OTAInfo'
|
||||
+import { useDemoMode } from '#/storage/hooks/demo-mode'
|
||||
+import { useDevMode } from '#/storage/hooks/dev-mode'
|
||||
+import { OTAInfo } from './components/OTAInfo'
|
||||
|
||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'AboutSettings'>
|
||||
-export function AboutSettingsScreen({}: Props) {
|
||||
- const {_, i18n} = useLingui()
|
||||
+export function AboutSettingsScreen({ }: Props) {
|
||||
+ const { _, i18n } = useLingui()
|
||||
const [devModeEnabled, setDevModeEnabled] = useDevMode()
|
||||
const [demoModeEnabled, setDemoModeEnabled] = useDemoMode()
|
||||
const stableID = useMemo(() => Statsig.getStableID(), [])
|
||||
|
||||
- const {mutate: onClearImageCache, isPending: isClearingImageCache} =
|
||||
+ const { mutate: onClearImageCache, isPending: isClearingImageCache } =
|
||||
useMutation({
|
||||
mutationFn: async () => {
|
||||
const freeSpaceBefore = await FileSystem.getFreeDiskStorageAsync()
|
||||
@@ -80,7 +80,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
<Layout.Content>
|
||||
<SettingsList.Container>
|
||||
@@ -100,40 +34,3 @@ index 6b8257b91..3daf2b192 100644
|
||||
<SettingsList.LinkItem
|
||||
to={STATUS_PAGE_URL}
|
||||
label={_(msg`Status Page`)}>
|
||||
@@ -131,17 +139,17 @@ export function AboutSettingsScreen({}: Props) {
|
||||
Toast.show(
|
||||
newDevModeEnabled
|
||||
? _(
|
||||
- msg({
|
||||
- message: 'Developer mode enabled',
|
||||
- context: 'toast',
|
||||
- }),
|
||||
- )
|
||||
+ msg({
|
||||
+ message: 'Developer mode enabled',
|
||||
+ context: 'toast',
|
||||
+ }),
|
||||
+ )
|
||||
: _(
|
||||
- msg({
|
||||
- message: 'Developer mode disabled',
|
||||
- context: 'toast',
|
||||
- }),
|
||||
- ),
|
||||
+ msg({
|
||||
+ message: 'Developer mode disabled',
|
||||
+ context: 'toast',
|
||||
+ }),
|
||||
+ ),
|
||||
)
|
||||
}}
|
||||
onPress={() => {
|
||||
@@ -166,7 +174,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
setDemoModeEnabled(newDemoModeEnabled)
|
||||
Toast.show(
|
||||
'Demo mode ' +
|
||||
- (newDemoModeEnabled ? 'enabled' : 'disabled'),
|
||||
+ (newDemoModeEnabled ? 'enabled' : 'disabled'),
|
||||
)
|
||||
}}
|
||||
label={
|
||||
|
||||
@@ -1,72 +1,7 @@
|
||||
diff --git a/src/ageAssurance/index.tsx b/src/ageAssurance/index.tsx
|
||||
index 9a0a9c9d5..5da399795 100644
|
||||
index 9a0a9c9d5..fa233c8ab 100644
|
||||
--- a/src/ageAssurance/index.tsx
|
||||
+++ b/src/ageAssurance/index.tsx
|
||||
@@ -1,10 +1,10 @@
|
||||
-import {createContext, useCallback, useContext, useEffect, useMemo} from 'react'
|
||||
+import { createContext, useCallback, useContext, useEffect, useMemo } from 'react'
|
||||
|
||||
-import {useGetAndRegisterPushToken} from '#/lib/notifications/notifications'
|
||||
-import {Provider as RedirectOverlayProvider} from '#/ageAssurance/components/RedirectOverlay'
|
||||
-import {AgeAssuranceDataProvider} from '#/ageAssurance/data'
|
||||
-import {useAgeAssuranceDataContext} from '#/ageAssurance/data'
|
||||
-import {logger} from '#/ageAssurance/logger'
|
||||
+import { useGetAndRegisterPushToken } from '#/lib/notifications/notifications'
|
||||
+import { Provider as RedirectOverlayProvider } from '#/ageAssurance/components/RedirectOverlay'
|
||||
+import { AgeAssuranceDataProvider } from '#/ageAssurance/data'
|
||||
+import { useAgeAssuranceDataContext } from '#/ageAssurance/data'
|
||||
+import { logger } from '#/ageAssurance/logger'
|
||||
import {
|
||||
useAgeAssuranceState,
|
||||
useOnAgeAssuranceAccessUpdate,
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
type AgeAssuranceState,
|
||||
AgeAssuranceStatus,
|
||||
} from '#/ageAssurance/types'
|
||||
-import {isUserUnderAdultAge} from '#/ageAssurance/util'
|
||||
+import { isUserUnderAdultAge } from '#/ageAssurance/util'
|
||||
|
||||
export {
|
||||
prefetchConfig as prefetchAgeAssuranceConfig,
|
||||
@@ -23,7 +23,7 @@ export {
|
||||
usePatchOtherRequiredData as usePatchAgeAssuranceOtherRequiredData,
|
||||
usePatchServerState as usePatchAgeAssuranceServerState,
|
||||
} from '#/ageAssurance/data'
|
||||
-export {logger} from '#/ageAssurance/logger'
|
||||
+export { logger } from '#/ageAssurance/logger'
|
||||
|
||||
const AgeAssuranceStateContext = createContext<{
|
||||
Access: typeof AgeAssuranceAccess
|
||||
@@ -56,7 +56,7 @@ export function useAgeAssurance() {
|
||||
return useContext(AgeAssuranceStateContext)
|
||||
}
|
||||
|
||||
-export function Provider({children}: {children: React.ReactNode}) {
|
||||
+export function Provider({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<AgeAssuranceDataProvider>
|
||||
<InnerProvider>
|
||||
@@ -66,9 +66,9 @@ export function Provider({children}: {children: React.ReactNode}) {
|
||||
)
|
||||
}
|
||||
|
||||
-function InnerProvider({children}: {children: React.ReactNode}) {
|
||||
+function InnerProvider({ children }: { children: React.ReactNode }) {
|
||||
const state = useAgeAssuranceState()
|
||||
- const {data} = useAgeAssuranceDataContext()
|
||||
+ const { data } = useAgeAssuranceDataContext()
|
||||
const getAndRegisterPushToken = useGetAndRegisterPushToken()
|
||||
|
||||
const handleAccessUpdate = useCallback(
|
||||
@@ -82,7 +82,7 @@ function InnerProvider({children}: {children: React.ReactNode}) {
|
||||
useOnAgeAssuranceAccessUpdate(handleAccessUpdate)
|
||||
|
||||
useEffect(() => {
|
||||
- logger.debug(`useAgeAssuranceState`, {state})
|
||||
+ logger.debug(`useAgeAssuranceState`, { state })
|
||||
}, [state])
|
||||
|
||||
return (
|
||||
@@ -97,7 +97,10 @@ function InnerProvider({children}: {children: React.ReactNode}) {
|
||||
return {
|
||||
Access: AgeAssuranceAccess,
|
||||
|
||||
@@ -1,76 +1,50 @@
|
||||
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
|
||||
index e058e2883..1d6bc4f45 100644
|
||||
index e058e2883..03d7dc990 100644
|
||||
--- a/src/view/screens/Home.tsx
|
||||
+++ b/src/view/screens/Home.tsx
|
||||
@@ -1,342 +1,139 @@
|
||||
@@ -1,23 +1,16 @@
|
||||
import React from 'react'
|
||||
-import {ActivityIndicator, StyleSheet} from 'react-native'
|
||||
-import {useFocusEffect} from '@react-navigation/native'
|
||||
import {ActivityIndicator, StyleSheet} from 'react-native'
|
||||
import {useFocusEffect} from '@react-navigation/native'
|
||||
-
|
||||
-import {PROD_DEFAULT_FEED} from '#/lib/constants'
|
||||
-import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
-import {useOTAUpdates} from '#/lib/hooks/useOTAUpdates'
|
||||
-import {useSetTitle} from '#/lib/hooks/useSetTitle'
|
||||
-import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
||||
import {PROD_DEFAULT_FEED} from '#/lib/constants'
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {useOTAUpdates} from '#/lib/hooks/useOTAUpdates'
|
||||
import {useSetTitle} from '#/lib/hooks/useSetTitle'
|
||||
import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
||||
-import {
|
||||
- type HomeTabNavigatorParams,
|
||||
- type NativeStackScreenProps,
|
||||
-} from '#/lib/routes/types'
|
||||
-import {logEvent} from '#/lib/statsig/statsig'
|
||||
-import {isWeb} from '#/platform/detection'
|
||||
-import {emitSoftReset} from '#/state/events'
|
||||
+import {type HomeTabNavigatorParams, type NativeStackScreenProps} from '#/lib/routes/types'
|
||||
import {logEvent} from '#/lib/statsig/statsig'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {emitSoftReset} from '#/state/events'
|
||||
-import {
|
||||
- type SavedFeedSourceInfo,
|
||||
- usePinnedFeedsInfos,
|
||||
-} from '#/state/queries/feed'
|
||||
-import {type FeedDescriptor, type FeedParams} from '#/state/queries/post-feed'
|
||||
-import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
-import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types'
|
||||
-import {useSession} from '#/state/session'
|
||||
-import {useSetMinimalShellMode} from '#/state/shell'
|
||||
-import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
-import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed'
|
||||
-import {FeedPage} from '#/view/com/feeds/FeedPage'
|
||||
-import {HomeHeader} from '#/view/com/home/HomeHeader'
|
||||
+import {type SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed'
|
||||
import {type FeedDescriptor, type FeedParams} from '#/state/queries/post-feed'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types'
|
||||
@@ -27,11 +20,7 @@ import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed'
|
||||
import {FeedPage} from '#/view/com/feeds/FeedPage'
|
||||
import {HomeHeader} from '#/view/com/home/HomeHeader'
|
||||
-import {
|
||||
- Pager,
|
||||
- type PagerRef,
|
||||
- type RenderTabBarFnProps,
|
||||
-} from '#/view/com/pager/Pager'
|
||||
-import {CustomFeedEmptyState} from '#/view/com/posts/CustomFeedEmptyState'
|
||||
-import {FollowingEmptyState} from '#/view/com/posts/FollowingEmptyState'
|
||||
-import {FollowingEndOfFeed} from '#/view/com/posts/FollowingEndOfFeed'
|
||||
-import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned'
|
||||
+import { ActivityIndicator, StyleSheet } from 'react-native'
|
||||
+import { useFocusEffect } from '@react-navigation/native'
|
||||
+import { PROD_DEFAULT_FEED } from '#/lib/constants'
|
||||
+import { useNonReactiveCallback } from '#/lib/hooks/useNonReactiveCallback'
|
||||
+import { useOTAUpdates } from '#/lib/hooks/useOTAUpdates'
|
||||
+import { useSetTitle } from '#/lib/hooks/useSetTitle'
|
||||
+import { useRequestNotificationsPermission } from '#/lib/notifications/notifications'
|
||||
+import { type HomeTabNavigatorParams, type NativeStackScreenProps } from '#/lib/routes/types'
|
||||
+import { logEvent } from '#/lib/statsig/statsig'
|
||||
+import { isWeb } from '#/platform/detection'
|
||||
+import { emitSoftReset } from '#/state/events'
|
||||
+import { type SavedFeedSourceInfo, usePinnedFeedsInfos } from '#/state/queries/feed'
|
||||
+import { type FeedDescriptor, type FeedParams } from '#/state/queries/post-feed'
|
||||
+import { usePreferencesQuery } from '#/state/queries/preferences'
|
||||
+import { type UsePreferencesQueryResponse } from '#/state/queries/preferences/types'
|
||||
+import { useSession } from '#/state/session'
|
||||
+import { useSetMinimalShellMode } from '#/state/shell'
|
||||
+import { useLoggedOutViewControls } from '#/state/shell/logged-out'
|
||||
+import { useSelectedFeed, useSetSelectedFeed } from '#/state/shell/selected-feed'
|
||||
+import { FeedPage } from '#/view/com/feeds/FeedPage'
|
||||
+import { HomeHeader } from '#/view/com/home/HomeHeader'
|
||||
+import { Pager, type PagerRef, type RenderTabBarFnProps } from '#/view/com/pager/Pager'
|
||||
+import { CustomFeedEmptyState } from '#/view/com/posts/CustomFeedEmptyState'
|
||||
+import { FollowingEmptyState } from '#/view/com/posts/FollowingEmptyState'
|
||||
+import { FollowingEndOfFeed } from '#/view/com/posts/FollowingEndOfFeed'
|
||||
+import { NoFeedsPinned } from '#/screens/Home/NoFeedsPinned'
|
||||
+import {Pager, type PagerRef, type RenderTabBarFnProps} from '#/view/com/pager/Pager'
|
||||
import {CustomFeedEmptyState} from '#/view/com/posts/CustomFeedEmptyState'
|
||||
import {FollowingEmptyState} from '#/view/com/posts/FollowingEmptyState'
|
||||
import {FollowingEndOfFeed} from '#/view/com/posts/FollowingEndOfFeed'
|
||||
@@ -39,97 +28,67 @@ import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned'
|
||||
import * as Layout from '#/components/Layout'
|
||||
-import {useDemoMode} from '#/storage/hooks/demo-mode'
|
||||
+import { useDemoMode } from '#/storage/hooks/demo-mode'
|
||||
+
|
||||
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
||||
|
||||
+const DEFAULT_PINNED_FEEDS = [{
|
||||
+ feedDescriptor: 'following',
|
||||
+ displayName: 'Following',
|
||||
@@ -79,18 +53,15 @@ index e058e2883..1d6bc4f45 100644
|
||||
+ savedFeed: undefined,
|
||||
+ pinned: true,
|
||||
+}]
|
||||
|
||||
+
|
||||
type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home' | 'Start'>
|
||||
export function HomeScreen(props: Props) {
|
||||
- const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
- const {data: preferences} = usePreferencesQuery()
|
||||
- const {currentAccount} = useSession()
|
||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
const {data: preferences} = usePreferencesQuery()
|
||||
const {currentAccount} = useSession()
|
||||
- const {data: pinnedFeedInfos, isLoading: isPinnedFeedsLoading} =
|
||||
- usePinnedFeedsInfos()
|
||||
+ const { setShowLoggedOut } = useLoggedOutViewControls()
|
||||
+ const { data: preferences } = usePreferencesQuery()
|
||||
+ const { currentAccount } = useSession()
|
||||
+ const { data: pinnedFeedInfos } = usePinnedFeedsInfos()
|
||||
+ const {data: pinnedFeedInfos} = usePinnedFeedsInfos()
|
||||
+
|
||||
+ const safePreferences = preferences || { feedViewPrefs: { lab_mergeFeedEnabled: false }, savedFeeds: [] } as any
|
||||
+ const safePinnedFeedInfos = [{
|
||||
@@ -175,7 +146,7 @@ index e058e2883..1d6bc4f45 100644
|
||||
- )
|
||||
- const maybeRawSelectedFeed: FeedDescriptor | undefined =
|
||||
- useSelectedFeed() ?? allFeeds[0]
|
||||
+function HomeScreenReady({ preferences, pinnedFeedInfos }: any) {
|
||||
+function HomeScreenReady({preferences, pinnedFeedInfos}: any) {
|
||||
+ const allFeeds = React.useMemo(() => pinnedFeedInfos.map(f => f.feedDescriptor), [pinnedFeedInfos])
|
||||
+ const maybeRawSelectedFeed = useSelectedFeed() ?? allFeeds[0]
|
||||
const setSelectedFeed = useSetSelectedFeed()
|
||||
@@ -184,7 +155,8 @@ index e058e2883..1d6bc4f45 100644
|
||||
- const maybeSelectedFeed: FeedDescriptor | undefined = allFeeds[selectedIndex]
|
||||
+ const maybeSelectedFeed = allFeeds[selectedIndex]
|
||||
const requestNotificationsPermission = useRequestNotificationsPermission()
|
||||
|
||||
-
|
||||
+
|
||||
useSetTitle(pinnedFeedInfos[selectedIndex]?.displayName)
|
||||
useOTAUpdates()
|
||||
-
|
||||
@@ -202,11 +174,9 @@ index e058e2883..1d6bc4f45 100644
|
||||
if (selectedIndex !== lastPagerReportedIndexRef.current) {
|
||||
lastPagerReportedIndexRef.current = selectedIndex
|
||||
pagerRef.current?.setPage(selectedIndex)
|
||||
}
|
||||
}, [selectedIndex])
|
||||
@@ -138,205 +97,43 @@ function HomeScreenReady({
|
||||
|
||||
- const {hasSession} = useSession()
|
||||
+ const { hasSession } = useSession()
|
||||
const {hasSession} = useSession()
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
- useFocusEffect(
|
||||
- React.useCallback(() => {
|
||||
@@ -226,8 +196,7 @@ index e058e2883..1d6bc4f45 100644
|
||||
- }
|
||||
- }),
|
||||
- )
|
||||
+ useFocusEffect(React.useCallback(() => { setMinimalShellMode(false) }, [setMinimalShellMode]))
|
||||
|
||||
-
|
||||
- const onPageSelected = React.useCallback(
|
||||
- (index: number) => {
|
||||
- setMinimalShellMode(false)
|
||||
@@ -248,13 +217,7 @@ index e058e2883..1d6bc4f45 100644
|
||||
- },
|
||||
- [setSelectedFeed, setMinimalShellMode, allFeeds],
|
||||
- )
|
||||
+ const onPageSelected = React.useCallback((index) => {
|
||||
+ setMinimalShellMode(false)
|
||||
+ const maybeFeed = allFeeds[index]
|
||||
+ lastPagerReportedIndexRef.current = index
|
||||
+ setSelectedFeed(maybeFeed)
|
||||
+ }, [setSelectedFeed, setMinimalShellMode, allFeeds])
|
||||
|
||||
-
|
||||
- const onPressSelected = React.useCallback(() => {
|
||||
- emitSoftReset()
|
||||
- }, [])
|
||||
@@ -268,6 +231,15 @@ index e058e2883..1d6bc4f45 100644
|
||||
- },
|
||||
- [setMinimalShellMode],
|
||||
- )
|
||||
+ useFocusEffect(React.useCallback(() => { setMinimalShellMode(false) }, [setMinimalShellMode]))
|
||||
+
|
||||
+ const onPageSelected = React.useCallback((index) => {
|
||||
+ setMinimalShellMode(false)
|
||||
+ const maybeFeed = allFeeds[index]
|
||||
+ lastPagerReportedIndexRef.current = index
|
||||
+ setSelectedFeed(maybeFeed)
|
||||
+ }, [setSelectedFeed, setMinimalShellMode, allFeeds])
|
||||
+
|
||||
+ const onPressSelected = React.useCallback(() => { emitSoftReset() }, [])
|
||||
+ const onPageScrollStateChanged = React.useCallback((state) => {
|
||||
+ 'worklet'
|
||||
@@ -362,8 +334,22 @@ index e058e2883..1d6bc4f45 100644
|
||||
- renderTabBar={renderTabBar}>
|
||||
- {pinnedFeedInfos.length ? (
|
||||
- pinnedFeedInfos.map((feedInfo, index) => {
|
||||
- const feed = feedInfo.feedDescriptor
|
||||
- if (feed === 'following') {
|
||||
+ const renderTabBar = React.useCallback((props) => {
|
||||
+ return <HomeHeader key="FEEDS_TAB_BAR" {...props} testID="homeScreenFeedTabs" onPressSelected={onPressSelected} feeds={pinnedFeedInfos} />
|
||||
+ }, [onPressSelected, pinnedFeedInfos])
|
||||
+
|
||||
+ const renderFollowingEmptyState = React.useCallback(() => <FollowingEmptyState />, [])
|
||||
+ const renderCustomFeedEmptyState = React.useCallback(() => <CustomFeedEmptyState />, [])
|
||||
+
|
||||
+ const homeFeedParams = React.useMemo(() => ({
|
||||
+ mergeFeedEnabled: false, mergeFeedSources: []
|
||||
+ }), [preferences])
|
||||
+
|
||||
+ return (
|
||||
+ <Pager ref={pagerRef} testID="homeScreen" initialPage={selectedIndex} onPageSelected={onPageSelected} onPageScrollStateChanged={onPageScrollStateChanged} renderTabBar={renderTabBar}>
|
||||
+ {pinnedFeedInfos.map((feedInfo, index) => {
|
||||
const feed = feedInfo.feedDescriptor
|
||||
if (feed === 'following') {
|
||||
- return (
|
||||
- <FeedPage
|
||||
- key={feed}
|
||||
@@ -377,7 +363,8 @@ index e058e2883..1d6bc4f45 100644
|
||||
- feedInfo={feedInfo}
|
||||
- />
|
||||
- )
|
||||
- }
|
||||
+ return <FeedPage key={feed} testID="followingFeedPage" isPageFocused={maybeSelectedFeed === feed} isPageAdjacent={Math.abs(selectedIndex - index) === 1} feed={feed} feedParams={homeFeedParams} renderEmptyState={renderFollowingEmptyState} renderEndOfFeed={FollowingEndOfFeed} feedInfo={feedInfo} />
|
||||
}
|
||||
- const savedFeedConfig = feedInfo.savedFeed
|
||||
- return (
|
||||
- <FeedPage
|
||||
@@ -410,25 +397,7 @@ index e058e2883..1d6bc4f45 100644
|
||||
- renderEmptyState={renderCustomFeedEmptyState}
|
||||
- feedInfo={pinnedFeedInfos[0]}
|
||||
- />
|
||||
+ const renderTabBar = React.useCallback((props) => {
|
||||
+ return <HomeHeader key="FEEDS_TAB_BAR" {...props} testID="homeScreenFeedTabs" onPressSelected={onPressSelected} feeds={pinnedFeedInfos} />
|
||||
+ }, [onPressSelected, pinnedFeedInfos])
|
||||
+
|
||||
+ const renderFollowingEmptyState = React.useCallback(() => <FollowingEmptyState />, [])
|
||||
+ const renderCustomFeedEmptyState = React.useCallback(() => <CustomFeedEmptyState />, [])
|
||||
+
|
||||
+ const homeFeedParams = React.useMemo(() => ({
|
||||
+ mergeFeedEnabled: false, mergeFeedSources: []
|
||||
+ }), [preferences])
|
||||
+
|
||||
+ return (
|
||||
+ <Pager ref={pagerRef} testID="homeScreen" initialPage={selectedIndex} onPageSelected={onPageSelected} onPageScrollStateChanged={onPageScrollStateChanged} renderTabBar={renderTabBar}>
|
||||
+ {pinnedFeedInfos.map((feedInfo, index) => {
|
||||
+ const feed = feedInfo.feedDescriptor
|
||||
+ if (feed === 'following') {
|
||||
+ return <FeedPage key={feed} testID="followingFeedPage" isPageFocused={maybeSelectedFeed === feed} isPageAdjacent={Math.abs(selectedIndex - index) === 1} feed={feed} feedParams={homeFeedParams} renderEmptyState={renderFollowingEmptyState} renderEndOfFeed={FollowingEndOfFeed} feedInfo={feedInfo} />
|
||||
+ }
|
||||
+ return <FeedPage key={feed} testID="customFeedPage" isPageFocused={maybeSelectedFeed === feed} isPageAdjacent={Math.abs(selectedIndex - index) === 1} feed={feed} renderEmptyState={renderCustomFeedEmptyState} savedFeedConfig={feedInfo.savedFeed} feedInfo={feedInfo} />
|
||||
+ return <FeedPage key={feed} testID="customFeedPage" isPageFocused={maybeSelectedFeed === feed} isPageAdjacent={Math.abs(selectedIndex - index) === 1} feed={feed} renderEmptyState={renderCustomFeedEmptyState} savedFeedConfig={feedInfo.savedFeed} feedInfo={feedInfo} />
|
||||
+ })}
|
||||
</Pager>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user