1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Refine notifications

https://github.com/tooot-app/app/issues/306

https://github.com/tooot-app/app/issues/305 This one uses the positive filtering that is added since v3.5, that a such a filter won't be shown as there is no way to check if a user is an admin or not and showing a useless option for majority users won't be a good experience.
This commit is contained in:
Zhiyuan Zheng
2022-05-28 19:24:08 +02:00
parent 5a23b73f69
commit 4398e520ed
24 changed files with 254 additions and 86 deletions

View File

@ -1,8 +1,9 @@
import { useNavigation } from '@react-navigation/native'
import { useAppDispatch } from '@root/store'
import { InstanceLatest } from '@utils/migrations/instances/migration'
import { TabMeStackNavigationProp } from '@utils/navigation/navigators'
import addInstance from '@utils/slices/instances/add'
import { checkInstanceFeature, Instance } from '@utils/slices/instancesSlice'
import { checkInstanceFeature } from '@utils/slices/instancesSlice'
import * as AuthSession from 'expo-auth-session'
import React, { useEffect } from 'react'
import { useQueryClient } from 'react-query'
@ -12,7 +13,7 @@ export interface Props {
instanceDomain: string
// Domain can be different than uri
instance: Mastodon.Instance
appData: Instance['appData']
appData: InstanceLatest['appData']
goBack?: boolean
}

View File

@ -34,7 +34,7 @@ const TimelineActioned = React.memo(
navigation.push('Tab-Shared-Account', { account })
}, [])
const children = useMemo(() => {
const children = () => {
switch (action) {
case 'pinned':
return (
@ -48,7 +48,6 @@ const TimelineActioned = React.memo(
{content(t('shared.actioned.pinned'))}
</>
)
break
case 'favourite':
return (
<>
@ -63,7 +62,6 @@ const TimelineActioned = React.memo(
</Pressable>
</>
)
break
case 'follow':
return (
<>
@ -78,7 +76,6 @@ const TimelineActioned = React.memo(
</Pressable>
</>
)
break
case 'follow_request':
return (
<>
@ -93,7 +90,6 @@ const TimelineActioned = React.memo(
</Pressable>
</>
)
break
case 'poll':
return (
<>
@ -106,7 +102,6 @@ const TimelineActioned = React.memo(
{content(t('shared.actioned.poll'))}
</>
)
break
case 'reblog':
return (
<>
@ -125,7 +120,6 @@ const TimelineActioned = React.memo(
</Pressable>
</>
)
break
case 'status':
return (
<>
@ -140,9 +134,22 @@ const TimelineActioned = React.memo(
</Pressable>
</>
)
break
case 'update':
return (
<>
<Icon
name='BarChart2'
size={StyleConstants.Font.Size.S}
color={iconColor}
style={styles.icon}
/>
{content(t('shared.actioned.update'))}
</>
)
default:
return <></>
}
}, [])
}
return (
<View
@ -153,8 +160,9 @@ const TimelineActioned = React.memo(
paddingLeft: StyleConstants.Avatar.M - StyleConstants.Font.Size.S,
paddingRight: StyleConstants.Spacing.Global.PagePadding
}}
children={children}
/>
>
{children()}
</View>
)
},
() => true