ghost-keychain/packages/extension-ui/src/Popup/Forget.tsx
Jaco Greeff d8728e473e
Display requests with Iconbox (#32)
* Display requests with Iconbox

* Make (X) clickable

* Remove cc-test-reporter
2019-05-26 14:56:18 +02:00

41 lines
1.3 KiB
TypeScript

// 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 { OnActionFromCtx } from '../components/types';
import React from 'react';
import { RouteComponentProps, withRouter } from 'react-router';
import { Address, Button, Header, Tip, withOnAction } from '../components';
import { forgetAccount } from '../messaging';
import { Back } from '../partials';
type Props = RouteComponentProps<{ address: string }> & {
onAction: OnActionFromCtx
};
function Forget ({ match: { params: { address } }, onAction }: Props) {
const onClick = () =>
forgetAccount(address)
.then(() => onAction('/'))
.catch(console.error);
return (
<div>
<Header label='forget account' />
<Back />
<Address address={address}>
<Tip header='danger' type='error'>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.</Tip>
<Button
isDanger
label='I want to forget this account'
onClick={onClick}
/>
</Address>
</div>
);
}
export default withOnAction(withRouter(Forget));