2023-06-30 14:05:57 +00:00
|
|
|
/** @jsx h */
|
2023-09-06 16:29:27 +00:00
|
|
|
import { h, render } from "https://esm.sh/preact@10.17.1";
|
2023-06-30 14:05:57 +00:00
|
|
|
|
2023-07-11 09:49:58 +00:00
|
|
|
import { NewIndexedDB } from "./dexie-db.ts";
|
2023-06-30 14:05:57 +00:00
|
|
|
|
|
|
|
import * as nav from "./nav.tsx";
|
|
|
|
import { tw } from "https://esm.sh/twind@0.16.16";
|
|
|
|
|
|
|
|
import { EventBus } from "../event-bus.ts";
|
|
|
|
import { UI_Interaction_Event } from "./app_update.ts";
|
2023-08-28 17:58:05 +00:00
|
|
|
import { PublicKey } from "../lib/nostr-ts/key.ts";
|
|
|
|
import { ConnectionPool } from "../lib/nostr-ts/relay.ts";
|
2023-06-30 14:05:57 +00:00
|
|
|
|
|
|
|
const db = await NewIndexedDB();
|
|
|
|
if (db instanceof Error) {
|
|
|
|
throw db;
|
|
|
|
}
|
|
|
|
const NavProps: nav.Props = {
|
|
|
|
publicKey: PublicKey.FromHex(
|
|
|
|
"0add27aa36e2e5e2591370f485af1344447705cfc37b1a1e6b0224be878c9687",
|
|
|
|
) as PublicKey,
|
|
|
|
database: db,
|
|
|
|
pool: new ConnectionPool(),
|
|
|
|
eventEmitter: new EventBus<UI_Interaction_Event>(),
|
|
|
|
AddRelayButtonClickedError: "",
|
|
|
|
AddRelayInput: "",
|
|
|
|
activeNav: "DM",
|
|
|
|
picture: undefined,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function NavTest() {
|
|
|
|
return (
|
|
|
|
<div class={tw`h-screen`}>
|
|
|
|
<nav.NavBar
|
|
|
|
{...NavProps}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
render(<NavTest />, document.body);
|