diff --git a/packages/app-accounts/src/Overview.tsx b/packages/app-accounts/src/Overview.tsx index 152a60fc21..4835290edd 100644 --- a/packages/app-accounts/src/Overview.tsx +++ b/packages/app-accounts/src/Overview.tsx @@ -2,20 +2,30 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { ComponentProps } from './types'; +import { I18nProps } from '@polkadot/ui-app/types'; import { SubjectInfo } from '@polkadot/ui-keyring/observable/types'; +import { ComponentProps } from './types'; import React from 'react'; import styled from 'styled-components'; import accountObservable from '@polkadot/ui-keyring/observable/accounts'; import { withMulti, withObservable } from '@polkadot/ui-api'; +import { Button } from '@polkadot/ui-app'; +import CreateModal from './modals/Create'; +import ImportModal from './modals/Import'; import Account from './Account'; +import translate from './translate'; -type Props = ComponentProps & { +type Props = ComponentProps & I18nProps & { accounts?: SubjectInfo[] }; +type State = { + isCreateOpen: boolean, + isImportOpen: boolean +}; + const Wrapper = styled.div` .accounts { display: flex; @@ -29,37 +39,71 @@ const Wrapper = styled.div` } `; -class Overview extends React.PureComponent { - constructor (props: Props) { - super(props); - } +class Overview extends React.PureComponent { + state: State = { + isCreateOpen: false, + isImportOpen: false + }; render () { - const { accounts } = this.props; - - if (!accounts || Object.keys(accounts).length === 0) { - return null; - } + const { accounts, onStatusChange, t } = this.props; + const { isCreateOpen, isImportOpen } = this.state; return ( + +