Fix menu translations

This commit is contained in:
xmflsct 2022-08-08 23:00:46 +02:00
parent 6b6481f9ac
commit a68ed6ea1b
4 changed files with 11 additions and 12 deletions

View File

@ -3,7 +3,7 @@
"versions": {
"native": "220806",
"major": 4,
"minor": 3,
"minor": 2,
"patch": 0,
"expo": "46.0.0"
},

View File

@ -41,8 +41,8 @@ const contextMenuAccount = ({
type: 'success',
message: t('common:message.success.message', {
function: t(`account.${theParams.payload.property}.action`, {
...(typeof theParams.payload.currentValue === 'boolean' && {
context: theParams.payload.currentValue.toString()
...(theParams.payload.property !== 'reports' && {
context: (theParams.payload.currentValue || false).toString()
})
})
})
@ -55,8 +55,8 @@ const contextMenuAccount = ({
type: 'error',
message: t('common:message.error.message', {
function: t(`account.${theParams.payload.property}.action`, {
...(typeof theParams.payload.currentValue === 'boolean' && {
context: theParams.payload.currentValue.toString()
...(theParams.payload.property !== 'reports' && {
context: (theParams.payload.currentValue || false).toString()
})
})
}),

View File

@ -6,11 +6,10 @@ import Icon from '@components/Icon'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useContext } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, View } from 'react-native'
import { Pressable, View } from 'react-native'
import ContextMenu, { ContextMenuAction } from 'react-native-context-menu-view'
import { ContextMenuContext } from './ContextMenu'
import HeaderSharedAccount from './HeaderShared/Account'
import HeaderSharedApplication from './HeaderShared/Application'
import HeaderSharedCreated from './HeaderShared/Created'

View File

@ -20,7 +20,7 @@ import HeaderSharedMuted from './HeaderShared/Muted'
import HeaderSharedVisibility from './HeaderShared/Visibility'
export interface Props {
queryKey?: QueryKeyTimeline
queryKey: QueryKeyTimeline
notification: Mastodon.Notification
}
@ -39,18 +39,18 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => {
: null
const statusOnPress = contextMenuStatus({
actions: contextMenuActions,
status,
status: status!,
queryKey
})
const accountOnPress = contextMenuAccount({
actions: contextMenuActions,
type: 'status',
queryKey,
id: status?.account.id
id: status!.account.id
})
const instanceOnPress = contextMenuInstance({
actions: contextMenuActions,
status,
status: status!,
queryKey
})