From 5bc8108e26327d3505b30034e81dc3b1bed83ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 5 Jun 2022 08:45:51 +0200 Subject: [PATCH] Move account migration to settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/actions/admin.js | Bin 20050 -> 20031 bytes app/soapbox/components/sidebar_menu.tsx | 18 +---- app/soapbox/features/settings/index.tsx | 73 ++++++++++++------ .../features/ui/components/action-button.tsx | 2 +- .../features/ui/components/link_footer.tsx | 5 +- .../ui/components/unauthorized_modal.tsx | 2 +- app/soapbox/features/ui/index.tsx | 2 +- app/soapbox/utils/features.ts | 14 ++-- 8 files changed, 60 insertions(+), 56 deletions(-) diff --git a/app/soapbox/actions/admin.js b/app/soapbox/actions/admin.js index ad56f1fbb135a9d41dd749fe9f5164becf2171de..b3e382352aab81734453c9ffdbcb061dc9d3d1bc 100644 GIT binary patch delta 54 zcmcaKhjITL#tok&CnuOmZ5EJ9VFfcL$~$p_7?TC0csKvkI0X@XrdP(kIl=6cH~>5N B6psJ^ delta 85 zcmdl#hw;)J#tok&ne!YAHh+|?XJv9MnEX*vdUKb&6DLRz$kCV_tDwDEPIEphR6u&N bmOj_ynVQO*S@b>G;eu<;*f-~yT@(iZWse@v diff --git a/app/soapbox/components/sidebar_menu.tsx b/app/soapbox/components/sidebar_menu.tsx index 2f8be96b1f..7d47baa470 100644 --- a/app/soapbox/components/sidebar_menu.tsx +++ b/app/soapbox/components/sidebar_menu.tsx @@ -311,7 +311,7 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { /> )} - {features.importAPI && ( + {features.import && ( { /> )} - {features.federating && (features.accountMoving ? ( - - ) : features.accountAliasesAPI && ( - - ))} -
{ const navigateToSessions = () => history.push('/settings/tokens'); const navigateToEditProfile = () => history.push('/settings/profile'); const navigateToDeleteAccount = () => history.push('/settings/account'); + const navigateToMoveAccount = () => history.push('/settings/migration'); + const navigateToAliases = () => history.push('/settings/aliases'); const isMfaEnabled = mfa.getIn(['settings', 'totp']); @@ -69,24 +73,32 @@ const Settings = () => { - - - + {features.security || features.sessions && ( + <> + + + - - - - - - {isMfaEnabled ? - intl.formatMessage(messages.mfaEnabled) : - intl.formatMessage(messages.mfaDisabled)} - - {features.sessionsAPI && ( - - )} - - + + + {features.security && ( + <> + + + + {isMfaEnabled ? + intl.formatMessage(messages.mfaEnabled) : + intl.formatMessage(messages.mfaDisabled)} + + + )} + {features.sessions && ( + + )} + + + + )} @@ -96,15 +108,26 @@ const Settings = () => { - - - + {features.security || features.accountAliases && ( + <> + + + - - - - - + + + {features.security && ( + + )} + {features.federating && (features.accountMoving ? ( + + ) : features.accountAliases && ( + + ))} + + + + )} ); diff --git a/app/soapbox/features/ui/components/action-button.tsx b/app/soapbox/features/ui/components/action-button.tsx index 51348ee1de..205aed90fb 100644 --- a/app/soapbox/features/ui/components/action-button.tsx +++ b/app/soapbox/features/ui/components/action-button.tsx @@ -118,7 +118,7 @@ const ActionButton: React.FC = ({ account, actionType, small }) = /** Render a remote follow button, depending on features. */ const renderRemoteFollow = () => { // Remote follow through the API. - if (features.remoteInteractionsAPI) { + if (features.remoteInteractions) { return (