diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/admin/Home.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/admin/Home.tsx | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/packages/demobank-ui/src/pages/admin/Home.tsx b/packages/demobank-ui/src/pages/admin/Home.tsx index e1ec6cfe0..f7d4e426e 100644 --- a/packages/demobank-ui/src/pages/admin/Home.tsx +++ b/packages/demobank-ui/src/pages/admin/Home.tsx @@ -17,17 +17,20 @@ import { RemoveAccount } from "./RemoveAccount.js"; interface Props { onRegister: () => void; } -export type AccountAction = "show-details" | - "show-cashout" | - "update-password" | - "remove-account" | +export type AccountAction = "show-details" | + "show-cashout" | + "update-password" | + "remove-account" | "show-cashouts-details"; export function AdminHome({ onRegister }: Props): VNode { const [action, setAction] = useState<{ type: AccountAction, account: string - }>() + } | undefined>({ + type:"remove-account", + account:"gnunet-at-sandbox" + }) const [createAccount, setCreateAccount] = useState(false); @@ -78,7 +81,7 @@ export function AdminHome({ onRegister }: Props): VNode { notifyInfo(i18n.str`Password changed`); setAction(undefined); }} - onClear={() => { + onCancel={() => { setAction(undefined); }} /> @@ -89,7 +92,7 @@ export function AdminHome({ onRegister }: Props): VNode { notifyInfo(i18n.str`Account removed`); setAction(undefined); }} - onClear={() => { + onCancel={() => { setAction(undefined); }} /> @@ -116,7 +119,7 @@ export function AdminHome({ onRegister }: Props): VNode { if (createAccount) { return ( <CreateNewAccount - onClose={() => setCreateAccount(false)} + onCancel={() => setCreateAccount(false)} onCreateSuccess={(password) => { notifyInfo( i18n.str`Account created with password "${password}". The user must change the password on the next login.`, @@ -129,34 +132,18 @@ export function AdminHome({ onRegister }: Props): VNode { return ( <Fragment> - <div> - <h1 class="nav welcome-text"> - <i18n.Translate>Admin panel</i18n.Translate> - </h1> - </div> - <p> - <div style={{ display: "flex", justifyContent: "space-between" }}> - <div></div> - <div> - <input - class="pure-button pure-button-primary content" - type="submit" - value={i18n.str`Create account`} - onClick={async (e) => { - e.preventDefault(); - - setCreateAccount(true); - }} - /> - </div> - </div> - </p> + <AccountList + onCreateAccount={() => { + setCreateAccount(true); + }} + account={undefined} + onAction={(type, account) => setAction({ account, type })} + onRegister={onRegister} + /> <AdminAccount onRegister={onRegister} /> - <AccountList account={undefined} onAction={(type,account) => setAction({account, type})} onRegister={onRegister}/> - </Fragment> ); }
\ No newline at end of file |