mirror of
https://github.com/logos-messaging/logos-messaging-frontend.git
synced 2026-01-02 13:53:13 +00:00
move chat to root page
This commit is contained in:
parent
6cc8f45028
commit
d66235c07c
@ -1,58 +0,0 @@
|
||||
"use client";
|
||||
import { Header } from "@/app/components/Header";
|
||||
import { Waku } from "@/app/components/Waku";
|
||||
import { useWaku } from "@/hooks";
|
||||
import { DebugInfo } from "@/services/waku";
|
||||
|
||||
export default function Home() {
|
||||
const {
|
||||
onSend,
|
||||
messages,
|
||||
debugInfo,
|
||||
contentTopic,
|
||||
onContentTopicChange
|
||||
} = useWaku();
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col p-24 font-mono max-w-screen-lg">
|
||||
<Header>
|
||||
<DebugInfo value={debugInfo} />
|
||||
</Header>
|
||||
<Waku
|
||||
onSend={onSend}
|
||||
messages={messages}
|
||||
activeContentTopic={contentTopic}
|
||||
onActiveContentTopicChange={onContentTopicChange}
|
||||
/>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
type DebugInfoProps = {
|
||||
value?: DebugInfo;
|
||||
}
|
||||
|
||||
const DebugInfo: React.FunctionComponent<DebugInfoProps> = (props) => {
|
||||
if (!props.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<details className="border rounded p-2">
|
||||
<summary className="cursor-pointer bg-gray-300 p-2 rounded-md">
|
||||
<span className="font-bold">Show node info</span>
|
||||
</summary>
|
||||
<div className="mt-2 text-sm break-words">
|
||||
<p className="mb-2">Health: {props.value.health}</p>
|
||||
<p className="mb-2">Version: {props.value.version}</p>
|
||||
<p className="mb-2">ENR URI: {props.value.enrUri}</p>
|
||||
<p className="mb-2">Listen Addresses:</p>
|
||||
<ul>
|
||||
{props.value.listenAddresses.map((address, index) => (
|
||||
<li key={index}>{address}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
@ -5,8 +5,8 @@ import "./globals.css";
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "RLN Example",
|
||||
description: "Showcases RLN, Keystore and generation of proofs",
|
||||
title: "nwaku front-end",
|
||||
description: "Send messages through you local node, register to RLN, read and export Keystore",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
|
||||
@ -1,4 +1,59 @@
|
||||
import Home from "@/app/home/page";
|
||||
"use client";
|
||||
import { Header } from "@/app/components/Header";
|
||||
import { Waku } from "@/app/components/Waku";
|
||||
import { useWaku } from "@/hooks";
|
||||
import { DebugInfo } from "@/services/waku";
|
||||
|
||||
export const dynamic = "force-static";
|
||||
export default Home;
|
||||
export default function Home() {
|
||||
const {
|
||||
onSend,
|
||||
messages,
|
||||
debugInfo,
|
||||
contentTopic,
|
||||
onContentTopicChange
|
||||
} = useWaku();
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col p-24 font-mono max-w-screen-lg">
|
||||
<Header>
|
||||
<DebugInfo value={debugInfo} />
|
||||
</Header>
|
||||
<Waku
|
||||
onSend={onSend}
|
||||
messages={messages}
|
||||
activeContentTopic={contentTopic}
|
||||
onActiveContentTopicChange={onContentTopicChange}
|
||||
/>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
type DebugInfoProps = {
|
||||
value?: DebugInfo;
|
||||
}
|
||||
|
||||
const DebugInfo: React.FunctionComponent<DebugInfoProps> = (props) => {
|
||||
if (!props.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<details className="border rounded p-2">
|
||||
<summary className="cursor-pointer bg-gray-300 p-2 rounded-md">
|
||||
<span className="font-bold">Show node info</span>
|
||||
</summary>
|
||||
<div className="mt-2 text-sm break-words">
|
||||
<p className="mb-2">Health: {props.value.health}</p>
|
||||
<p className="mb-2">Version: {props.value.version}</p>
|
||||
<p className="mb-2">ENR URI: {props.value.enrUri}</p>
|
||||
<p className="mb-2">Listen Addresses:</p>
|
||||
<ul>
|
||||
{props.value.listenAddresses.map((address, index) => (
|
||||
<li key={index}>{address}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user