From 58c96c4c08b90e91d875d841df6999868eaca023 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Thu, 12 Jan 2023 21:44:28 +0100 Subject: [PATCH] Fix Android does not support menu sub --- .../Timeline/Shared/HeaderAndroid.tsx | 32 ++++-------- src/screens/Tabs/Shared/Account/index.tsx | 49 ++++++++++++------- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/components/Timeline/Shared/HeaderAndroid.tsx b/src/components/Timeline/Shared/HeaderAndroid.tsx index 9f9ec504..b81864af 100644 --- a/src/components/Timeline/Shared/HeaderAndroid.tsx +++ b/src/components/Timeline/Shared/HeaderAndroid.tsx @@ -68,28 +68,16 @@ const TimelineHeaderAndroid: React.FC = () => { ) case 'sub': return ( - // @ts-ignore - - - - {item.trigger.icon ? ( - - ) : null} - - - {item.items.map(sub => ( - - - {sub.icon ? ( - - ) : null} - - ))} - - + + {item.items.map(sub => ( + + + {sub.icon ? ( + + ) : null} + + ))} + ) } })} diff --git a/src/screens/Tabs/Shared/Account/index.tsx b/src/screens/Tabs/Shared/Account/index.tsx index cd74adef..15d8bb89 100644 --- a/src/screens/Tabs/Shared/Account/index.tsx +++ b/src/screens/Tabs/Shared/Account/index.tsx @@ -13,7 +13,7 @@ import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React, { Fragment, useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' -import { Text, View } from 'react-native' +import { Platform, Text, View } from 'react-native' import { useSharedValue } from 'react-native-reanimated' import * as DropdownMenu from 'zeego/dropdown-menu' import AccountAttachments from './Attachments' @@ -110,19 +110,34 @@ const TabSharedAccount: React.FC ) case 'sub': - return ( - // @ts-ignore - - - - {item.trigger.icon ? ( - - ) : null} - - + if (Platform.OS === 'ios') { + return ( + // @ts-ignore + + + + {item.trigger.icon ? ( + + ) : null} + + + {item.items.map(sub => ( + + + {sub.icon ? ( + + ) : null} + + ))} + + + ) + } else { + return ( + {item.items.map(sub => ( @@ -131,9 +146,9 @@ const TabSharedAccount: React.FC ) : null} ))} - - - ) + + ) + } } })}