Remove Moderation from sidebar (#3692)
parent
e2a59449df
commit
05212ca9e3
|
@ -493,6 +493,49 @@ export function SettingsScreen({}: Props) {
|
||||||
<Trans>Accessibility</Trans>
|
<Trans>Accessibility</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity
|
||||||
|
testID="languageSettingsBtn"
|
||||||
|
style={[
|
||||||
|
styles.linkCard,
|
||||||
|
pal.view,
|
||||||
|
isSwitchingAccounts && styles.dimmed,
|
||||||
|
]}
|
||||||
|
onPress={isSwitchingAccounts ? undefined : onPressLanguageSettings}
|
||||||
|
accessibilityRole="button"
|
||||||
|
accessibilityLabel={_(msg`Language settings`)}
|
||||||
|
accessibilityHint={_(msg`Opens configurable language settings`)}>
|
||||||
|
<View style={[styles.iconContainer, pal.btn]}>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon="language"
|
||||||
|
style={pal.text as FontAwesomeIconStyle}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<Text type="lg" style={pal.text}>
|
||||||
|
<Trans>Languages</Trans>
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity
|
||||||
|
testID="moderationBtn"
|
||||||
|
style={[
|
||||||
|
styles.linkCard,
|
||||||
|
pal.view,
|
||||||
|
isSwitchingAccounts && styles.dimmed,
|
||||||
|
]}
|
||||||
|
onPress={
|
||||||
|
isSwitchingAccounts
|
||||||
|
? undefined
|
||||||
|
: () => navigation.navigate('Moderation')
|
||||||
|
}
|
||||||
|
accessibilityRole="button"
|
||||||
|
accessibilityLabel={_(msg`Moderation settings`)}
|
||||||
|
accessibilityHint={_(msg`Opens moderation settings`)}>
|
||||||
|
<View style={[styles.iconContainer, pal.btn]}>
|
||||||
|
<HandIcon style={pal.text} size={18} strokeWidth={6} />
|
||||||
|
</View>
|
||||||
|
<Text type="lg" style={pal.text}>
|
||||||
|
<Trans>Moderation</Trans>
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
testID="preferencesHomeFeedButton"
|
testID="preferencesHomeFeedButton"
|
||||||
style={[
|
style={[
|
||||||
|
@ -554,49 +597,6 @@ export function SettingsScreen({}: Props) {
|
||||||
<Trans>My Saved Feeds</Trans>
|
<Trans>My Saved Feeds</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity
|
|
||||||
testID="languageSettingsBtn"
|
|
||||||
style={[
|
|
||||||
styles.linkCard,
|
|
||||||
pal.view,
|
|
||||||
isSwitchingAccounts && styles.dimmed,
|
|
||||||
]}
|
|
||||||
onPress={isSwitchingAccounts ? undefined : onPressLanguageSettings}
|
|
||||||
accessibilityRole="button"
|
|
||||||
accessibilityLabel={_(msg`Language settings`)}
|
|
||||||
accessibilityHint={_(msg`Opens configurable language settings`)}>
|
|
||||||
<View style={[styles.iconContainer, pal.btn]}>
|
|
||||||
<FontAwesomeIcon
|
|
||||||
icon="language"
|
|
||||||
style={pal.text as FontAwesomeIconStyle}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<Text type="lg" style={pal.text}>
|
|
||||||
<Trans>Languages</Trans>
|
|
||||||
</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
<TouchableOpacity
|
|
||||||
testID="moderationBtn"
|
|
||||||
style={[
|
|
||||||
styles.linkCard,
|
|
||||||
pal.view,
|
|
||||||
isSwitchingAccounts && styles.dimmed,
|
|
||||||
]}
|
|
||||||
onPress={
|
|
||||||
isSwitchingAccounts
|
|
||||||
? undefined
|
|
||||||
: () => navigation.navigate('Moderation')
|
|
||||||
}
|
|
||||||
accessibilityRole="button"
|
|
||||||
accessibilityLabel={_(msg`Moderation settings`)}
|
|
||||||
accessibilityHint={_(msg`Opens moderation settings`)}>
|
|
||||||
<View style={[styles.iconContainer, pal.btn]}>
|
|
||||||
<HandIcon style={pal.text} size={18} strokeWidth={6} />
|
|
||||||
</View>
|
|
||||||
<Text type="lg" style={pal.text}>
|
|
||||||
<Trans>Moderation</Trans>
|
|
||||||
</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
|
|
||||||
<View style={styles.spacer20} />
|
<View style={styles.spacer20} />
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ import {
|
||||||
BellIcon,
|
BellIcon,
|
||||||
BellIconSolid,
|
BellIconSolid,
|
||||||
CogIcon,
|
CogIcon,
|
||||||
HandIcon,
|
|
||||||
HashtagIcon,
|
HashtagIcon,
|
||||||
HomeIcon,
|
HomeIcon,
|
||||||
HomeIconSolid,
|
HomeIconSolid,
|
||||||
|
@ -177,12 +176,6 @@ let DrawerContent = ({}: {}): React.ReactNode => {
|
||||||
setDrawerOpen(false)
|
setDrawerOpen(false)
|
||||||
}, [navigation, track, setDrawerOpen])
|
}, [navigation, track, setDrawerOpen])
|
||||||
|
|
||||||
const onPressModeration = React.useCallback(() => {
|
|
||||||
track('Menu:ItemClicked', {url: 'Moderation'})
|
|
||||||
navigation.navigate('Moderation')
|
|
||||||
setDrawerOpen(false)
|
|
||||||
}, [navigation, track, setDrawerOpen])
|
|
||||||
|
|
||||||
const onPressSettings = React.useCallback(() => {
|
const onPressSettings = React.useCallback(() => {
|
||||||
track('Menu:ItemClicked', {url: 'Settings'})
|
track('Menu:ItemClicked', {url: 'Settings'})
|
||||||
navigation.navigate('Settings')
|
navigation.navigate('Settings')
|
||||||
|
@ -240,7 +233,6 @@ let DrawerContent = ({}: {}): React.ReactNode => {
|
||||||
/>
|
/>
|
||||||
<FeedsMenuItem isActive={isAtFeeds} onPress={onPressMyFeeds} />
|
<FeedsMenuItem isActive={isAtFeeds} onPress={onPressMyFeeds} />
|
||||||
<ListsMenuItem onPress={onPressLists} />
|
<ListsMenuItem onPress={onPressLists} />
|
||||||
<ModerationMenuItem onPress={onPressModeration} />
|
|
||||||
<ProfileMenuItem
|
<ProfileMenuItem
|
||||||
isActive={isAtMyProfile}
|
isActive={isAtMyProfile}
|
||||||
onPress={onPressProfile}
|
onPress={onPressProfile}
|
||||||
|
@ -507,25 +499,6 @@ let ListsMenuItem = ({onPress}: {onPress: () => void}): React.ReactNode => {
|
||||||
}
|
}
|
||||||
ListsMenuItem = React.memo(ListsMenuItem)
|
ListsMenuItem = React.memo(ListsMenuItem)
|
||||||
|
|
||||||
let ModerationMenuItem = ({
|
|
||||||
onPress,
|
|
||||||
}: {
|
|
||||||
onPress: () => void
|
|
||||||
}): React.ReactNode => {
|
|
||||||
const {_} = useLingui()
|
|
||||||
const pal = usePalette('default')
|
|
||||||
return (
|
|
||||||
<MenuItem
|
|
||||||
icon={<HandIcon strokeWidth={5} style={pal.text} size={24} />}
|
|
||||||
label={_(msg`Moderation`)}
|
|
||||||
accessibilityLabel={_(msg`Moderation`)}
|
|
||||||
accessibilityHint=""
|
|
||||||
onPress={onPress}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
ModerationMenuItem = React.memo(ModerationMenuItem)
|
|
||||||
|
|
||||||
let ProfileMenuItem = ({
|
let ProfileMenuItem = ({
|
||||||
isActive,
|
isActive,
|
||||||
onPress,
|
onPress,
|
||||||
|
|
|
@ -1,52 +1,52 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {StyleSheet, TouchableOpacity, View} from 'react-native'
|
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 {
|
import {
|
||||||
useLinkProps,
|
useLinkProps,
|
||||||
useNavigation,
|
useNavigation,
|
||||||
useNavigationState,
|
useNavigationState,
|
||||||
} from '@react-navigation/native'
|
} from '@react-navigation/native'
|
||||||
import {
|
|
||||||
FontAwesomeIcon,
|
import {isInvalidHandle} from '#/lib/strings/handles'
|
||||||
FontAwesomeIconStyle,
|
import {emitSoftReset} from '#/state/events'
|
||||||
} from '@fortawesome/react-native-fontawesome'
|
import {useFetchHandle} from '#/state/queries/handle'
|
||||||
import {Text} from 'view/com/util/text/Text'
|
import {useUnreadNotifications} from '#/state/queries/notifications/unread'
|
||||||
import {UserAvatar} from 'view/com/util/UserAvatar'
|
import {useProfileQuery} from '#/state/queries/profile'
|
||||||
import {Link} from 'view/com/util/Link'
|
import {useSession} from '#/state/session'
|
||||||
import {LoadingPlaceholder} from 'view/com/util/LoadingPlaceholder'
|
import {useComposerControls} from '#/state/shell/composer'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
||||||
import {s, colors} from 'lib/styles'
|
|
||||||
import {
|
import {
|
||||||
HomeIcon,
|
|
||||||
HomeIconSolid,
|
|
||||||
MagnifyingGlassIcon2,
|
|
||||||
MagnifyingGlassIcon2Solid,
|
|
||||||
BellIcon,
|
BellIcon,
|
||||||
BellIconSolid,
|
BellIconSolid,
|
||||||
UserIcon,
|
|
||||||
UserIconSolid,
|
|
||||||
CogIcon,
|
CogIcon,
|
||||||
CogIconSolid,
|
CogIconSolid,
|
||||||
ComposeIcon2,
|
ComposeIcon2,
|
||||||
ListIcon,
|
|
||||||
HashtagIcon,
|
HashtagIcon,
|
||||||
HandIcon,
|
HomeIcon,
|
||||||
|
HomeIconSolid,
|
||||||
|
ListIcon,
|
||||||
|
MagnifyingGlassIcon2,
|
||||||
|
MagnifyingGlassIcon2Solid,
|
||||||
|
UserIcon,
|
||||||
|
UserIconSolid,
|
||||||
} from 'lib/icons'
|
} from 'lib/icons'
|
||||||
import {getCurrentRoute, isTab, isStateAtTabRoot} from 'lib/routes/helpers'
|
import {getCurrentRoute, isStateAtTabRoot, isTab} from 'lib/routes/helpers'
|
||||||
import {NavigationProp, CommonNavigatorParams} from 'lib/routes/types'
|
|
||||||
import {router} from '../../../routes'
|
|
||||||
import {makeProfileLink} from 'lib/routes/links'
|
import {makeProfileLink} from 'lib/routes/links'
|
||||||
import {useLingui} from '@lingui/react'
|
import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types'
|
||||||
import {Trans, msg} from '@lingui/macro'
|
import {colors, s} from 'lib/styles'
|
||||||
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 {NavSignupCard} from '#/view/shell/NavSignupCard'
|
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() {
|
function ProfileCard() {
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
|
@ -382,24 +382,6 @@ export function DesktopLeftNav() {
|
||||||
}
|
}
|
||||||
label={_(msg`Lists`)}
|
label={_(msg`Lists`)}
|
||||||
/>
|
/>
|
||||||
<NavItem
|
|
||||||
href="/moderation"
|
|
||||||
icon={
|
|
||||||
<HandIcon
|
|
||||||
style={pal.text}
|
|
||||||
size={isDesktop ? 24 : 27}
|
|
||||||
strokeWidth={5.5}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
iconFilled={
|
|
||||||
<FontAwesomeIcon
|
|
||||||
icon="hand"
|
|
||||||
style={pal.text as FontAwesomeIconStyle}
|
|
||||||
size={isDesktop ? 23 : 26}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label={_(msg`Moderation`)}
|
|
||||||
/>
|
|
||||||
<NavItem
|
<NavItem
|
||||||
href={currentAccount ? makeProfileLink(currentAccount) : '/'}
|
href={currentAccount ? makeProfileLink(currentAccount) : '/'}
|
||||||
icon={
|
icon={
|
||||||
|
|
Loading…
Reference in New Issue