From ba319c3dd26d0a5f18ffece8a96c33b68c461a20 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 15 Nov 2022 21:53:35 -0600 Subject: [PATCH] View remote profile from 3-dots --- app/soapbox/features/account/components/header.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/soapbox/features/account/components/header.tsx b/app/soapbox/features/account/components/header.tsx index 21e44f33b..7e472829e 100644 --- a/app/soapbox/features/account/components/header.tsx +++ b/app/soapbox/features/account/components/header.tsx @@ -66,6 +66,7 @@ const messages = defineMessages({ removeFromFollowersConfirm: { id: 'confirmations.remove_from_followers.confirm', defaultMessage: 'Remove' }, userEndorsed: { id: 'account.endorse.success', defaultMessage: 'You are now featuring @{acct} on your profile' }, userUnendorsed: { id: 'account.unendorse.success', defaultMessage: 'You are no longer featuring @{acct}' }, + profileExternal: { id: 'account.profile_external', defaultMessage: 'View profile on {domain}' }, }); interface IHeader { @@ -173,6 +174,10 @@ const Header: React.FC = ({ account }) => { dispatch(unblockDomain(domain)); }; + const onProfileExternal = (url: string) => { + window.open(url, '_blank'); + }; + const onAddToList = () => { dispatch(openModal('LIST_ADDER', { accountId: account.id, @@ -421,6 +426,14 @@ const Header: React.FC = ({ account }) => { icon: require('@tabler/icons/ban.svg'), }); } + + if (features.federating) { + menu.push({ + text: intl.formatMessage(messages.profileExternal, { domain }), + action: () => onProfileExternal(account.url), + icon: require('@tabler/icons/external-link.svg'), + }); + } } if (ownAccount?.staff) {