add custom algorithm screen to settings under moderation

zio/stable
Ansh Nanda 2023-05-12 14:40:58 -07:00
parent 678f75b495
commit 370d52bd1f
5 changed files with 47 additions and 0 deletions

View File

@ -52,6 +52,7 @@ import {AppPasswords} from 'view/screens/AppPasswords'
import {MutedAccounts} from 'view/screens/MutedAccounts'
import {BlockedAccounts} from 'view/screens/BlockedAccounts'
import {getRoutingInstrumentation} from 'lib/sentry'
import CustomAlgorithms from 'view/screens/CustomAlgorithms'
const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
@ -91,6 +92,7 @@ function commonScreens(Stack: typeof HomeTab) {
/>
<Stack.Screen name="CopyrightPolicy" component={CopyrightPolicyScreen} />
<Stack.Screen name="AppPasswords" component={AppPasswords} />
<Stack.Screen name="CustomAlgorithms" component={CustomAlgorithms} />
<Stack.Screen name="MutedAccounts" component={MutedAccounts} />
<Stack.Screen name="BlockedAccounts" component={BlockedAccounts} />
</>

View File

@ -20,6 +20,7 @@ export type CommonNavigatorParams = {
CommunityGuidelines: undefined
CopyrightPolicy: undefined
AppPasswords: undefined
CustomAlgorithms: undefined
MutedAccounts: undefined
BlockedAccounts: undefined
}

View File

@ -14,6 +14,7 @@ export const router = new Router({
Debug: '/sys/debug',
Log: '/sys/log',
AppPasswords: '/settings/app-passwords',
CustomAlgorithms: '/settings/custom-algorithms',
MutedAccounts: '/settings/muted-accounts',
BlockedAccounts: '/settings/blocked-accounts',
Support: '/support',

View File

@ -0,0 +1,27 @@
import {NativeStackScreenProps} from '@react-navigation/native-stack'
import {usePalette} from 'lib/hooks/usePalette'
import {CommonNavigatorParams} from 'lib/routes/types'
import {observer} from 'mobx-react-lite'
import React from 'react'
import {StyleSheet, View} from 'react-native'
import {withAuthRequired} from 'view/com/auth/withAuthRequired'
import {ViewHeader} from 'view/com/util/ViewHeader'
import {Text} from 'view/com/util/text/Text'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'CustomAlgorithms'>
const CustomAlgorithms = withAuthRequired(
observer((props: Props) => {
const pal = usePalette('default')
return (
<View>
<ViewHeader title="Custom Algorithms" showOnDesktop />
<Text>CustomAlgorithms</Text>
</View>
)
}),
)
export default CustomAlgorithms
const styles = StyleSheet.create({})

View File

@ -290,6 +290,22 @@ export const SettingsScreen = withAuthRequired(
<Text type="xl-bold" style={[pal.text, styles.heading]}>
Moderation
</Text>
<Link
testID="bookmarkedAlgosBtn"
style={[styles.linkCard, pal.view, isSwitching && styles.dimmed]}
accessibilityHint="Custom Algorithms"
accessibilityLabel="Opens screen with all bookmarked custom algorithms"
href="/settings/custom-algorithms">
<View style={[styles.iconContainer, pal.btn]}>
<FontAwesomeIcon
icon="rss"
style={pal.text as FontAwesomeIconStyle}
/>
</View>
<Text type="lg" style={pal.text}>
Custom Algorithms
</Text>
</Link>
<TouchableOpacity
testID="contentFilteringBtn"
style={[styles.linkCard, pal.view, isSwitching && styles.dimmed]}