mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-05 06:13:11 +00:00
alight UI
This commit is contained in:
parent
45fb16e71f
commit
0a53a1f974
68
examples/rln-js/package-lock.json
generated
68
examples/rln-js/package-lock.json
generated
@ -10,7 +10,8 @@
|
||||
"dependencies": {
|
||||
"next": "13.5.6",
|
||||
"react": "^18",
|
||||
"react-dom": "^18"
|
||||
"react-dom": "^18",
|
||||
"zustand": "^4.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20",
|
||||
@ -411,13 +412,13 @@
|
||||
"version": "15.7.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.9.tgz",
|
||||
"integrity": "sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==",
|
||||
"dev": true
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.31",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.31.tgz",
|
||||
"integrity": "sha512-c2UnPv548q+5DFh03y8lEDeMfDwBn9G3dRwfkrxQMo/dOtRHUUO57k6pHvBIfH/VF4Nh+98mZ5aaSe+2echD5g==",
|
||||
"dev": true,
|
||||
"devOptional": true,
|
||||
"dependencies": {
|
||||
"@types/prop-types": "*",
|
||||
"@types/scheduler": "*",
|
||||
@ -437,7 +438,7 @@
|
||||
"version": "0.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.5.tgz",
|
||||
"integrity": "sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==",
|
||||
"dev": true
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "6.9.0",
|
||||
@ -1114,7 +1115,7 @@
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==",
|
||||
"dev": true
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/damerau-levenshtein": {
|
||||
"version": "1.0.8",
|
||||
@ -4210,6 +4211,14 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/use-sync-external-store": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
|
||||
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
@ -4351,6 +4360,33 @@
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/zustand": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.4.tgz",
|
||||
"integrity": "sha512-5UTUIAiHMNf5+mFp7/AnzJXS7+XxktULFN0+D1sCiZWyX7ZG+AQpqs2qpYrynRij4QvoDdCD+U+bmg/cG3Ucxw==",
|
||||
"dependencies": {
|
||||
"use-sync-external-store": "1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.7.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": ">=16.8",
|
||||
"immer": ">=9.0",
|
||||
"react": ">=16.8"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"immer": {
|
||||
"optional": true
|
||||
},
|
||||
"react": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
@ -4602,13 +4638,13 @@
|
||||
"version": "15.7.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.9.tgz",
|
||||
"integrity": "sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==",
|
||||
"dev": true
|
||||
"devOptional": true
|
||||
},
|
||||
"@types/react": {
|
||||
"version": "18.2.31",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.31.tgz",
|
||||
"integrity": "sha512-c2UnPv548q+5DFh03y8lEDeMfDwBn9G3dRwfkrxQMo/dOtRHUUO57k6pHvBIfH/VF4Nh+98mZ5aaSe+2echD5g==",
|
||||
"dev": true,
|
||||
"devOptional": true,
|
||||
"requires": {
|
||||
"@types/prop-types": "*",
|
||||
"@types/scheduler": "*",
|
||||
@ -4628,7 +4664,7 @@
|
||||
"version": "0.16.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.5.tgz",
|
||||
"integrity": "sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==",
|
||||
"dev": true
|
||||
"devOptional": true
|
||||
},
|
||||
"@typescript-eslint/parser": {
|
||||
"version": "6.9.0",
|
||||
@ -5080,7 +5116,7 @@
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==",
|
||||
"dev": true
|
||||
"devOptional": true
|
||||
},
|
||||
"damerau-levenshtein": {
|
||||
"version": "1.0.8",
|
||||
@ -7297,6 +7333,12 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"use-sync-external-store": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
|
||||
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
|
||||
"requires": {}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
@ -7402,6 +7444,14 @@
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"zustand": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.4.tgz",
|
||||
"integrity": "sha512-5UTUIAiHMNf5+mFp7/AnzJXS7+XxktULFN0+D1sCiZWyX7ZG+AQpqs2qpYrynRij4QvoDdCD+U+bmg/cG3Ucxw==",
|
||||
"requires": {
|
||||
"use-sync-external-store": "1.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,19 +9,20 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "13.5.6",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"next": "13.5.6"
|
||||
"zustand": "^4.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"autoprefixer": "^10",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "13.5.6",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "13.5.6"
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
|
||||
24
examples/rln-js/src/app/home/components/Blockchain.tsx
Normal file
24
examples/rln-js/src/app/home/components/Blockchain.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { Block, BlockTypes } from "@/components/Block";
|
||||
import { Button } from "@/components/Button";
|
||||
import { Subtitle } from "@/components/Subtitle";
|
||||
|
||||
export const Blockchain: React.FunctionComponent<{}> = () => {
|
||||
return (
|
||||
<Block top="10">
|
||||
<Block bottom="3" type={BlockTypes.FlexHorizontal}>
|
||||
<Subtitle>Contract</Subtitle>
|
||||
<Button>Fetch state</Button>
|
||||
</Block>
|
||||
|
||||
<Block type={BlockTypes.FlexHorizontal}>
|
||||
<p>Your address</p>
|
||||
<code>Not loaded yet</code>
|
||||
</Block>
|
||||
|
||||
<Block type={BlockTypes.FlexHorizontal}>
|
||||
<p>Latest membership ID on contract</p>
|
||||
<code>Not loaded yet</code>
|
||||
</Block>
|
||||
</Block>
|
||||
);
|
||||
};
|
||||
19
examples/rln-js/src/app/home/components/Header.tsx
Normal file
19
examples/rln-js/src/app/home/components/Header.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { Block, BlockTypes } from "@/components/Block";
|
||||
import { Title } from "@/components/Title";
|
||||
import { Button } from "@/components/Button";
|
||||
import { Status } from "@/components/Status";
|
||||
import { useStore } from "@/store";
|
||||
|
||||
export const Header: React.FunctionComponent<{}> = () => {
|
||||
const { appStatus } = useStore();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Block bottom="5" type={BlockTypes.FlexHorizontal}>
|
||||
<Title>Waku RLN</Title>
|
||||
<Button>Connect Wallet</Button>
|
||||
</Block>
|
||||
<Status text="Application status" mark={appStatus} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
49
examples/rln-js/src/app/home/components/Keystore.tsx
Normal file
49
examples/rln-js/src/app/home/components/Keystore.tsx
Normal file
@ -0,0 +1,49 @@
|
||||
import { Block, BlockTypes } from "@/components/Block";
|
||||
import { Button } from "@/components/Button";
|
||||
import { Status } from "@/components/Status";
|
||||
import { Subtitle } from "@/components/Subtitle";
|
||||
import { useStore } from "@/store";
|
||||
|
||||
export const Keystore: React.FunctionComponent<{}> = () => {
|
||||
const { keystoreStatus } = useStore();
|
||||
|
||||
return (
|
||||
<Block top="10">
|
||||
<Block type={BlockTypes.FlexHorizontal}>
|
||||
<Subtitle>Keystore</Subtitle>
|
||||
<div>
|
||||
<Button>Import</Button>
|
||||
<Button left="2">Export</Button>
|
||||
</div>
|
||||
</Block>
|
||||
|
||||
<Status text="Keystore status" mark={keystoreStatus} />
|
||||
|
||||
<Block top="4">
|
||||
<label
|
||||
htmlFor="keystore-input"
|
||||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
||||
>
|
||||
Password(used for reading/saving into Keystore)
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="keystore-input"
|
||||
className="bg-gray-50 border border-gray-300 text-gray-900 text-sm w-full rounded-lg focus:ring-blue-500 focus:border-blue-500 block 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"
|
||||
/>
|
||||
</Block>
|
||||
|
||||
<Block top="4">
|
||||
<p className="text-s">Generate new credentials from wallet</p>
|
||||
<Button>Generate new credentials</Button>
|
||||
<Button>Register credentials</Button>
|
||||
</Block>
|
||||
|
||||
<Block top="4">
|
||||
<p className="text-s">Read from Keystore</p>
|
||||
<select id="keystoreOptions"></select>
|
||||
<Button>Read credentials</Button>
|
||||
</Block>
|
||||
</Block>
|
||||
);
|
||||
};
|
||||
37
examples/rln-js/src/app/home/components/KeystoreDetails.tsx
Normal file
37
examples/rln-js/src/app/home/components/KeystoreDetails.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { Block, BlockTypes } from "@/components/Block";
|
||||
|
||||
export const KeystoreDetails: React.FunctionComponent<{}> = () => {
|
||||
return (
|
||||
<Block top="5">
|
||||
<Block top="3" type={BlockTypes.FlexHorizontal}>
|
||||
<p>Keystore</p>
|
||||
<code>none</code>
|
||||
</Block>
|
||||
|
||||
<Block top="3" type={BlockTypes.FlexHorizontal}>
|
||||
<p>Membership ID</p>
|
||||
<code>none</code>
|
||||
</Block>
|
||||
|
||||
<Block top="3" type={BlockTypes.FlexHorizontal}>
|
||||
<p>Secret Hash</p>
|
||||
<code>none</code>
|
||||
</Block>
|
||||
|
||||
<Block top="3" type={BlockTypes.FlexHorizontal}>
|
||||
<p>Commitment</p>
|
||||
<code>none</code>
|
||||
</Block>
|
||||
|
||||
<Block top="3" type={BlockTypes.FlexHorizontal}>
|
||||
<p>Nullifier</p>
|
||||
<code>none</code>
|
||||
</Block>
|
||||
|
||||
<Block top="3" type={BlockTypes.FlexHorizontal}>
|
||||
<p>Trapdoor</p>
|
||||
<code>none</code>
|
||||
</Block>
|
||||
</Block>
|
||||
);
|
||||
};
|
||||
71
examples/rln-js/src/app/home/components/Waku.tsx
Normal file
71
examples/rln-js/src/app/home/components/Waku.tsx
Normal file
@ -0,0 +1,71 @@
|
||||
import { Block, BlockTypes } from "@/components/Block";
|
||||
import { Subtitle } from "@/components/Subtitle";
|
||||
import { Status } from "@/components/Status";
|
||||
import { Button } from "@/components/Button";
|
||||
import { useStore } from "@/store";
|
||||
|
||||
export const Waku: React.FunctionComponent<{}> = () => {
|
||||
const { wakuStatus } = useStore();
|
||||
|
||||
return (
|
||||
<Block top="10">
|
||||
<Subtitle>Waku</Subtitle>
|
||||
<Status text="Waku status" mark={wakuStatus} />
|
||||
|
||||
<Block top="4">
|
||||
<label
|
||||
htmlFor="remote-multiaddr"
|
||||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
||||
>
|
||||
Password(used for reading/saving into Keystore)
|
||||
</label>
|
||||
<Block type={BlockTypes.FlexHorizontal}>
|
||||
<input
|
||||
type="text"
|
||||
id="remote-multiaddr"
|
||||
className="w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block 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"
|
||||
defaultValue="/dns4/node-01.ac-cn-hongkong-c.wakuv2.test.statusim.net/tcp/443/wss/p2p/16Uiu2HAkvWiyFsgRhuJEb9JfjYxEkoHLgnUQmr1N5mKWnYjxYRVm"
|
||||
/>
|
||||
<Button left="2">Dial</Button>
|
||||
</Block>
|
||||
</Block>
|
||||
|
||||
<Block top="4">
|
||||
<label
|
||||
htmlFor="nick-input"
|
||||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
||||
>
|
||||
Your nickname
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="nick-input"
|
||||
className="w-full mr-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block 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"
|
||||
placeholder="Choose a nickname"
|
||||
/>
|
||||
</Block>
|
||||
|
||||
<Block top="4">
|
||||
<Block>
|
||||
<label
|
||||
htmlFor="message-input"
|
||||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
||||
>
|
||||
Message
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="message-input"
|
||||
className="w-full mr-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block 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"
|
||||
placeholder="Text your message here"
|
||||
/>
|
||||
</Block>
|
||||
<Button top="2">Send</Button>
|
||||
</Block>
|
||||
|
||||
<Block top="4">
|
||||
<p className="text-l mb-4">Messages</p>
|
||||
</Block>
|
||||
</Block>
|
||||
);
|
||||
};
|
||||
18
examples/rln-js/src/app/home/page.tsx
Normal file
18
examples/rln-js/src/app/home/page.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
"use client";
|
||||
import { Header } from "./components/Header";
|
||||
import { Waku } from "./components/Waku";
|
||||
import { Keystore } from "./components/Keystore";
|
||||
import { Blockchain } from "./components/Blockchain";
|
||||
import { KeystoreDetails } from "./components/KeystoreDetails";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col p-24 font-mono">
|
||||
<Header />
|
||||
<Blockchain />
|
||||
<Keystore />
|
||||
<KeystoreDetails />
|
||||
<Waku />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@ -5,8 +5,8 @@ import "./globals.css";
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: "RLN Example",
|
||||
description: "Showcases RLN, Keystore and generation of proofs",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
|
||||
113
examples/rln-js/src/app/old/page.tsx
Normal file
113
examples/rln-js/src/app/old/page.tsx
Normal file
@ -0,0 +1,113 @@
|
||||
import Image from "next/image";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-between p-24">
|
||||
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
|
||||
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
|
||||
Get started by editing
|
||||
<code className="font-mono font-bold">src/app/page.tsx</code>
|
||||
</p>
|
||||
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
|
||||
<a
|
||||
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
|
||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
By{" "}
|
||||
<Image
|
||||
src="/vercel.svg"
|
||||
alt="Vercel Logo"
|
||||
className="dark:invert"
|
||||
width={100}
|
||||
height={24}
|
||||
priority
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
|
||||
<Image
|
||||
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
|
||||
src="/next.svg"
|
||||
alt="Next.js Logo"
|
||||
width={180}
|
||||
height={37}
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
|
||||
<a
|
||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Docs{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Find in-depth information about Next.js features and API.
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Learn{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Learn about Next.js in an interactive course with quizzes!
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Templates{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Explore the Next.js 13 playground.
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Deploy{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Instantly deploy your Next.js site to a shareable URL with Vercel.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@ -1,113 +1,3 @@
|
||||
import Image from "next/image";
|
||||
import Home from "@/app/home/page";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col items-center justify-between p-24">
|
||||
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
|
||||
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
|
||||
Get started by editing
|
||||
<code className="font-mono font-bold">src/app/page.tsx</code>
|
||||
</p>
|
||||
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
|
||||
<a
|
||||
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
|
||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
By{" "}
|
||||
<Image
|
||||
src="/vercel.svg"
|
||||
alt="Vercel Logo"
|
||||
className="dark:invert"
|
||||
width={100}
|
||||
height={24}
|
||||
priority
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
|
||||
<Image
|
||||
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
|
||||
src="/next.svg"
|
||||
alt="Next.js Logo"
|
||||
width={180}
|
||||
height={37}
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
|
||||
<a
|
||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Docs{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Find in-depth information about Next.js features and API.
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Learn{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Learn about Next.js in an interactive course with quizzes!
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Templates{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Explore the Next.js 13 playground.
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h2 className={`mb-3 text-2xl font-semibold`}>
|
||||
Deploy{" "}
|
||||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
||||
->
|
||||
</span>
|
||||
</h2>
|
||||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
||||
Instantly deploy your Next.js site to a shareable URL with Vercel.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
export default Home;
|
||||
|
||||
29
examples/rln-js/src/components/Block.tsx
Normal file
29
examples/rln-js/src/components/Block.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
export enum BlockTypes {
|
||||
FlexHorizontal = "flex-horizontal",
|
||||
}
|
||||
|
||||
type BlockProps = {
|
||||
children: any;
|
||||
top?: string;
|
||||
bottom?: string;
|
||||
type?: BlockTypes;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export const Block: React.FunctionComponent<BlockProps> = (props) => {
|
||||
const flexClassNames =
|
||||
props.type === BlockTypes.FlexHorizontal
|
||||
? "items-center justify-between lg:flex"
|
||||
: "";
|
||||
const restClassNames = props.className || "";
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`mt-${props.top || 0} mb-${
|
||||
props.bottom || 0
|
||||
} ${flexClassNames} ${restClassNames}`}
|
||||
>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
17
examples/rln-js/src/components/Button.tsx
Normal file
17
examples/rln-js/src/components/Button.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
type ButtonProps = {
|
||||
children: any;
|
||||
top?: string;
|
||||
left?: string;
|
||||
onClick?: (e?: any) => void;
|
||||
};
|
||||
|
||||
export const Button: React.FunctionComponent<ButtonProps> = (props) => (
|
||||
<button
|
||||
onClick={props.onClick}
|
||||
className={`ml-${props.left || 0} mt-${
|
||||
props.top || 0
|
||||
} py-2.5 px-5 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700`}
|
||||
>
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
13
examples/rln-js/src/components/Status.tsx
Normal file
13
examples/rln-js/src/components/Status.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
type StatusProps = {
|
||||
text: string;
|
||||
mark: string;
|
||||
};
|
||||
|
||||
export const Status: React.FunctionComponent<StatusProps> = (props) => (
|
||||
<p className="text-s">
|
||||
{props.text}:{" "}
|
||||
<span className="underline underline-offset-3 decoration-4 decoration-blue-400 dark:decoration-blue-600">
|
||||
{props.mark}
|
||||
</span>
|
||||
</p>
|
||||
);
|
||||
8
examples/rln-js/src/components/Subtitle.tsx
Normal file
8
examples/rln-js/src/components/Subtitle.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
type SubtitleProps = {
|
||||
children: any;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export const Subtitle: React.FunctionComponent<SubtitleProps> = (props) => (
|
||||
<h2 className={`text-2xl ${props.className || ""}`}>{props.children}</h2>
|
||||
);
|
||||
8
examples/rln-js/src/components/Title.tsx
Normal file
8
examples/rln-js/src/components/Title.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
type TitleProps = {
|
||||
children: any;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export const Title: React.FunctionComponent<TitleProps> = (props) => (
|
||||
<h1 className={`text-4xl ${props.className || ""}`}>{props.children}</h1>
|
||||
);
|
||||
25
examples/rln-js/src/store/index.ts
Normal file
25
examples/rln-js/src/store/index.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
type StoreResult = {
|
||||
appStatus: string;
|
||||
setAppStatus: (v: string) => void;
|
||||
keystoreStatus: string;
|
||||
setKeystoreStatus: (v: string) => void;
|
||||
wakuStatus: string;
|
||||
setWakuStatus: (v: string) => void;
|
||||
};
|
||||
|
||||
const DEFAULT_VALUE = "none";
|
||||
|
||||
export const useStore = create<StoreResult>((set) => ({
|
||||
appStatus: DEFAULT_VALUE,
|
||||
setAppStatus: (v: string) => set((state) => ({ ...state, appStatus: v })),
|
||||
|
||||
keystoreStatus: DEFAULT_VALUE,
|
||||
setKeystoreStatus: (v: string) =>
|
||||
set((state) => ({ ...state, keystoreStatus: v })),
|
||||
|
||||
wakuStatus: DEFAULT_VALUE,
|
||||
setWakuStatus: (v: string) =>
|
||||
set((state) => ({ ...state, keystoreStatus: v })),
|
||||
}));
|
||||
Loading…
x
Reference in New Issue
Block a user