From 05212ca9e34ea6dd2bc1c9d411ccf7035eff5bd6 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 24 Apr 2024 21:37:16 +0100 Subject: [PATCH] Remove Moderation from sidebar (#3692) --- src/view/screens/Settings/index.tsx | 86 ++++++++++++++--------------- src/view/shell/Drawer.tsx | 27 --------- src/view/shell/desktop/LeftNav.tsx | 78 ++++++++++---------------- 3 files changed, 73 insertions(+), 118 deletions(-) diff --git a/src/view/screens/Settings/index.tsx b/src/view/screens/Settings/index.tsx index 1211aa5c..6b5390c2 100644 --- a/src/view/screens/Settings/index.tsx +++ b/src/view/screens/Settings/index.tsx @@ -493,6 +493,49 @@ export function SettingsScreen({}: Props) { Accessibility + + + + + + Languages + + + navigation.navigate('Moderation') + } + accessibilityRole="button" + accessibilityLabel={_(msg`Moderation settings`)} + accessibilityHint={_(msg`Opens moderation settings`)}> + + + + + Moderation + + My Saved Feeds - - - - - - Languages - - - navigation.navigate('Moderation') - } - accessibilityRole="button" - accessibilityLabel={_(msg`Moderation settings`)} - accessibilityHint={_(msg`Opens moderation settings`)}> - - - - - Moderation - - diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 3972797b..8145fa40 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -30,7 +30,6 @@ import { BellIcon, BellIconSolid, CogIcon, - HandIcon, HashtagIcon, HomeIcon, HomeIconSolid, @@ -177,12 +176,6 @@ let DrawerContent = ({}: {}): React.ReactNode => { setDrawerOpen(false) }, [navigation, track, setDrawerOpen]) - const onPressModeration = React.useCallback(() => { - track('Menu:ItemClicked', {url: 'Moderation'}) - navigation.navigate('Moderation') - setDrawerOpen(false) - }, [navigation, track, setDrawerOpen]) - const onPressSettings = React.useCallback(() => { track('Menu:ItemClicked', {url: 'Settings'}) navigation.navigate('Settings') @@ -240,7 +233,6 @@ let DrawerContent = ({}: {}): React.ReactNode => { /> - void}): React.ReactNode => { } ListsMenuItem = React.memo(ListsMenuItem) -let ModerationMenuItem = ({ - onPress, -}: { - onPress: () => void -}): React.ReactNode => { - const {_} = useLingui() - const pal = usePalette('default') - return ( - } - label={_(msg`Moderation`)} - accessibilityLabel={_(msg`Moderation`)} - accessibilityHint="" - onPress={onPress} - /> - ) -} -ModerationMenuItem = React.memo(ModerationMenuItem) - let ProfileMenuItem = ({ isActive, onPress, diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 097ca2fb..47daed6c 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -1,52 +1,52 @@ import React from 'react' import {StyleSheet, TouchableOpacity, View} from 'react-native' -import {PressableWithHover} from 'view/com/util/PressableWithHover' +import { + FontAwesomeIcon, + FontAwesomeIconStyle, +} from '@fortawesome/react-native-fontawesome' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' import { useLinkProps, useNavigation, useNavigationState, } from '@react-navigation/native' -import { - FontAwesomeIcon, - FontAwesomeIconStyle, -} from '@fortawesome/react-native-fontawesome' -import {Text} from 'view/com/util/text/Text' -import {UserAvatar} from 'view/com/util/UserAvatar' -import {Link} from 'view/com/util/Link' -import {LoadingPlaceholder} from 'view/com/util/LoadingPlaceholder' + +import {isInvalidHandle} from '#/lib/strings/handles' +import {emitSoftReset} from '#/state/events' +import {useFetchHandle} from '#/state/queries/handle' +import {useUnreadNotifications} from '#/state/queries/notifications/unread' +import {useProfileQuery} from '#/state/queries/profile' +import {useSession} from '#/state/session' +import {useComposerControls} from '#/state/shell/composer' import {usePalette} from 'lib/hooks/usePalette' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' -import {s, colors} from 'lib/styles' import { - HomeIcon, - HomeIconSolid, - MagnifyingGlassIcon2, - MagnifyingGlassIcon2Solid, BellIcon, BellIconSolid, - UserIcon, - UserIconSolid, CogIcon, CogIconSolid, ComposeIcon2, - ListIcon, HashtagIcon, - HandIcon, + HomeIcon, + HomeIconSolid, + ListIcon, + MagnifyingGlassIcon2, + MagnifyingGlassIcon2Solid, + UserIcon, + UserIconSolid, } from 'lib/icons' -import {getCurrentRoute, isTab, isStateAtTabRoot} from 'lib/routes/helpers' -import {NavigationProp, CommonNavigatorParams} from 'lib/routes/types' -import {router} from '../../../routes' +import {getCurrentRoute, isStateAtTabRoot, isTab} from 'lib/routes/helpers' import {makeProfileLink} from 'lib/routes/links' -import {useLingui} from '@lingui/react' -import {Trans, msg} from '@lingui/macro' -import {useProfileQuery} from '#/state/queries/profile' -import {useSession} from '#/state/session' -import {useUnreadNotifications} from '#/state/queries/notifications/unread' -import {useComposerControls} from '#/state/shell/composer' -import {useFetchHandle} from '#/state/queries/handle' -import {emitSoftReset} from '#/state/events' +import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types' +import {colors, s} from 'lib/styles' import {NavSignupCard} from '#/view/shell/NavSignupCard' -import {isInvalidHandle} from '#/lib/strings/handles' +import {Link} from 'view/com/util/Link' +import {LoadingPlaceholder} from 'view/com/util/LoadingPlaceholder' +import {PressableWithHover} from 'view/com/util/PressableWithHover' +import {Text} from 'view/com/util/text/Text' +import {UserAvatar} from 'view/com/util/UserAvatar' +import {router} from '../../../routes' function ProfileCard() { const {currentAccount} = useSession() @@ -382,24 +382,6 @@ export function DesktopLeftNav() { } label={_(msg`Lists`)} /> - - } - iconFilled={ - - } - label={_(msg`Moderation`)} - />