From 4f22e4bd78a3b62cfd6c9c8e2de99447fd7dca96 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Mon, 31 Oct 2022 22:15:51 +0100 Subject: [PATCH] Fixed #425 --- src/components/ContextMenu/account.ts | 57 ++++++++++++++++++++------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/src/components/ContextMenu/account.ts b/src/components/ContextMenu/account.ts index 02b851b5..53a9aa44 100644 --- a/src/components/ContextMenu/account.ts +++ b/src/components/ContextMenu/account.ts @@ -9,6 +9,7 @@ import { import { getInstanceAccount } from '@utils/slices/instancesSlice' import { useTheme } from '@utils/styles/ThemeManager' import { useTranslation } from 'react-i18next' +import { Platform } from 'react-native' import { ContextMenuAction } from 'react-native-context-menu-view' import { useQueryClient } from 'react-query' import { useSelector } from 'react-redux' @@ -94,22 +95,50 @@ const contextMenuAccount = ({ context: (relationship?.muting || false).toString() }), systemIcon: 'eye.slash' - }, - { - id: 'account-block', - title: t('account.block.action', { - context: (relationship?.blocking || false).toString() - }), - systemIcon: 'xmark.circle', - destructive: true - }, - { - id: 'account-reports', - title: t('account.reports.action'), - systemIcon: 'flag', - destructive: true } ) + switch (Platform.OS) { + case 'ios': + actions.push({ + id: 'account', + title: t('account.title'), + actions: [ + { + id: 'account-block', + title: t('account.block.action', { + context: (relationship?.blocking || false).toString() + }), + systemIcon: 'xmark.circle', + destructive: true + }, + { + id: 'account-reports', + title: t('account.reports.action'), + systemIcon: 'flag', + destructive: true + } + ] + }) + break + default: + actions.push( + { + id: 'account-block', + title: t('account.block.action', { + context: (relationship?.blocking || false).toString() + }), + systemIcon: 'xmark.circle', + destructive: true + }, + { + id: 'account-reports', + title: t('account.reports.action'), + systemIcon: 'flag', + destructive: true + } + ) + break + } } return (index: number) => {