parent
67346c83a1
commit
66eb434e31
@ -26,10 +26,16 @@ type State = {
|
||||
};
|
||||
|
||||
class Overview extends React.PureComponent<Props, State> {
|
||||
state: State = {
|
||||
isCreateOpen: false,
|
||||
isImportOpen: false
|
||||
};
|
||||
constructor (props: Props) {
|
||||
super(props);
|
||||
|
||||
const { state : { isCreateOpen = false } = {} } = this.props.location;
|
||||
|
||||
this.state = {
|
||||
isCreateOpen,
|
||||
isImportOpen: false
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
const { accounts, onStatusChange, t } = this.props;
|
||||
|
||||
@ -64,7 +64,7 @@ class Accounts extends React.PureComponent<Props, State> {
|
||||
You don't have any accounts. Some features are currently hidden and will only become available once you have accounts.
|
||||
{' '}
|
||||
<Link
|
||||
to ='/accounts'
|
||||
to = {{ pathname: '/accounts', state: { isCreateOpen: true } }}
|
||||
onClick={this.onClose}
|
||||
>
|
||||
{t('Create an account now.')}
|
||||
|
||||
@ -5,6 +5,9 @@
|
||||
import { WithTranslation } from 'react-i18next';
|
||||
import { RpcRxInterface } from '@polkadot/rpc-rx/types';
|
||||
import { ActionStatus } from '@polkadot/ui-app/Status/types';
|
||||
// location props passed by react-router from a link can contain a "state" object
|
||||
// this is used for Account creation link to popup the account creation modal
|
||||
import { LocationDescriptorObject } from 'history';
|
||||
|
||||
export type BareProps = {
|
||||
className?: string,
|
||||
@ -15,7 +18,7 @@ export type BareProps = {
|
||||
|
||||
export type AppProps = {
|
||||
basePath: string,
|
||||
location: Location,
|
||||
location: LocationDescriptorObject,
|
||||
onStatusChange: (status: ActionStatus) => void
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user