diff --git a/packages/extension-ui/package.json b/packages/extension-ui/package.json
index 7483580c..7ea603a1 100644
--- a/packages/extension-ui/package.json
+++ b/packages/extension-ui/package.json
@@ -6,7 +6,8 @@
"license": "Apache-2",
"dependencies": {
"@polkadot/ui-identicon": "^0.39.0-beta.5",
- "@types/react-router-dom": "^4.3.2",
+ "@types/react-router": "^5.0.0",
+ "@types/react-router-dom": "^4.3.3",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0"
}
diff --git a/packages/extension-ui/src/Popup/Accounts/Account.tsx b/packages/extension-ui/src/Popup/Accounts/Account.tsx
index cb37634a..c7d4c0da 100644
--- a/packages/extension-ui/src/Popup/Accounts/Account.tsx
+++ b/packages/extension-ui/src/Popup/Accounts/Account.tsx
@@ -2,31 +2,58 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
-import React from 'react';
+import React, { useState } from 'react';
+import { Link } from 'react-router-dom';
import { ActionBar, Address } from '../../components';
-import { forgetAccount } from '../../messaging';
+import { editAccount } from '../../messaging';
+import { Name } from '../../partials';
type Props = {
+ className?: string,
address: string,
- name?: string,
+ name?: string | null,
onAction: () => void
};
-export default function Account ({ address, name, onAction }: Props) {
- const _onForget = (): void => {
- forgetAccount(address)
- .then(onAction)
- .catch(console.error);
+export default function Account ({ address, className, name, onAction }: Props) {
+ const [isEditing, setEditing] = useState(false);
+ const [editedname, setName] = useState(name);
+
+ const _toggleEdit = (): void => {
+ setEditing(!isEditing);
+ };
+ const _saveChanges = (): void => {
+ if (editedname && editedname !== name) {
+ editAccount(address, editedname)
+ .then(onAction)
+ .catch(console.error);
+ }
+
+ _toggleEdit();
};
return (
+ )
+ : name
+ }
>
- Forget
+ Edit
+ Forget
);
diff --git a/packages/extension-ui/src/Popup/Forget.tsx b/packages/extension-ui/src/Popup/Forget.tsx
new file mode 100644
index 00000000..e4ffe21d
--- /dev/null
+++ b/packages/extension-ui/src/Popup/Forget.tsx
@@ -0,0 +1,47 @@
+// Copyright 2019 @polkadot/extension-ui authors & contributors
+// This software may be modified and distributed under the terms
+// of the Apache-2.0 license. See the LICENSE file for details.
+
+import { KeyringJson } from '@polkadot/ui-keyring/types';
+
+import React from 'react';
+import { RouteComponentProps, withRouter } from 'react-router';
+
+import { Address, Button, Header, Tip } from '../components';
+import { forgetAccount } from '../messaging';
+import { Back } from '../partials';
+
+type Props = RouteComponentProps<{ address: string }> & {
+ accounts: Array,
+ onAction: () => void
+};
+
+function Forget (props: Props) {
+ const { accounts, match: { params: { address } }, onAction } = props;
+ const account = accounts.find((account) => address === account.address);
+
+ const _onClick = (): void => {
+ forgetAccount(address)
+ .then(onAction)
+ .catch(console.error);
+ };
+
+ return (
+
+
+
+ You are about to remove the account. This means that you will not be able to access it via this extension anymore. If you wish to recover it, you would need to use the seed.
+
+
+