// Copyright 2019-2020 @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 React, { useCallback, useState } from 'react'; import { Address, BackButton, ButtonArea, NextStepButton, VerticalSpace } from '../../components'; import { Name, Password } from '../../partials'; interface Props { address: string; onBackClick: () => void; onCreate: (name: string, password: string) => void | Promise; } function AccountName ({ address, onBackClick, onCreate }: Props): React.ReactElement { const [name, setName] = useState(null); const [password, setPassword] = useState(null); const _onCreate = useCallback(() => name && password && onCreate(name, password), [name, password, onCreate]); return ( <> {name && } {name && password && (
)} Add the account with the generated seed ); } export default AccountName;