diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx
index c531dc50d6..1dd8dc851f 100644
--- a/packages/page-accounts/src/Accounts/Account.tsx
+++ b/packages/page-accounts/src/Accounts/Account.tsx
@@ -20,10 +20,11 @@ import keyring from '@polkadot/ui-keyring';
import { BN_ZERO, formatBalance, formatNumber } from '@polkadot/util';
import { useTranslation } from '../translate';
+import { createMenuGroup } from '../util';
import Backup from './modals/Backup';
import ChangePass from './modals/ChangePass';
import Derive from './modals/Derive';
-import Identity from './modals/Identity';
+import IdentityMain from './modals/IdentityMain';
import MultisigApprove from './modals/MultisigApprove';
import RecoverAccount from './modals/RecoverAccount';
import RecoverSetup from './modals/RecoverSetup';
@@ -81,7 +82,7 @@ function Account ({ account: { address, meta }, className = '', filter, isFavori
const [isBackupOpen, toggleBackup] = useToggle();
const [isDeriveOpen, toggleDerive] = useToggle();
const [isForgetOpen, toggleForget] = useToggle();
- const [isIdentityOpen, toggleIdentity] = useToggle();
+ const [isIdentityMainOpen, toggleIdentityMain] = useToggle();
const [isMultisigOpen, toggleMultisig] = useToggle();
const [isPasswordOpen, togglePassword] = useToggle();
const [isRecoverAccountOpen, toggleRecoverAccount] = useToggle();
@@ -263,11 +264,11 @@ function Account ({ account: { address, meta }, className = '', filter, isFavori
onForget={_onForget}
/>
)}
- {isIdentityOpen && (
-
)}
{isPasswordOpen && (
@@ -355,84 +356,99 @@ function Account ({ account: { address, meta }, className = '', filter, isFavori
text
vertical
>
-
- {t('Set on-chain identity')}
-
-
- {t('Clear expired democracy locks')}
-
-
-
- {t('Derive account via derivation path')}
-
- {isHardware && (
-
- {t('Show address on hardware device')}
-
- )}
-
-
- {t('Create a backup file for this account')}
-
-
- {t("Change this account's password")}
-
-
- {t('Forget this account')}
-
- {api.api.tx.recovery?.createRecovery && (
- <>
-
- {!recoveryInfo && (
-
- {t('Make recoverable')}
-
- )}
-
- {t('Initiate recovery for another')}
-
- >
- )}
- {isMultisig && (
- <>
-
+ {createMenuGroup([
+ api.api.tx.identity?.setIdentity && (
- {t('Multisig approvals')}
+ {t('Set on-chain identity')}
- >
- )}
- {!api.isDevelopment && (
- <>
-
-
- >
- )}
+ ),
+ api.api.tx.democracy?.unlock && democracyUnlockTx && (
+
+ {t('Clear expired democracy locks')}
+
+ )
+ ])}
+ {createMenuGroup([
+ !(isExternal || isHardware || isInjected || isMultisig) && (
+
+ {t('Derive account via derivation path')}
+
+ ),
+ isHardware && (
+
+ {t('Show address on hardware device')}
+
+ )
+ ])}
+ {createMenuGroup([
+ !(isExternal || isInjected || isMultisig || isDevelopment) && (
+
+ {t('Create a backup file for this account')}
+
+ ),
+ !(isExternal || isInjected || isMultisig || isDevelopment) && (
+
+ {t("Change this account's password")}
+
+ ),
+ !(isInjected || isDevelopment) && (
+
+ {t('Forget this account')}
+
+ )
+ ])}
+ {api.api.tx.recovery?.createRecovery && createMenuGroup([
+ !recoveryInfo && (
+
+ {t('Make recoverable')}
+
+ ),
+
+ {t('Initiate recovery for another')}
+
+ ])}
+ {api.api.tx.multisig?.asMulti && isMultisig && createMenuGroup([
+
+ {t('Multisig approvals')}
+
+ ])}
+
diff --git a/packages/page-accounts/src/Accounts/modals/Identity.tsx b/packages/page-accounts/src/Accounts/modals/IdentityMain.tsx
similarity index 98%
rename from packages/page-accounts/src/Accounts/modals/Identity.tsx
rename to packages/page-accounts/src/Accounts/modals/IdentityMain.tsx
index 4b90811996..408f055f87 100644
--- a/packages/page-accounts/src/Accounts/modals/Identity.tsx
+++ b/packages/page-accounts/src/Accounts/modals/IdentityMain.tsx
@@ -69,7 +69,7 @@ function checkValue (hasValue: boolean, value: string | null | undefined, minLen
);
}
-function Identity ({ address, className = '', onClose }: Props): React.ReactElement {
+function IdentityMain ({ address, className = '', onClose }: Props): React.ReactElement {
const { t } = useTranslation();
const { api } = useApi();
const identityOpt = useCall