add styles

This commit is contained in:
Sasha 2023-10-26 22:32:50 +02:00
parent 8e02635560
commit 0be9df014f
No known key found for this signature in database
3 changed files with 23 additions and 9 deletions

View File

@ -1,3 +1,4 @@
import React from "react";
import { Block, BlockTypes } from "@/components/Block";
import { Button } from "@/components/Button";
import { Status } from "@/components/Status";
@ -5,7 +6,17 @@ import { Subtitle } from "@/components/Subtitle";
import { useStore } from "@/hooks";
export const Keystore: React.FunctionComponent<{}> = () => {
const { keystoreStatus } = useStore();
const { keystoreStatus, keystoreCredentials } = useStore();
const credentialsNodes = React.useMemo(
() =>
keystoreCredentials.map((v) => (
<option key={v} value={v}>
{v}
</option>
)),
[keystoreCredentials]
);
return (
<Block className="mt-10">
@ -34,16 +45,20 @@ export const Keystore: React.FunctionComponent<{}> = () => {
</Block>
<Block className="mt-4">
<p className="text-s">Generate new credentials from wallet</p>
<p className="text-s mb-2">Generate new credentials from wallet</p>
<Button>Generate new credentials</Button>
<Button>Register credentials</Button>
<Button className="ml-5">Register credentials</Button>
</Block>
<Block className="mt-4">
<p className="text-s">Read from Keystore</p>
<select id="keystoreOptions"></select>
<Block type={BlockTypes.FlexHorizontal}>
<select className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-3/4 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
{credentialsNodes}
</select>
<Button>Read credentials</Button>
</Block>
</Block>
</Block>
);
};

View File

@ -34,7 +34,7 @@ export const useStore = create<StoreResult>((set) => {
setKeystoreStatus: (v: string) =>
set((state) => ({ ...state, keystoreStatus: v })),
activeCredential: DEFAULT_VALUE,
keystoreCredentials: [],
keystoreCredentials: [], // ["277026D55D6F3988FB4E4695F1DCA2F59B012581A854FEE6035EE1566F898908", "59FDF2A610545099326E736269EA2E297BCA0B2BA4D68D245130BF10F9FFAC43", "FC98D3EDD1CCB2AA4C25CCDDD18ADADC8C4BBA9BA11B9F652B2E5E9732D531D3"],
setActiveCredential: (v: string) =>
set((state) => ({ ...state, activeCredential: v })),
setKeystoreCredentials: (v: string[]) =>

View File

@ -59,14 +59,13 @@ export class RLN implements IRLN {
return;
}
const rlnInstance = await this.initRLNWasm();
await this.initRLNContract(rlnInstance);
// const rlnInstance = await this.initRLNWasm();
// await this.initRLNContract(rlnInstance);
this.emitStatusEvent(StatusEventPayload.RLN_INITIALIZED);
this.initKeystore();
// add keystore initialization
this.initialized = true;
}