vega-frontend-monorepo/apps/trading/pages/index.page.tsx

52 lines
1.5 KiB
TypeScript
Raw Normal View History

import { Callout, Button } from '@vegaprotocol/ui-toolkit';
2022-02-24 00:10:31 +00:00
import { useVegaWallet } from '@vegaprotocol/react-helpers';
import { useEffect, useMemo, useState } from 'react';
2022-02-24 00:10:31 +00:00
import { Connectors } from '../lib/connectors';
2022-02-23 17:57:44 +00:00
export function Index() {
const { keypair, keypairs, selectPublicKey } = useVegaWallet();
return (
2022-03-10 00:33:56 +00:00
<div className="m-24">
<Callout
intent="help"
title="This is what this thing does"
iconName="endorsed"
headingLevel={1}
>
<div className="flex flex-col">
<div>With a longer explaination</div>
<Button className="block mt-8" variant="secondary">
Action
</Button>
</div>
</Callout>
<h1>Vega wallet</h1>
{keypair && <p>Current: {keypair.pub}</p>}
2022-03-10 00:33:56 +00:00
{keypairs?.length ? (
<select
name="change-key"
2022-02-28 22:29:05 +00:00
className="w-full px-8 py-2 border-black border"
2022-02-24 00:10:31 +00:00
value={keypair ? keypair.pub : 'none'}
onChange={(e) => selectPublicKey(e.target.value)}
>
<option value="none" disabled={true}>
Please select
</option>
{keypairs.map((pk) => (
<option key={pk.pub} value={pk.pub}>
{pk.name} ({pk.pub})
</option>
))}
</select>
2022-02-24 00:10:31 +00:00
) : null}
<h2>Public keys</h2>
2022-02-28 22:29:05 +00:00
<pre className="p-12 text-sm bg-neutral-100">
{JSON.stringify(keypairs, null, 2)}
</pre>
</div>
);
}
2022-02-23 17:57:44 +00:00
export default Index;