fix social-app patch
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
diff --git a/app.config.js b/app.config.js
|
|
||||||
index ca417206b..0807d7cd3 100644
|
|
||||||
--- a/app.config.js
|
--- a/app.config.js
|
||||||
+++ b/app.config.js
|
+++ b/app.config.js
|
||||||
@@ -18,10 +18,7 @@ module.exports = function (_config) {
|
@@ -23,10 +23,7 @@
|
||||||
const IS_DEV = !IS_TESTFLIGHT || !IS_PRODUCTION
|
const IS_DEV = !IS_TESTFLIGHT && !IS_PRODUCTION
|
||||||
|
|
||||||
const ASSOCIATED_DOMAINS = [
|
const ASSOCIATED_DOMAINS = [
|
||||||
- 'applinks:bsky.app',
|
- 'applinks:bsky.app',
|
||||||
@@ -14,7 +12,7 @@ index ca417206b..0807d7cd3 100644
|
|||||||
// When testing local services, enter an ngrok (et al) domain here. It must use a standard HTTP/HTTPS port.
|
// When testing local services, enter an ngrok (et al) domain here. It must use a standard HTTP/HTTPS port.
|
||||||
...(IS_DEV || IS_TESTFLIGHT ? [] : []),
|
...(IS_DEV || IS_TESTFLIGHT ? [] : []),
|
||||||
]
|
]
|
||||||
@@ -33,27 +30,25 @@ module.exports = function (_config) {
|
@@ -38,27 +35,25 @@
|
||||||
return {
|
return {
|
||||||
expo: {
|
expo: {
|
||||||
version: VERSION,
|
version: VERSION,
|
||||||
@@ -49,16 +47,16 @@ index ca417206b..0807d7cd3 100644
|
|||||||
infoPlist: {
|
infoPlist: {
|
||||||
UIBackgroundModes: ['remote-notification'],
|
UIBackgroundModes: ['remote-notification'],
|
||||||
NSCameraUsageDescription:
|
NSCameraUsageDescription:
|
||||||
@@ -113,7 +108,7 @@ module.exports = function (_config) {
|
@@ -118,7 +113,7 @@
|
||||||
entitlements: {
|
entitlements: {
|
||||||
'com.apple.developer.kernel.increased-memory-limit': true,
|
'com.apple.developer.kernel.increased-memory-limit': true,
|
||||||
'com.apple.developer.kernel.extended-virtual-addressing': true,
|
'com.apple.developer.kernel.extended-virtual-addressing': true,
|
||||||
- 'com.apple.security.application-groups': 'group.app.bsky',
|
- 'com.apple.security.application-groups': 'group.app.bsky',
|
||||||
+ 'com.apple.security.application-groups': 'group.ai.syui.at',
|
+ 'com.apple.security.application-groups': 'group.ai.syui.at',
|
||||||
|
// 'com.apple.developer.device-information.user-assigned-device-name': true,
|
||||||
},
|
},
|
||||||
privacyManifests: {
|
privacyManifests: {
|
||||||
NSPrivacyCollectedDataTypes: [
|
@@ -181,14 +176,14 @@
|
||||||
@@ -175,14 +170,14 @@ module.exports = function (_config) {
|
|
||||||
barStyle: 'light-content',
|
barStyle: 'light-content',
|
||||||
},
|
},
|
||||||
android: {
|
android: {
|
||||||
@@ -75,38 +73,16 @@ index ca417206b..0807d7cd3 100644
|
|||||||
intentFilters: [
|
intentFilters: [
|
||||||
{
|
{
|
||||||
action: 'VIEW',
|
action: 'VIEW',
|
||||||
@@ -190,7 +185,7 @@ module.exports = function (_config) {
|
@@ -196,7 +191,7 @@
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
scheme: 'https',
|
scheme: 'https',
|
||||||
- host: 'bsky.app',
|
- host: 'bsky.app',
|
||||||
+ host: 'syu.is',
|
+ host: 'syu.is',
|
||||||
},
|
},
|
||||||
IS_DEV && {
|
...(IS_DEV
|
||||||
scheme: 'http',
|
? [
|
||||||
@@ -213,9 +208,9 @@ module.exports = function (_config) {
|
@@ -280,7 +275,6 @@
|
||||||
: undefined,
|
|
||||||
codeSigningMetadata: UPDATES_ENABLED
|
|
||||||
? {
|
|
||||||
- keyid: 'main',
|
|
||||||
- alg: 'rsa-v1_5-sha256',
|
|
||||||
- }
|
|
||||||
+ keyid: 'main',
|
|
||||||
+ alg: 'rsa-v1_5-sha256',
|
|
||||||
+ }
|
|
||||||
: undefined,
|
|
||||||
checkAutomatically: 'NEVER',
|
|
||||||
},
|
|
||||||
@@ -225,7 +220,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',
|
|
||||||
@@ -265,7 +260,6 @@ module.exports = function (_config) {
|
|
||||||
networkInstrumentation: true,
|
networkInstrumentation: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -114,7 +90,7 @@ index ca417206b..0807d7cd3 100644
|
|||||||
'./plugins/withGradleJVMHeapSizeIncrease.js',
|
'./plugins/withGradleJVMHeapSizeIncrease.js',
|
||||||
'./plugins/withAndroidManifestLargeHeapPlugin.js',
|
'./plugins/withAndroidManifestLargeHeapPlugin.js',
|
||||||
'./plugins/withAndroidManifestFCMIconPlugin.js',
|
'./plugins/withAndroidManifestFCMIconPlugin.js',
|
||||||
@@ -273,8 +267,6 @@ module.exports = function (_config) {
|
@@ -288,8 +282,6 @@
|
||||||
'./plugins/withAndroidStylesAccentColorPlugin.js',
|
'./plugins/withAndroidStylesAccentColorPlugin.js',
|
||||||
'./plugins/withAndroidDayNightThemePlugin.js',
|
'./plugins/withAndroidDayNightThemePlugin.js',
|
||||||
'./plugins/withAndroidNoJitpackPlugin.js',
|
'./plugins/withAndroidNoJitpackPlugin.js',
|
||||||
@@ -123,16 +99,7 @@ index ca417206b..0807d7cd3 100644
|
|||||||
[
|
[
|
||||||
'expo-font',
|
'expo-font',
|
||||||
{
|
{
|
||||||
@@ -387,7 +379,7 @@ module.exports = function (_config) {
|
@@ -417,30 +409,7 @@
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
- ['expo-screen-orientation', {initialOrientation: 'PORTRAIT_UP'}],
|
|
||||||
+ ['expo-screen-orientation', { initialOrientation: 'PORTRAIT_UP' }],
|
|
||||||
['expo-location'],
|
|
||||||
[
|
|
||||||
'expo-contacts',
|
|
||||||
@@ -402,30 +394,7 @@ module.exports = function (_config) {
|
|
||||||
build: {
|
build: {
|
||||||
experimental: {
|
experimental: {
|
||||||
ios: {
|
ios: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ diff --git a/src/screens/Settings/AboutSettings.tsx b/src/screens/Settings/About
|
|||||||
index 6b8257b91..48ba7909e 100644
|
index 6b8257b91..48ba7909e 100644
|
||||||
--- a/src/screens/Settings/AboutSettings.tsx
|
--- a/src/screens/Settings/AboutSettings.tsx
|
||||||
+++ b/src/screens/Settings/AboutSettings.tsx
|
+++ b/src/screens/Settings/AboutSettings.tsx
|
||||||
@@ -80,7 +80,7 @@ export function AboutSettingsScreen({}: Props) {
|
@@ -78,14 +78,14 @@ export function AboutSettingsScreen({}: Props) {
|
||||||
<Layout.Content>
|
<Layout.Content>
|
||||||
<SettingsList.Container>
|
<SettingsList.Container>
|
||||||
<SettingsList.LinkItem
|
<SettingsList.LinkItem
|
||||||
@@ -11,7 +11,7 @@ index 6b8257b91..48ba7909e 100644
|
|||||||
label={_(msg`Terms of Service`)}>
|
label={_(msg`Terms of Service`)}>
|
||||||
<SettingsList.ItemIcon icon={NewspaperIcon} />
|
<SettingsList.ItemIcon icon={NewspaperIcon} />
|
||||||
<SettingsList.ItemText>
|
<SettingsList.ItemText>
|
||||||
@@ -88,7 +88,7 @@ export function AboutSettingsScreen({}: Props) {
|
<Trans>Terms of Service</Trans>
|
||||||
</SettingsList.ItemText>
|
</SettingsList.ItemText>
|
||||||
</SettingsList.LinkItem>
|
</SettingsList.LinkItem>
|
||||||
<SettingsList.LinkItem
|
<SettingsList.LinkItem
|
||||||
@@ -24,7 +24,7 @@ diff --git a/src/screens/Takendown.tsx b/src/screens/Takendown.tsx
|
|||||||
index 77f219e55..53f5e0cc0 100644
|
index 77f219e55..53f5e0cc0 100644
|
||||||
--- a/src/screens/Takendown.tsx
|
--- a/src/screens/Takendown.tsx
|
||||||
+++ b/src/screens/Takendown.tsx
|
+++ b/src/screens/Takendown.tsx
|
||||||
@@ -217,10 +217,10 @@ export function Takendown() {
|
@@ -214,10 +214,10 @@ export function Takendown() {
|
||||||
<Trans>
|
<Trans>
|
||||||
Your account was found to be in violation of the{' '}
|
Your account was found to be in violation of the{' '}
|
||||||
<SimpleInlineLinkText
|
<SimpleInlineLinkText
|
||||||
@@ -38,437 +38,6 @@ index 77f219e55..53f5e0cc0 100644
|
|||||||
</SimpleInlineLinkText>
|
</SimpleInlineLinkText>
|
||||||
. You have been sent an email outlining the specific violation
|
. You have been sent an email outlining the specific violation
|
||||||
and suspension period, if applicable. You can appeal this
|
and suspension period, if applicable. You can appeal this
|
||||||
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
|
|
||||||
index e058e2883..8daf41089 100644
|
|
||||||
--- a/src/view/screens/Home.tsx
|
|
||||||
+++ b/src/view/screens/Home.tsx
|
|
||||||
@@ -1,23 +1,16 @@
|
|
||||||
import React from 'react'
|
|
||||||
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 {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 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 {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,90 @@ import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned'
|
|
||||||
import * as Layout from '#/components/Layout'
|
|
||||||
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
|
||||||
|
|
||||||
+const SYU_IS_FEED_URI = 'at://did:plc:6qyecktefllvenje24fcxnie/app.bsky.feed.generator/app'
|
|
||||||
+
|
|
||||||
+const DEFAULT_PINNED_FEEDS: any[] = [{
|
|
||||||
+ feedDescriptor: 'following',
|
|
||||||
+ displayName: 'Following',
|
|
||||||
+ id: 'following',
|
|
||||||
+ uri: 'following',
|
|
||||||
+ type: 'feed',
|
|
||||||
+ savedFeed: undefined,
|
|
||||||
+ pinned: true,
|
|
||||||
+ route: { href: '/', name: 'Home', params: {} },
|
|
||||||
+ cid: '',
|
|
||||||
+ avatar: '',
|
|
||||||
+ creatorDid: '',
|
|
||||||
+ creatorHandle: '',
|
|
||||||
+}, {
|
|
||||||
+ feedDescriptor: `feedgen|${SYU_IS_FEED_URI}`,
|
|
||||||
+ displayName: 'Feeds',
|
|
||||||
+ id: SYU_IS_FEED_URI,
|
|
||||||
+ uri: SYU_IS_FEED_URI,
|
|
||||||
+ type: 'feed',
|
|
||||||
+ savedFeed: {
|
|
||||||
+ type: 'feed',
|
|
||||||
+ value: SYU_IS_FEED_URI,
|
|
||||||
+ pinned: true,
|
|
||||||
+ },
|
|
||||||
+ pinned: true,
|
|
||||||
+ route: { href: '/', name: 'Home', params: {} },
|
|
||||||
+ cid: '',
|
|
||||||
+ avatar: '',
|
|
||||||
+ creatorDid: '',
|
|
||||||
+ creatorHandle: '',
|
|
||||||
+}]
|
|
||||||
+
|
|
||||||
type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home' | 'Start'>
|
|
||||||
export function HomeScreen(props: Props) {
|
|
||||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
|
||||||
const {data: preferences} = usePreferencesQuery()
|
|
||||||
const {currentAccount} = useSession()
|
|
||||||
- const {data: pinnedFeedInfos, isLoading: isPinnedFeedsLoading} =
|
|
||||||
- usePinnedFeedsInfos()
|
|
||||||
+ const {data: pinnedFeedInfos} = usePinnedFeedsInfos()
|
|
||||||
+
|
|
||||||
+ const safePreferences = preferences || { feedViewPrefs: { lab_mergeFeedEnabled: false }, savedFeeds: [] } as any
|
|
||||||
+ // Use user's pinned feeds when logged in and available, otherwise use defaults
|
|
||||||
+ const safePinnedFeedInfos = !currentAccount
|
|
||||||
+ ? DEFAULT_PINNED_FEEDS.filter(f => f.feedDescriptor !== 'following')
|
|
||||||
+ : (pinnedFeedInfos && pinnedFeedInfos.length > 0)
|
|
||||||
+ ? pinnedFeedInfos
|
|
||||||
+ : DEFAULT_PINNED_FEEDS
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (isWeb && !currentAccount) {
|
|
||||||
const getParams = new URLSearchParams(window.location.search)
|
|
||||||
const splash = getParams.get('splash')
|
|
||||||
- if (splash === 'true') {
|
|
||||||
- setShowLoggedOut(true)
|
|
||||||
- return
|
|
||||||
- }
|
|
||||||
+ if (splash === 'true') { setShowLoggedOut(true); return }
|
|
||||||
}
|
|
||||||
-
|
|
||||||
const params = props.route.params
|
|
||||||
- if (
|
|
||||||
- currentAccount &&
|
|
||||||
- props.route.name === 'Start' &&
|
|
||||||
- params?.name &&
|
|
||||||
- params?.rkey
|
|
||||||
- ) {
|
|
||||||
- props.navigation.navigate('StarterPack', {
|
|
||||||
- rkey: params.rkey,
|
|
||||||
- name: params.name,
|
|
||||||
- })
|
|
||||||
+ if (currentAccount && props.route.name === 'Start' && params?.name && params?.rkey) {
|
|
||||||
+ props.navigation.navigate('StarterPack', { rkey: params.rkey, name: params.name })
|
|
||||||
}
|
|
||||||
- }, [
|
|
||||||
- currentAccount,
|
|
||||||
- props.navigation,
|
|
||||||
- props.route.name,
|
|
||||||
- props.route.params,
|
|
||||||
- setShowLoggedOut,
|
|
||||||
- ])
|
|
||||||
+ }, [currentAccount, props.navigation, props.route.name, props.route.params, setShowLoggedOut])
|
|
||||||
|
|
||||||
- if (preferences && pinnedFeedInfos && !isPinnedFeedsLoading) {
|
|
||||||
- return (
|
|
||||||
- <Layout.Screen testID="HomeScreen">
|
|
||||||
- <HomeScreenReady
|
|
||||||
- {...props}
|
|
||||||
- preferences={preferences}
|
|
||||||
- pinnedFeedInfos={pinnedFeedInfos}
|
|
||||||
- />
|
|
||||||
- </Layout.Screen>
|
|
||||||
- )
|
|
||||||
- } else {
|
|
||||||
- return (
|
|
||||||
- <Layout.Screen>
|
|
||||||
- <Layout.Center style={styles.loading}>
|
|
||||||
- <ActivityIndicator size="large" />
|
|
||||||
- </Layout.Center>
|
|
||||||
- </Layout.Screen>
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
+ return (
|
|
||||||
+ <Layout.Screen testID="HomeScreen">
|
|
||||||
+ <HomeScreenReady {...props} preferences={safePreferences} pinnedFeedInfos={safePinnedFeedInfos as any} />
|
|
||||||
+ </Layout.Screen>
|
|
||||||
+ )
|
|
||||||
}
|
|
||||||
|
|
||||||
-function HomeScreenReady({
|
|
||||||
- preferences,
|
|
||||||
- pinnedFeedInfos,
|
|
||||||
-}: Props & {
|
|
||||||
- preferences: UsePreferencesQueryResponse
|
|
||||||
- pinnedFeedInfos: SavedFeedSourceInfo[]
|
|
||||||
-}) {
|
|
||||||
- const allFeeds = React.useMemo(
|
|
||||||
- () => pinnedFeedInfos.map(f => f.feedDescriptor),
|
|
||||||
- [pinnedFeedInfos],
|
|
||||||
- )
|
|
||||||
- const maybeRawSelectedFeed: FeedDescriptor | undefined =
|
|
||||||
- useSelectedFeed() ?? allFeeds[0]
|
|
||||||
+function HomeScreenReady({preferences, pinnedFeedInfos}: any) {
|
|
||||||
+ const allFeeds = React.useMemo(() => pinnedFeedInfos.map(f => f.feedDescriptor), [pinnedFeedInfos])
|
|
||||||
+ const maybeRawSelectedFeed = useSelectedFeed() ?? allFeeds[0]
|
|
||||||
const setSelectedFeed = useSetSelectedFeed()
|
|
||||||
const maybeFoundIndex = allFeeds.indexOf(maybeRawSelectedFeed)
|
|
||||||
const selectedIndex = Math.max(0, maybeFoundIndex)
|
|
||||||
- const maybeSelectedFeed: FeedDescriptor | undefined = allFeeds[selectedIndex]
|
|
||||||
+ const maybeSelectedFeed = allFeeds[selectedIndex]
|
|
||||||
const requestNotificationsPermission = useRequestNotificationsPermission()
|
|
||||||
|
|
||||||
useSetTitle(pinnedFeedInfos[selectedIndex]?.displayName)
|
|
||||||
useOTAUpdates()
|
|
||||||
-
|
|
||||||
- React.useEffect(() => {
|
|
||||||
- requestNotificationsPermission('Home')
|
|
||||||
- }, [requestNotificationsPermission])
|
|
||||||
+ React.useEffect(() => { requestNotificationsPermission('Home') }, [requestNotificationsPermission])
|
|
||||||
|
|
||||||
const pagerRef = React.useRef<PagerRef>(null)
|
|
||||||
const lastPagerReportedIndexRef = React.useRef(selectedIndex)
|
|
||||||
React.useLayoutEffect(() => {
|
|
||||||
- // Since the pager is not a controlled component, adjust it imperatively
|
|
||||||
- // if the selected index gets out of sync with what it last reported.
|
|
||||||
- // This is supposed to only happen on the web when you use the right nav.
|
|
||||||
if (selectedIndex !== lastPagerReportedIndexRef.current) {
|
|
||||||
lastPagerReportedIndexRef.current = selectedIndex
|
|
||||||
pagerRef.current?.setPage(selectedIndex)
|
|
||||||
@@ -138,205 +120,43 @@ function HomeScreenReady({
|
|
||||||
|
|
||||||
const {hasSession} = useSession()
|
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
|
||||||
- useFocusEffect(
|
|
||||||
- React.useCallback(() => {
|
|
||||||
- setMinimalShellMode(false)
|
|
||||||
- }, [setMinimalShellMode]),
|
|
||||||
- )
|
|
||||||
+ useFocusEffect(React.useCallback(() => { setMinimalShellMode(false) }, [setMinimalShellMode]))
|
|
||||||
|
|
||||||
- useFocusEffect(
|
|
||||||
- useNonReactiveCallback(() => {
|
|
||||||
- if (maybeSelectedFeed) {
|
|
||||||
- logEvent('home:feedDisplayed', {
|
|
||||||
- index: selectedIndex,
|
|
||||||
- feedType: maybeSelectedFeed.split('|')[0],
|
|
||||||
- feedUrl: maybeSelectedFeed,
|
|
||||||
- reason: 'focus',
|
|
||||||
- })
|
|
||||||
- }
|
|
||||||
- }),
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
- const onPageSelected = React.useCallback(
|
|
||||||
- (index: number) => {
|
|
||||||
- setMinimalShellMode(false)
|
|
||||||
- const maybeFeed = allFeeds[index]
|
|
||||||
+ const onPageSelected = React.useCallback((index) => {
|
|
||||||
+ setMinimalShellMode(false)
|
|
||||||
+ const maybeFeed = allFeeds[index]
|
|
||||||
+ lastPagerReportedIndexRef.current = index
|
|
||||||
+ setSelectedFeed(maybeFeed)
|
|
||||||
+ }, [setSelectedFeed, setMinimalShellMode, allFeeds])
|
|
||||||
|
|
||||||
- // Mutate the ref before setting state to avoid the imperative syncing effect
|
|
||||||
- // above from starting a loop on Android when swiping back and forth.
|
|
||||||
- lastPagerReportedIndexRef.current = index
|
|
||||||
- setSelectedFeed(maybeFeed)
|
|
||||||
-
|
|
||||||
- if (maybeFeed) {
|
|
||||||
- logEvent('home:feedDisplayed', {
|
|
||||||
- index,
|
|
||||||
- feedType: maybeFeed.split('|')[0],
|
|
||||||
- feedUrl: maybeFeed,
|
|
||||||
- })
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- [setSelectedFeed, setMinimalShellMode, allFeeds],
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
- const onPressSelected = React.useCallback(() => {
|
|
||||||
- emitSoftReset()
|
|
||||||
- }, [])
|
|
||||||
-
|
|
||||||
- const onPageScrollStateChanged = React.useCallback(
|
|
||||||
- (state: 'idle' | 'dragging' | 'settling') => {
|
|
||||||
- 'worklet'
|
|
||||||
- if (state === 'dragging') {
|
|
||||||
- setMinimalShellMode(false)
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- [setMinimalShellMode],
|
|
||||||
- )
|
|
||||||
+ const onPressSelected = React.useCallback(() => { emitSoftReset() }, [])
|
|
||||||
+ const onPageScrollStateChanged = React.useCallback((state) => {
|
|
||||||
+ 'worklet'
|
|
||||||
+ if (state === 'dragging') setMinimalShellMode(false)
|
|
||||||
+ }, [setMinimalShellMode])
|
|
||||||
|
|
||||||
const [demoMode] = useDemoMode()
|
|
||||||
+ const renderTabBar = React.useCallback((props) => {
|
|
||||||
+ return <HomeHeader key="FEEDS_TAB_BAR" {...props} testID="homeScreenFeedTabs" onPressSelected={onPressSelected} feeds={pinnedFeedInfos} />
|
|
||||||
+ }, [onPressSelected, pinnedFeedInfos])
|
|
||||||
|
|
||||||
- const renderTabBar = React.useCallback(
|
|
||||||
- (props: RenderTabBarFnProps) => {
|
|
||||||
- if (demoMode) {
|
|
||||||
- return (
|
|
||||||
- <HomeHeader
|
|
||||||
- key="FEEDS_TAB_BAR"
|
|
||||||
- {...props}
|
|
||||||
- testID="homeScreenFeedTabs"
|
|
||||||
- onPressSelected={onPressSelected}
|
|
||||||
- // @ts-ignore
|
|
||||||
- feeds={[{displayName: 'Following'}, {displayName: 'Discover'}]}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
- return (
|
|
||||||
- <HomeHeader
|
|
||||||
- key="FEEDS_TAB_BAR"
|
|
||||||
- {...props}
|
|
||||||
- testID="homeScreenFeedTabs"
|
|
||||||
- onPressSelected={onPressSelected}
|
|
||||||
- feeds={pinnedFeedInfos}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
- },
|
|
||||||
- [onPressSelected, pinnedFeedInfos, demoMode],
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
- const renderFollowingEmptyState = React.useCallback(() => {
|
|
||||||
- return <FollowingEmptyState />
|
|
||||||
- }, [])
|
|
||||||
+ const renderFollowingEmptyState = React.useCallback(() => <FollowingEmptyState />, [])
|
|
||||||
+ const renderCustomFeedEmptyState = React.useCallback(() => <CustomFeedEmptyState />, [])
|
|
||||||
|
|
||||||
- const renderCustomFeedEmptyState = React.useCallback(() => {
|
|
||||||
- return <CustomFeedEmptyState />
|
|
||||||
- }, [])
|
|
||||||
+ const homeFeedParams = React.useMemo(() => ({
|
|
||||||
+ mergeFeedEnabled: false, mergeFeedSources: []
|
|
||||||
+ }), [preferences])
|
|
||||||
|
|
||||||
- const homeFeedParams = React.useMemo<FeedParams>(() => {
|
|
||||||
- return {
|
|
||||||
- mergeFeedEnabled: Boolean(preferences.feedViewPrefs.lab_mergeFeedEnabled),
|
|
||||||
- mergeFeedSources: preferences.feedViewPrefs.lab_mergeFeedEnabled
|
|
||||||
- ? preferences.savedFeeds
|
|
||||||
- .filter(f => f.type === 'feed' || f.type === 'list')
|
|
||||||
- .map(f => f.value)
|
|
||||||
- : [],
|
|
||||||
- }
|
|
||||||
- }, [preferences])
|
|
||||||
-
|
|
||||||
- if (demoMode) {
|
|
||||||
- return (
|
|
||||||
- <Pager
|
|
||||||
- ref={pagerRef}
|
|
||||||
- testID="homeScreen"
|
|
||||||
- onPageSelected={onPageSelected}
|
|
||||||
- onPageScrollStateChanged={onPageScrollStateChanged}
|
|
||||||
- renderTabBar={renderTabBar}
|
|
||||||
- initialPage={selectedIndex}>
|
|
||||||
- <FeedPage
|
|
||||||
- testID="demoFeedPage"
|
|
||||||
- isPageFocused
|
|
||||||
- isPageAdjacent={false}
|
|
||||||
- feed="demo"
|
|
||||||
- renderEmptyState={renderCustomFeedEmptyState}
|
|
||||||
- feedInfo={pinnedFeedInfos[0]}
|
|
||||||
- />
|
|
||||||
- <FeedPage
|
|
||||||
- testID="customFeedPage"
|
|
||||||
- isPageFocused
|
|
||||||
- isPageAdjacent={false}
|
|
||||||
- feed={`feedgen|${PROD_DEFAULT_FEED('whats-hot')}`}
|
|
||||||
- renderEmptyState={renderCustomFeedEmptyState}
|
|
||||||
- feedInfo={pinnedFeedInfos[0]}
|
|
||||||
- />
|
|
||||||
- </Pager>
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return hasSession ? (
|
|
||||||
- <Pager
|
|
||||||
- key={allFeeds.join(',')}
|
|
||||||
- ref={pagerRef}
|
|
||||||
- testID="homeScreen"
|
|
||||||
- initialPage={selectedIndex}
|
|
||||||
- onPageSelected={onPageSelected}
|
|
||||||
- onPageScrollStateChanged={onPageScrollStateChanged}
|
|
||||||
- renderTabBar={renderTabBar}>
|
|
||||||
- {pinnedFeedInfos.length ? (
|
|
||||||
- pinnedFeedInfos.map((feedInfo, index) => {
|
|
||||||
+ 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="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
|
|
||||||
- key={feed}
|
|
||||||
- testID="customFeedPage"
|
|
||||||
- isPageFocused={maybeSelectedFeed === feed}
|
|
||||||
- isPageAdjacent={Math.abs(selectedIndex - index) === 1}
|
|
||||||
- feed={feed}
|
|
||||||
- renderEmptyState={renderCustomFeedEmptyState}
|
|
||||||
- savedFeedConfig={savedFeedConfig}
|
|
||||||
- feedInfo={feedInfo}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
- })
|
|
||||||
- ) : (
|
|
||||||
- <NoFeedsPinned preferences={preferences} />
|
|
||||||
- )}
|
|
||||||
- </Pager>
|
|
||||||
- ) : (
|
|
||||||
- <Pager
|
|
||||||
- testID="homeScreen"
|
|
||||||
- onPageSelected={onPageSelected}
|
|
||||||
- onPageScrollStateChanged={onPageScrollStateChanged}
|
|
||||||
- renderTabBar={renderTabBar}>
|
|
||||||
- <FeedPage
|
|
||||||
- testID="customFeedPage"
|
|
||||||
- isPageFocused
|
|
||||||
- isPageAdjacent={false}
|
|
||||||
- feed={`feedgen|${PROD_DEFAULT_FEED('whats-hot')}`}
|
|
||||||
- renderEmptyState={renderCustomFeedEmptyState}
|
|
||||||
- feedInfo={pinnedFeedInfos[0]}
|
|
||||||
- />
|
|
||||||
+ 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>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
-
|
|
||||||
-const styles = StyleSheet.create({
|
|
||||||
- loading: {
|
|
||||||
- height: '100%',
|
|
||||||
- alignContent: 'center',
|
|
||||||
- justifyContent: 'center',
|
|
||||||
- paddingBottom: 100,
|
|
||||||
- },
|
|
||||||
-})
|
|
||||||
+const styles = StyleSheet.create({ loading: { height: '100%', alignContent: 'center', justifyContent: 'center', paddingBottom: 100 } })
|
|
||||||
diff --git a/src/view/screens/PrivacyPolicy.tsx b/src/view/screens/PrivacyPolicy.tsx
|
diff --git a/src/view/screens/PrivacyPolicy.tsx b/src/view/screens/PrivacyPolicy.tsx
|
||||||
index a89eaadc4..1da393f03 100644
|
index a89eaadc4..1da393f03 100644
|
||||||
--- a/src/view/screens/PrivacyPolicy.tsx
|
--- a/src/view/screens/PrivacyPolicy.tsx
|
||||||
|
|||||||
@@ -2,32 +2,17 @@ diff --git a/src/view/com/auth/SplashScreen.tsx b/src/view/com/auth/SplashScreen
|
|||||||
index 3442d1bdf..8ed9e3d0d 100644
|
index 3442d1bdf..8ed9e3d0d 100644
|
||||||
--- a/src/view/com/auth/SplashScreen.tsx
|
--- a/src/view/com/auth/SplashScreen.tsx
|
||||||
+++ b/src/view/com/auth/SplashScreen.tsx
|
+++ b/src/view/com/auth/SplashScreen.tsx
|
||||||
@@ -1,4 +1,5 @@
|
@@ -1,5 +1,6 @@
|
||||||
import {View} from 'react-native'
|
import {useMemo} from 'react'
|
||||||
+import {Pressable, Linking} from 'react-native'
|
-import {Image as RNImage, View} from 'react-native'
|
||||||
|
+import {Image as RNImage, View, Pressable, Linking} from 'react-native'
|
||||||
|
+import {Text} from '#/components/Typography'
|
||||||
import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'
|
import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {Image} from 'expo-image'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
@@ -40,16 +41,6 @@ export const SplashScreen = ({
|
@@ -124,6 +125,18 @@ export const SplashScreen = ({
|
||||||
<View style={[a.pb_sm, a.pt_5xl]}>
|
</ButtonText>
|
||||||
<Logotype width={161} fill={t.atoms.text.color} />
|
</Button>
|
||||||
</View>
|
|
||||||
-
|
|
||||||
- <Text
|
|
||||||
- style={[
|
|
||||||
- a.text_md,
|
|
||||||
- a.font_semi_bold,
|
|
||||||
- t.atoms.text_contrast_medium,
|
|
||||||
- a.text_center,
|
|
||||||
- ]}>
|
|
||||||
- <Trans>What's up?</Trans>
|
|
||||||
- </Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View
|
|
||||||
@@ -102,6 +93,21 @@ export const SplashScreen = ({
|
|
||||||
<AppLanguageDropdown />
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
+ <View style={[a.pb_sm, a.justify_center, a.align_center]}>
|
+ <View style={[a.pb_sm, a.justify_center, a.align_center]}>
|
||||||
+ <Pressable onPress={() => Linking.openURL('https://syu.is/about/support/license')}>
|
+ <Pressable onPress={() => Linking.openURL('https://syu.is/about/support/license')}>
|
||||||
@@ -41,12 +26,9 @@ index 3442d1bdf..8ed9e3d0d 100644
|
|||||||
+ </Text>
|
+ </Text>
|
||||||
+ </Pressable>
|
+ </Pressable>
|
||||||
+ </View>
|
+ </View>
|
||||||
+ <View style={[a.pb_xl, a.justify_center, a.align_center]}>
|
|
||||||
+ <Text style={[a.text_xs, t.atoms.text_contrast_low]}>© syui</Text>
|
|
||||||
+ </View>
|
|
||||||
<View style={{height: insets.bottom}} />
|
|
||||||
</ErrorBoundary>
|
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
</>
|
||||||
|
)
|
||||||
diff --git a/src/view/com/auth/SplashScreen.web.tsx b/src/view/com/auth/SplashScreen.web.tsx
|
diff --git a/src/view/com/auth/SplashScreen.web.tsx b/src/view/com/auth/SplashScreen.web.tsx
|
||||||
index 22dd23d7f..7ceb3800e 100644
|
index 22dd23d7f..7ceb3800e 100644
|
||||||
--- a/src/view/com/auth/SplashScreen.web.tsx
|
--- a/src/view/com/auth/SplashScreen.web.tsx
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ diff --git a/src/screens/Settings/Settings.tsx b/src/screens/Settings/Settings.t
|
|||||||
index 2fa5aa7de..3faf6a7b3 100644
|
index 2fa5aa7de..3faf6a7b3 100644
|
||||||
--- a/src/screens/Settings/Settings.tsx
|
--- a/src/screens/Settings/Settings.tsx
|
||||||
+++ b/src/screens/Settings/Settings.tsx
|
+++ b/src/screens/Settings/Settings.tsx
|
||||||
@@ -205,26 +205,8 @@ export function SettingsScreen({}: Props) {
|
@@ -203,26 +203,8 @@ export function SettingsScreen({}: Props) {
|
||||||
<Trans>Notifications</Trans>
|
<Trans>Notifications</Trans>
|
||||||
</SettingsList.ItemText>
|
</SettingsList.ItemText>
|
||||||
</SettingsList.LinkItem>
|
</SettingsList.LinkItem>
|
||||||
@@ -14,9 +14,9 @@ index 2fa5aa7de..3faf6a7b3 100644
|
|||||||
- <Trans>Content and media</Trans>
|
- <Trans>Content and media</Trans>
|
||||||
- </SettingsList.ItemText>
|
- </SettingsList.ItemText>
|
||||||
- </SettingsList.LinkItem>
|
- </SettingsList.LinkItem>
|
||||||
- {isNative &&
|
- {IS_NATIVE &&
|
||||||
- findContactsEnabled &&
|
- findContactsEnabled &&
|
||||||
- !gate('disable_settings_find_contacts') && (
|
- !ax.features.enabled(ax.features.ImportContactsSettingsDisable) && (
|
||||||
- <SettingsList.LinkItem
|
- <SettingsList.LinkItem
|
||||||
- to="/settings/find-contacts"
|
- to="/settings/find-contacts"
|
||||||
- label={_(msg`Find friends from contacts`)}>
|
- label={_(msg`Find friends from contacts`)}>
|
||||||
@@ -31,7 +31,7 @@ index 2fa5aa7de..3faf6a7b3 100644
|
|||||||
<SettingsList.LinkItem
|
<SettingsList.LinkItem
|
||||||
to="/settings/appearance"
|
to="/settings/appearance"
|
||||||
label={_(msg`Appearance`)}>
|
label={_(msg`Appearance`)}>
|
||||||
@@ -249,16 +231,6 @@ export function SettingsScreen({}: Props) {
|
@@ -247,16 +229,6 @@ export function SettingsScreen({}: Props) {
|
||||||
<Trans>Languages</Trans>
|
<Trans>Languages</Trans>
|
||||||
</SettingsList.ItemText>
|
</SettingsList.ItemText>
|
||||||
</SettingsList.LinkItem>
|
</SettingsList.LinkItem>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ index 352cc1dc0..f477521af 100644
|
|||||||
import {MagnifyingGlassIcon} from '#/lib/icons'
|
import {MagnifyingGlassIcon} from '#/lib/icons'
|
||||||
-import {type NavigationProp} from '#/lib/routes/types'
|
-import {type NavigationProp} from '#/lib/routes/types'
|
||||||
import {s} from '#/lib/styles'
|
import {s} from '#/lib/styles'
|
||||||
-import {isWeb} from '#/platform/detection'
|
-import {IS_WEB} from '#/env'
|
||||||
-import {Button} from '../util/forms/Button'
|
-import {Button} from '../util/forms/Button'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ index 352cc1dc0..f477521af 100644
|
|||||||
- const navigation = useNavigation<NavigationProp>()
|
- const navigation = useNavigation<NavigationProp>()
|
||||||
-
|
-
|
||||||
- const onPressFindAccounts = React.useCallback(() => {
|
- const onPressFindAccounts = React.useCallback(() => {
|
||||||
- if (isWeb) {
|
- if (IS_WEB) {
|
||||||
- navigation.navigate('Search', {})
|
- navigation.navigate('Search', {})
|
||||||
- } else {
|
- } else {
|
||||||
- navigation.navigate('SearchTab')
|
- navigation.navigate('SearchTab')
|
||||||
@@ -151,7 +151,7 @@ index e3c84d782..efb55d406 100644
|
|||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
-import {type NavigationProp} from '#/lib/routes/types'
|
-import {type NavigationProp} from '#/lib/routes/types'
|
||||||
import {s} from '#/lib/styles'
|
import {s} from '#/lib/styles'
|
||||||
-import {isWeb} from '#/platform/detection'
|
-import {IS_WEB} from '#/env'
|
||||||
-import {Button} from '../util/forms/Button'
|
-import {Button} from '../util/forms/Button'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ index e3c84d782..efb55d406 100644
|
|||||||
- const navigation = useNavigation<NavigationProp>()
|
- const navigation = useNavigation<NavigationProp>()
|
||||||
-
|
-
|
||||||
- const onPressFindAccounts = React.useCallback(() => {
|
- const onPressFindAccounts = React.useCallback(() => {
|
||||||
- if (isWeb) {
|
- if (IS_WEB) {
|
||||||
- navigation.navigate('Search', {})
|
- navigation.navigate('Search', {})
|
||||||
- } else {
|
- } else {
|
||||||
- navigation.navigate('SearchTab')
|
- navigation.navigate('SearchTab')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--- a/src/view/shell/bottom-bar/BottomBar.tsx
|
--- a/src/view/shell/bottom-bar/BottomBar.tsx
|
||||||
+++ b/src/view/shell/bottom-bar/BottomBar.tsx
|
+++ b/src/view/shell/bottom-bar/BottomBar.tsx
|
||||||
@@ -198,38 +198,40 @@
|
@@ -196,38 +196,40 @@
|
||||||
accessibilityLabel={_(msg`Search`)}
|
accessibilityLabel={_(msg`Search`)}
|
||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
/>
|
/>
|
||||||
@@ -10,12 +10,12 @@
|
|||||||
- isAtMessages ? (
|
- isAtMessages ? (
|
||||||
- <MessageFilled
|
- <MessageFilled
|
||||||
- width={iconWidth - 1}
|
- width={iconWidth - 1}
|
||||||
- style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
- style={[styles.ctrlIcon, t.atoms.text, styles.feedsIcon]}
|
||||||
- />
|
- />
|
||||||
- ) : (
|
- ) : (
|
||||||
- <Message
|
- <Message
|
||||||
- width={iconWidth - 1}
|
- width={iconWidth - 1}
|
||||||
- style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
- style={[styles.ctrlIcon, t.atoms.text, styles.feedsIcon]}
|
||||||
- />
|
- />
|
||||||
- )
|
- )
|
||||||
- }
|
- }
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
- accessibilityHint={
|
- accessibilityHint={
|
||||||
- numUnreadMessages.count > 0
|
- numUnreadMessages.count > 0
|
||||||
- ? _(
|
- ? _(
|
||||||
- msg`${plural(numUnreadMessages.numUnread ?? 0, {
|
- plural(numUnreadMessages.numUnread ?? 0, {
|
||||||
- one: '# unread item',
|
- one: '# unread item',
|
||||||
- other: '# unread items',
|
- other: '# unread items',
|
||||||
- })}` || '',
|
- }),
|
||||||
- )
|
- )
|
||||||
- : ''
|
- : ''
|
||||||
- }
|
- }
|
||||||
@@ -43,12 +43,12 @@
|
|||||||
+ isAtMessages ? (
|
+ isAtMessages ? (
|
||||||
+ <MessageFilled
|
+ <MessageFilled
|
||||||
+ width={iconWidth - 1}
|
+ width={iconWidth - 1}
|
||||||
+ style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
+ style={[styles.ctrlIcon, t.atoms.text, styles.feedsIcon]}
|
||||||
+ />
|
+ />
|
||||||
+ ) : (
|
+ ) : (
|
||||||
+ <Message
|
+ <Message
|
||||||
+ width={iconWidth - 1}
|
+ width={iconWidth - 1}
|
||||||
+ style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
+ style={[styles.ctrlIcon, t.atoms.text, styles.feedsIcon]}
|
||||||
+ />
|
+ />
|
||||||
+ )
|
+ )
|
||||||
+ }
|
+ }
|
||||||
@@ -61,10 +61,10 @@
|
|||||||
+ accessibilityHint={
|
+ accessibilityHint={
|
||||||
+ numUnreadMessages.count > 0
|
+ numUnreadMessages.count > 0
|
||||||
+ ? _(
|
+ ? _(
|
||||||
+ msg`${plural(numUnreadMessages.numUnread ?? 0, {
|
+ plural(numUnreadMessages.numUnread ?? 0, {
|
||||||
+ one: '# unread item',
|
+ one: '# unread item',
|
||||||
+ other: '# unread items',
|
+ other: '# unread items',
|
||||||
+ })}` || '',
|
+ }),
|
||||||
+ )
|
+ )
|
||||||
+ : ''
|
+ : ''
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--- a/src/screens/Signup/StepInfo/index.tsx
|
--- a/src/screens/Signup/StepInfo/index.tsx
|
||||||
+++ b/src/screens/Signup/StepInfo/index.tsx
|
+++ b/src/screens/Signup/StepInfo/index.tsx
|
||||||
@@ -9,44 +9,17 @@
|
@@ -8,46 +8,18 @@
|
||||||
|
import {isEmailMaybeInvalid} from '#/lib/strings/email'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isNative} from '#/platform/detection'
|
|
||||||
import {useSignupContext} from '#/screens/Signup/state'
|
import {useSignupContext} from '#/screens/Signup/state'
|
||||||
-import {Policies} from '#/screens/Signup/StepInfo/Policies'
|
-import {Policies} from '#/screens/Signup/StepInfo/Policies'
|
||||||
import {atoms as a, native} from '#/alf'
|
import {atoms as a, native} from '#/alf'
|
||||||
@@ -26,6 +26,8 @@
|
|||||||
- MIN_ACCESS_AGE,
|
- MIN_ACCESS_AGE,
|
||||||
- useAgeAssuranceRegionConfigWithFallback,
|
- useAgeAssuranceRegionConfigWithFallback,
|
||||||
-} from '#/ageAssurance/util'
|
-} from '#/ageAssurance/util'
|
||||||
|
import {useAnalytics} from '#/analytics'
|
||||||
|
-import {IS_NATIVE} from '#/env'
|
||||||
-import {
|
-import {
|
||||||
- useDeviceGeolocationApi,
|
- useDeviceGeolocationApi,
|
||||||
- useIsDeviceGeolocationGranted,
|
- useIsDeviceGeolocationGranted,
|
||||||
@@ -45,12 +47,12 @@
|
|||||||
export function StepInfo({
|
export function StepInfo({
|
||||||
onPressBack,
|
onPressBack,
|
||||||
isServerError,
|
isServerError,
|
||||||
@@ -70,21 +43,6 @@
|
@@ -72,22 +44,7 @@
|
||||||
|
|
||||||
const emailInputRef = useRef<TextInput>(null)
|
const emailInputRef = useRef<TextInput>(null)
|
||||||
const passwordInputRef = useRef<TextInput>(null)
|
const passwordInputRef = useRef<TextInput>(null)
|
||||||
- const birthdateInputRef = useRef<DateFieldRef>(null)
|
- const birthdateInputRef = useRef<DateFieldRef>(null)
|
||||||
-
|
|
||||||
- const aaRegionConfig = useAgeAssuranceRegionConfigWithFallback()
|
- const aaRegionConfig = useAgeAssuranceRegionConfigWithFallback()
|
||||||
- const {setDeviceGeolocation} = useDeviceGeolocationApi()
|
- const {setDeviceGeolocation} = useDeviceGeolocationApi()
|
||||||
- const locationControl = Dialog.useDialogControl()
|
- const locationControl = Dialog.useDialogControl()
|
||||||
@@ -64,10 +66,11 @@
|
|||||||
- ? !isUnderAge(state.dateOfBirth.toISOString(), 18)
|
- ? !isUnderAge(state.dateOfBirth.toISOString(), 18)
|
||||||
- : true
|
- : true
|
||||||
- const isDeviceGeolocationGranted = useIsDeviceGeolocationGranted()
|
- const isDeviceGeolocationGranted = useIsDeviceGeolocationGranted()
|
||||||
|
-
|
||||||
const [hasWarnedEmail, setHasWarnedEmail] = React.useState<boolean>(false)
|
const [hasWarnedEmail, setHasWarnedEmail] = React.useState<boolean>(false)
|
||||||
|
|
||||||
@@ -105,10 +63,6 @@
|
const tldtsRef = React.useRef<typeof tldts>(undefined)
|
||||||
|
@@ -107,10 +64,6 @@
|
||||||
const emailChanged = prevEmailValueRef.current !== email
|
const emailChanged = prevEmailValueRef.current !== email
|
||||||
const password = passwordValueRef.current
|
const password = passwordValueRef.current
|
||||||
|
|
||||||
@@ -78,7 +81,7 @@
|
|||||||
if (state.serviceDescription?.inviteCodeRequired && !inviteCode) {
|
if (state.serviceDescription?.inviteCodeRequired && !inviteCode) {
|
||||||
return dispatch({
|
return dispatch({
|
||||||
type: 'setError',
|
type: 'setError',
|
||||||
@@ -275,107 +229,16 @@
|
@@ -273,107 +226,16 @@
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
passwordRules="minlength: 8;"
|
passwordRules="minlength: 8;"
|
||||||
/>
|
/>
|
||||||
</TextField.Root>
|
</TextField.Root>
|
||||||
</View>
|
- </View>
|
||||||
- <View>
|
- <View>
|
||||||
- <DateField.LabelText>
|
- <DateField.LabelText>
|
||||||
- <Trans>Your birth date</Trans>
|
- <Trans>Your birth date</Trans>
|
||||||
@@ -110,7 +113,7 @@
|
|||||||
- accessibilityHint={_(msg`Select your date of birth`)}
|
- accessibilityHint={_(msg`Select your date of birth`)}
|
||||||
- maximumDate={new Date()}
|
- maximumDate={new Date()}
|
||||||
- />
|
- />
|
||||||
- </View>
|
</View>
|
||||||
-
|
-
|
||||||
- <View style={[a.gap_sm]}>
|
- <View style={[a.gap_sm]}>
|
||||||
- <Policies serviceDescription={state.serviceDescription} />
|
- <Policies serviceDescription={state.serviceDescription} />
|
||||||
@@ -133,7 +136,7 @@
|
|||||||
- </Trans>
|
- </Trans>
|
||||||
- )}
|
- )}
|
||||||
- </Admonition.Text>
|
- </Admonition.Text>
|
||||||
- {isNative &&
|
- {IS_NATIVE &&
|
||||||
- !isDeviceGeolocationGranted &&
|
- !isDeviceGeolocationGranted &&
|
||||||
- isOverAppMinAccessAge && (
|
- isOverAppMinAccessAge && (
|
||||||
- <Admonition.Text>
|
- <Admonition.Text>
|
||||||
@@ -165,7 +168,7 @@
|
|||||||
- ) : undefined}
|
- ) : undefined}
|
||||||
- </View>
|
- </View>
|
||||||
-
|
-
|
||||||
- {isNative && (
|
- {IS_NATIVE && (
|
||||||
- <DeviceLocationRequestDialog
|
- <DeviceLocationRequestDialog
|
||||||
- control={locationControl}
|
- control={locationControl}
|
||||||
- onLocationAcquired={props => {
|
- onLocationAcquired={props => {
|
||||||
|
|||||||
Reference in New Issue
Block a user