+
Private Key
+
{privateKey
? (
)
@@ -57,7 +56,7 @@ export default function KeyView(props: {
{!privateKey
? (
-
+
Blowater cannot view your private key because you logged in with an extension.
)
diff --git a/UI/nav.test.tsx b/UI/nav.test.tsx
deleted file mode 100644
index 5c272cd..0000000
--- a/UI/nav.test.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @jsx h */
-import { h, render } from "https://esm.sh/preact@10.17.1";
-import { NavBar } from "./nav.tsx";
-import { InMemoryAccountContext } from "../lib/nostr-ts/nostr.ts";
-import { Datebase_View } from "../database.ts";
-import { fail } from "https://deno.land/std@0.176.0/testing/asserts.ts";
-import { testEventBus, testEventMarker, testEventsAdapter, testRelayAdapter } from "./_setup.test.ts";
-import { tw } from "https://esm.sh/twind@0.16.16";
-
-const db = await test_db_view();
-
-const ctx = InMemoryAccountContext.Generate();
-
-render(
-
-
-
-
,
- document.body,
-);
-
-for await (const event of testEventBus.onChange()) {
- console.log(event);
-}
diff --git a/UI/nav.tsx b/UI/nav.tsx
index 8f32e7f..e1b1773 100644
--- a/UI/nav.tsx
+++ b/UI/nav.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
import { ComponentChild, Fragment, h } from "https://esm.sh/preact@10.17.1";
-import { tw } from "https://esm.sh/twind@0.16.16";
import { Avatar } from "./components/avatar.tsx";
import { PublicKey } from "../lib/nostr-ts/key.ts";
import {
@@ -56,20 +55,20 @@ type NavTab = {
export class NavBar extends Component
{
styles = {
container:
- tw`h-full w-16 flex flex-col gap-y-4 overflow-y-auto bg-[${PrimaryBackgroundColor}] py-8 items-center`,
+ `h-full w-16 flex flex-col gap-y-4 overflow-y-auto bg-[${PrimaryBackgroundColor}] py-8 items-center`,
icons: (active: boolean, fill?: boolean) => (
- tw`w-6 h-6 ${fill ? "fill-current" : "stroke-current"} text-[${
+ `w-6 h-6 ${fill ? "fill-current" : "stroke-current"} text-[${
active ? PrimaryTextColor : SecondaryTextColor
}]`
),
- avatar: tw`w-12 h-12`,
+ avatar: `w-12 h-12`,
tabsContainer:
- tw`last:flex-1 last:flex last:items-end last:flex last:flex-col last:justify-end last:gap-y-4`,
+ `last:flex-1 last:flex last:items-end last:flex last:flex-col last:justify-end last:gap-y-4`,
tabs: (active: boolean) =>
- tw`rounded-lg w-10 h-10 ${
+ `rounded-lg w-10 h-10 ${
active ? `bg-[${SecondaryBackgroundColor}]` : ""
} hover:bg-[${SecondaryBackgroundColor}] ${CenterClass} ${NoOutlineClass}`,
- mobileContainer: tw`h-[4.5rem] flex justify-evenly bg-[${PrimaryBackgroundColor}] items-start pt-2`,
+ mobileContainer: `h-[4.5rem] flex justify-evenly bg-[${PrimaryBackgroundColor}] items-start pt-2`,
};
state: State = {
diff --git a/UI/note-card.tsx b/UI/note-card.tsx
index 712de4f..63d5711 100644
--- a/UI/note-card.tsx
+++ b/UI/note-card.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
import { h } from "https://esm.sh/preact@10.17.1";
-import { tw } from "https://esm.sh/twind@0.16.16";
import { ProfileData } from "../features/profile.ts";
import {
cardBackgroundColor,
@@ -23,9 +22,9 @@ export function NoteCard(props: {
const { profileData, event, emit, publicKey } = props;
const styles = {
container:
- tw`px-4 mb-1 mobile:px-2 py-1 text-[${PrimaryTextColor}] rounded bg-[${cardBackgroundColor}] border-l-2 border-[${HintLinkColor}] w-4/5 mobile:w-full`,
- name: tw`truncate font-bold text-[${LinkColor}] text-base cursor-pointer hover:underline`,
- content: tw`text-sm text-[${HintTextColor}] hover:underline cursor-pointer`,
+ `px-4 mb-1 mobile:px-2 py-1 text-[${PrimaryTextColor}] rounded bg-[${cardBackgroundColor}] border-l-2 border-[${HintLinkColor}] w-4/5 mobile:w-full`,
+ name: `truncate font-bold text-[${LinkColor}] text-base cursor-pointer hover:underline`,
+ content: `text-sm text-[${HintTextColor}] hover:underline cursor-pointer`,
};
const viewNoteDetail = () =>
diff --git a/UI/profile-card.tsx b/UI/profile-card.tsx
index 1681b5f..f797f5a 100644
--- a/UI/profile-card.tsx
+++ b/UI/profile-card.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
import { h } from "https://esm.sh/preact@10.17.1";
-import { tw } from "https://esm.sh/twind@0.16.16";
import { emitFunc } from "../event-bus.ts";
import { ProfileData } from "../features/profile.ts";
import { PublicKey } from "../lib/nostr-ts/key.ts";
@@ -17,14 +16,14 @@ export function ProfileCard(props: {
const { profileData, publicKey, emit } = props;
const styles = {
container:
- tw`px-4 mb-1 mobile:px-2 py-1 text-[${HintTextColor}] hover:underline rounded bg-[${cardBackgroundColor}] border-l-2 border-[${HintLinkColor}] max-w-sm cursor-pointer gorup`,
+ `px-4 mb-1 mobile:px-2 py-1 text-[${HintTextColor}] hover:underline rounded bg-[${cardBackgroundColor}] border-l-2 border-[${HintLinkColor}] max-w-sm cursor-pointer gorup`,
profile: {
- container: tw`flex items-center`,
- avatar: tw`w-8 h-8`,
- name: tw`text-base font-bold truncate ml-2 text-[${LinkColor}]`,
+ container: `flex items-center`,
+ avatar: `w-8 h-8`,
+ name: `text-base font-bold truncate ml-2 text-[${LinkColor}]`,
},
- divider: tw`${DividerClass} my-[0.5rem]`,
- about: tw`text-sm`,
+ divider: `${DividerClass} my-[0.5rem]`,
+ about: `text-sm`,
};
const onClick = () =>
diff --git a/UI/relay-detail.tsx b/UI/relay-detail.tsx
index e783b9d..e1ee85b 100644
--- a/UI/relay-detail.tsx
+++ b/UI/relay-detail.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
import { Component, ComponentChildren, Fragment, h } from "https://esm.sh/preact@10.17.1";
-import { tw } from "https://esm.sh/twind@0.16.16";
import { CopyButton } from "./components/copy-button.tsx";
import { CenterClass, InputClass } from "./components/tw.ts";
import {
@@ -44,12 +43,12 @@ export type RelayDetailItem = {
export class RelayDetail extends Component {
styles = {
- container: tw`bg-[${SecondaryBackgroundColor}] p-8`,
- title: tw`pt-8 text-[${PrimaryTextColor}]`,
- error: tw`text-[${ErrorColor}] ${CenterClass}`,
+ container: `bg-[${SecondaryBackgroundColor}] p-8`,
+ title: `pt-8 text-[${PrimaryTextColor}]`,
+ error: `text-[${ErrorColor}] ${CenterClass}`,
header: {
- container: tw`text-lg flex text-[${PrimaryTextColor}] pb-4`,
- icon: tw`w-8 h-8 mr-4 text-[${TitleIconColor}] stroke-current`,
+ container: `text-lg flex text-[${PrimaryTextColor}] pb-4`,
+ icon: `w-8 h-8 mr-4 text-[${TitleIconColor}] stroke-current`,
},
};
@@ -178,10 +177,10 @@ function AuthorField(props: {
profileGetter: ProfileGetter;
}) {
const styles = {
- container: tw`flex items-center ${InputClass}`,
- avatar: tw`h-8 w-8 mr-2`,
- icon: tw`w-4 h-4 text-[${HintTextColor}] fill-current rotate-180`,
- name: tw`overflow-x-auto flex-1`,
+ container: `flex items-center ${InputClass}`,
+ avatar: `h-8 w-8 mr-2`,
+ icon: `w-4 h-4 text-[${HintTextColor}] fill-current rotate-180`,
+ name: `overflow-x-auto flex-1`,
};
const pubkey = PublicKey.FromString(props.publicKey);
@@ -206,9 +205,9 @@ function TextField(props: {
text: string;
}) {
const styles = {
- container: tw`relative ${InputClass} resize-none flex p-0 mt-4`,
- pre: tw`whitespace-pre flex-1 overflow-x-auto px-4 py-3`,
- copyButton: tw`w-14 ${CenterClass}`,
+ container: `relative ${InputClass} resize-none flex p-0 mt-4`,
+ pre: `whitespace-pre flex-1 overflow-x-auto px-4 py-3`,
+ copyButton: `w-14 ${CenterClass}`,
};
return (
diff --git a/UI/search.tsx b/UI/search.tsx
index 4f4e3c7..6cdf869 100644
--- a/UI/search.tsx
+++ b/UI/search.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
import { createRef, h } from "https://esm.sh/preact@10.17.1";
-import { tw } from "https://esm.sh/twind@0.16.16";
import { Avatar } from "./components/avatar.tsx";
import {
DividerBackgroundColor,
@@ -48,16 +47,16 @@ export class Search extends Component {
state: State = { searchResults: [] };
inputRef = createRef();
styles = {
- container: tw`flex flex-col h-full w-full bg-[${SecondaryBackgroundColor}]`,
+ container: `flex flex-col h-full w-full bg-[${SecondaryBackgroundColor}]`,
searchInput:
- tw`p-2 w-full border-b border-[${DividerBackgroundColor}] focus-visible:outline-none bg-[${SecondaryBackgroundColor}] text-[${PrimaryTextColor}] placeholder-[${PlaceholderColor}]`,
+ `p-2 w-full border-b border-[${DividerBackgroundColor}] focus-visible:outline-none bg-[${SecondaryBackgroundColor}] text-[${PrimaryTextColor}] placeholder-[${PlaceholderColor}]`,
result: {
- container: tw`flex-1 list-none p-1 overflow-y-auto`,
+ container: `flex-1 list-none p-1 overflow-y-auto`,
item: {
container:
- tw`w-full flex items-center px-4 py-2 text-[#B8B9BF] hover:bg-[#404249] rounded cursor-pointer`,
- avatar: tw`w-8 h-8 mr-2`,
- text: tw`truncate`,
+ `w-full flex items-center px-4 py-2 text-[#B8B9BF] hover:bg-[#404249] rounded cursor-pointer`,
+ avatar: `w-8 h-8 mr-2`,
+ text: `truncate`,
},
},
};
diff --git a/UI/user-detail.tsx b/UI/user-detail.tsx
index fa84143..3344494 100644
--- a/UI/user-detail.tsx
+++ b/UI/user-detail.tsx
@@ -1,6 +1,5 @@
/** @jsx h */
import { h } from "https://esm.sh/preact@10.17.1";
-import { tw } from "https://esm.sh/twind@0.16.16";
import { Avatar } from "./components/avatar.tsx";
import { PublicKey } from "../lib/nostr-ts/key.ts";
import { ProfileData } from "../features/profile.ts";
@@ -21,37 +20,37 @@ type UserDetailProps = {
export function UserDetail(props: UserDetailProps) {
return (
-
+
-
+
{props.targetUserProfile.name || props.pubkey.bech32()}
-
+
-
+
{props.pubkey.hex}
@@ -59,9 +58,9 @@ export function UserDetail(props: UserDetailProps) {
{props.targetUserProfile.about
? (
-
+
{TextWithLinks({ text: props.targetUserProfile.about })}
@@ -78,9 +77,9 @@ export function UserDetail(props: UserDetailProps) {
: undefined}
{props.targetUserProfile.website
? (
-
+
{TextWithLinks({ text: props.targetUserProfile.website })}
@@ -108,7 +107,7 @@ function TextWithLinks({ text }: { text: string }) {
if (part instanceof URL) {
return (