diff options
Diffstat (limited to 'src/view/screens')
-rw-r--r-- | src/view/screens/Home.tsx | 9 | ||||
-rw-r--r-- | src/view/screens/Lists.tsx | 22 | ||||
-rw-r--r-- | src/view/screens/ModerationModlists.tsx | 22 | ||||
-rw-r--r-- | src/view/screens/Storybook/Admonitions.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Breakpoints.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Icons.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Links.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Menus.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Palette.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Settings.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Shadows.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Spacing.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Theming.tsx | 1 | ||||
-rw-r--r-- | src/view/screens/Storybook/Typography.tsx | 1 |
14 files changed, 43 insertions, 21 deletions
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 237449383..cadfb4890 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -141,7 +141,7 @@ function HomeScreenReady({ useFocusEffect( useNonReactiveCallback(() => { if (selectedFeed) { - logEvent('home:feedDisplayed:sampled', { + logEvent('home:feedDisplayed', { index: selectedIndex, feedType: selectedFeed.split('|')[0], feedUrl: selectedFeed, @@ -163,12 +163,9 @@ function HomeScreenReady({ ) const onPageSelecting = React.useCallback( - ( - index: number, - reason: LogEvents['home:feedDisplayed:sampled']['reason'], - ) => { + (index: number, reason: LogEvents['home:feedDisplayed']['reason']) => { const feed = allFeeds[index] - logEvent('home:feedDisplayed:sampled', { + logEvent('home:feedDisplayed', { index, feedType: feed.split('|')[0], feedUrl: feed, diff --git a/src/view/screens/Lists.tsx b/src/view/screens/Lists.tsx index b79da6d54..f654f2bd9 100644 --- a/src/view/screens/Lists.tsx +++ b/src/view/screens/Lists.tsx @@ -2,9 +2,11 @@ import React from 'react' import {StyleSheet, View} from 'react-native' import {AtUri} from '@atproto/api' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' -import {Trans} from '@lingui/macro' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useFocusEffect, useNavigation} from '@react-navigation/native' +import {useEmail} from '#/lib/hooks/useEmail' import {usePalette} from '#/lib/hooks/usePalette' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' @@ -16,15 +18,20 @@ import {MyLists} from '#/view/com/lists/MyLists' import {Button} from '#/view/com/util/forms/Button' import {SimpleViewHeader} from '#/view/com/util/SimpleViewHeader' import {Text} from '#/view/com/util/text/Text' +import {useDialogControl} from '#/components/Dialog' +import {VerifyEmailDialog} from '#/components/dialogs/VerifyEmailDialog' import * as Layout from '#/components/Layout' type Props = NativeStackScreenProps<CommonNavigatorParams, 'Lists'> export function ListsScreen({}: Props) { + const {_} = useLingui() const pal = usePalette('default') const setMinimalShellMode = useSetMinimalShellMode() const {isMobile} = useWebMediaQueries() const navigation = useNavigation<NavigationProp>() const {openModal} = useModalControls() + const {needsEmailVerification} = useEmail() + const control = useDialogControl() useFocusEffect( React.useCallback(() => { @@ -33,6 +40,11 @@ export function ListsScreen({}: Props) { ) const onPressNewList = React.useCallback(() => { + if (needsEmailVerification) { + control.open() + return + } + openModal({ name: 'create-or-edit-list', purpose: 'app.bsky.graph.defs#curatelist', @@ -46,7 +58,7 @@ export function ListsScreen({}: Props) { } catch {} }, }) - }, [openModal, navigation]) + }, [needsEmailVerification, control, openModal, navigation]) return ( <Layout.Screen testID="listsScreen"> @@ -87,6 +99,12 @@ export function ListsScreen({}: Props) { </View> </SimpleViewHeader> <MyLists filter="curate" style={s.flexGrow1} /> + <VerifyEmailDialog + reasonText={_( + msg`Before creating a list, you must first verify your email.`, + )} + control={control} + /> </Layout.Screen> ) } diff --git a/src/view/screens/ModerationModlists.tsx b/src/view/screens/ModerationModlists.tsx index b147ba502..c623c5376 100644 --- a/src/view/screens/ModerationModlists.tsx +++ b/src/view/screens/ModerationModlists.tsx @@ -2,9 +2,11 @@ import React from 'react' import {View} from 'react-native' import {AtUri} from '@atproto/api' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' -import {Trans} from '@lingui/macro' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useFocusEffect, useNavigation} from '@react-navigation/native' +import {useEmail} from '#/lib/hooks/useEmail' import {usePalette} from '#/lib/hooks/usePalette' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' @@ -16,15 +18,20 @@ import {MyLists} from '#/view/com/lists/MyLists' import {Button} from '#/view/com/util/forms/Button' import {SimpleViewHeader} from '#/view/com/util/SimpleViewHeader' import {Text} from '#/view/com/util/text/Text' +import {useDialogControl} from '#/components/Dialog' +import {VerifyEmailDialog} from '#/components/dialogs/VerifyEmailDialog' import * as Layout from '#/components/Layout' type Props = NativeStackScreenProps<CommonNavigatorParams, 'ModerationModlists'> export function ModerationModlistsScreen({}: Props) { + const {_} = useLingui() const pal = usePalette('default') const setMinimalShellMode = useSetMinimalShellMode() const {isMobile} = useWebMediaQueries() const navigation = useNavigation<NavigationProp>() const {openModal} = useModalControls() + const {needsEmailVerification} = useEmail() + const control = useDialogControl() useFocusEffect( React.useCallback(() => { @@ -33,6 +40,11 @@ export function ModerationModlistsScreen({}: Props) { ) const onPressNewList = React.useCallback(() => { + if (needsEmailVerification) { + control.open() + return + } + openModal({ name: 'create-or-edit-list', purpose: 'app.bsky.graph.defs#modlist', @@ -46,7 +58,7 @@ export function ModerationModlistsScreen({}: Props) { } catch {} }, }) - }, [openModal, navigation]) + }, [needsEmailVerification, control, openModal, navigation]) return ( <Layout.Screen testID="moderationModlistsScreen"> @@ -83,6 +95,12 @@ export function ModerationModlistsScreen({}: Props) { </View> </SimpleViewHeader> <MyLists filter="mod" style={s.flexGrow1} /> + <VerifyEmailDialog + reasonText={_( + msg`Before creating a list, you must first verify your email.`, + )} + control={control} + /> </Layout.Screen> ) } diff --git a/src/view/screens/Storybook/Admonitions.tsx b/src/view/screens/Storybook/Admonitions.tsx index ca97ebb23..988342f17 100644 --- a/src/view/screens/Storybook/Admonitions.tsx +++ b/src/view/screens/Storybook/Admonitions.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a} from '#/alf' diff --git a/src/view/screens/Storybook/Breakpoints.tsx b/src/view/screens/Storybook/Breakpoints.tsx index 5dd8a89fc..6c79e2c9e 100644 --- a/src/view/screens/Storybook/Breakpoints.tsx +++ b/src/view/screens/Storybook/Breakpoints.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useBreakpoints, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Icons.tsx b/src/view/screens/Storybook/Icons.tsx index 9de126d6b..97a588a5a 100644 --- a/src/view/screens/Storybook/Icons.tsx +++ b/src/view/screens/Storybook/Icons.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Links.tsx b/src/view/screens/Storybook/Links.tsx index 465ce0d6f..37e316401 100644 --- a/src/view/screens/Storybook/Links.tsx +++ b/src/view/screens/Storybook/Links.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Menus.tsx b/src/view/screens/Storybook/Menus.tsx index 3e5c74d86..28689b727 100644 --- a/src/view/screens/Storybook/Menus.tsx +++ b/src/view/screens/Storybook/Menus.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Palette.tsx b/src/view/screens/Storybook/Palette.tsx index 42000aa81..268ce5935 100644 --- a/src/view/screens/Storybook/Palette.tsx +++ b/src/view/screens/Storybook/Palette.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Settings.tsx b/src/view/screens/Storybook/Settings.tsx index 6bc293c73..fe47b2c74 100644 --- a/src/view/screens/Storybook/Settings.tsx +++ b/src/view/screens/Storybook/Settings.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import * as Toast from '#/view/com/util/Toast' diff --git a/src/view/screens/Storybook/Shadows.tsx b/src/view/screens/Storybook/Shadows.tsx index f92112395..e9c23f03e 100644 --- a/src/view/screens/Storybook/Shadows.tsx +++ b/src/view/screens/Storybook/Shadows.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Spacing.tsx b/src/view/screens/Storybook/Spacing.tsx index 9b97e92ad..94c62d2f9 100644 --- a/src/view/screens/Storybook/Spacing.tsx +++ b/src/view/screens/Storybook/Spacing.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Theming.tsx b/src/view/screens/Storybook/Theming.tsx index 5b6763370..673425b47 100644 --- a/src/view/screens/Storybook/Theming.tsx +++ b/src/view/screens/Storybook/Theming.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a, useTheme} from '#/alf' diff --git a/src/view/screens/Storybook/Typography.tsx b/src/view/screens/Storybook/Typography.tsx index 03f86fd46..9286d4b3d 100644 --- a/src/view/screens/Storybook/Typography.tsx +++ b/src/view/screens/Storybook/Typography.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {atoms as a} from '#/alf' |