From 1ddcbf16548b4c9f237d8c6e2e463e1d5e2d829e Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:34:09 +0700 Subject: [PATCH] wip: new ui --- src/app/auth/unlock.tsx | 100 +++++++++--------- src/app/space/components/blocks/following.tsx | 11 +- src/app/space/index.tsx | 12 +-- src/index.css | 2 +- src/shared/appLayout.tsx | 2 +- src/shared/authLayout.tsx | 8 +- src/shared/notes/actions.tsx | 8 +- src/shared/notes/actions/reaction.tsx | 6 +- src/shared/notes/actions/reply.tsx | 6 +- src/shared/notes/actions/repost.tsx | 6 +- src/shared/notes/kinds/kind1.tsx | 2 +- src/shared/notes/kinds/kind1063.tsx | 2 +- src/shared/notes/kinds/repost.tsx | 2 +- src/shared/notes/kinds/sub.tsx | 2 +- src/shared/notes/kinds/thread.tsx | 2 +- src/shared/notes/kinds/unsupport.tsx | 2 +- src/shared/notes/metadata.tsx | 15 ++- src/shared/notes/preview/link.tsx | 10 +- src/shared/titleBar.tsx | 2 +- src/shared/user.tsx | 6 +- src/utils/types.d.ts | 2 +- 21 files changed, 99 insertions(+), 109 deletions(-) diff --git a/src/app/auth/unlock.tsx b/src/app/auth/unlock.tsx index 64f5f426..9ada5e2b 100644 --- a/src/app/auth/unlock.tsx +++ b/src/app/auth/unlock.tsx @@ -81,65 +81,61 @@ export function UnlockScreen() { return (
-
-

- Enter password to unlock -

+
+

Enter password to unlock

-
-
-
-
- - -
- - {errors.password &&

{errors.password.message}

} -
-
-
+ +
+
+ - - Reset password -
- -
+ + {errors.password &&

{errors.password.message}

} +
+
+
+ + + Reset password + +
+
); diff --git a/src/app/space/components/blocks/following.tsx b/src/app/space/components/blocks/following.tsx index 513bc8c0..b8fa409a 100644 --- a/src/app/space/components/blocks/following.tsx +++ b/src/app/space/components/blocks/following.tsx @@ -125,13 +125,12 @@ export function FollowingBlock() { ); return ( -
+
-
+
{status === 'loading' ? (
diff --git a/src/app/space/index.tsx b/src/app/space/index.tsx index 8492ea12..2ced9a04 100644 --- a/src/app/space/index.tsx +++ b/src/app/space/index.tsx @@ -57,12 +57,11 @@ export function SpaceScreen() {
{status === 'loading' ? ( -
+
-
@@ -71,18 +70,17 @@ export function SpaceScreen() { blocks.map((block: Block) => renderBlock(block)) )} {isFetching && ( -
+
-
)} -
+
diff --git a/src/index.css b/src/index.css index dfcc6b3b..57d3e5af 100644 --- a/src/index.css +++ b/src/index.css @@ -15,7 +15,7 @@ button { } .markdown { - @apply prose prose-zinc max-w-none select-text hyphens-auto dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 prose-a:after:content-['_↗'] hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2; + @apply prose max-w-none select-text hyphens-auto text-white dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 prose-a:after:content-['_↗'] hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2; } .ProseMirror p.is-empty::before { diff --git a/src/shared/appLayout.tsx b/src/shared/appLayout.tsx index 3f4f8f49..f3ab6a9f 100644 --- a/src/shared/appLayout.tsx +++ b/src/shared/appLayout.tsx @@ -8,7 +8,7 @@ export function AppLayout() {
-
+
diff --git a/src/shared/authLayout.tsx b/src/shared/authLayout.tsx index 1a084186..13e69e0e 100644 --- a/src/shared/authLayout.tsx +++ b/src/shared/authLayout.tsx @@ -1,12 +1,10 @@ -import { Outlet } from 'react-router-dom' +import { Outlet } from 'react-router-dom'; export function AuthLayout() { return ( -
+
-
- -
+
); } diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index dc9ce132..6b9afe9d 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -36,7 +36,7 @@ export function NoteActions({
{!noOpenThread && ( <> -
+
- + Open thread - + diff --git a/src/shared/notes/actions/reaction.tsx b/src/shared/notes/actions/reaction.tsx index 4fa7d31c..6c7906fa 100644 --- a/src/shared/notes/actions/reaction.tsx +++ b/src/shared/notes/actions/reaction.tsx @@ -66,13 +66,13 @@ export function NoteReaction({ id, pubkey }: { id: string; pubkey: string }) { {reaction ? ( {reaction} ) : ( - + )} @@ -133,7 +133,7 @@ export function NoteReaction({ id, pubkey }: { id: string; pubkey: string }) { />
- + diff --git a/src/shared/notes/actions/reply.tsx b/src/shared/notes/actions/reply.tsx index 3962ca35..d5bf9c33 100644 --- a/src/shared/notes/actions/reply.tsx +++ b/src/shared/notes/actions/reply.tsx @@ -23,13 +23,13 @@ export function NoteReply({ onClick={() => setReply(id, pubkey, root)} className="group inline-flex h-7 w-7 items-center justify-center" > - + - + Quick reply - + diff --git a/src/shared/notes/actions/repost.tsx b/src/shared/notes/actions/repost.tsx index 0a08324a..96d42440 100644 --- a/src/shared/notes/actions/repost.tsx +++ b/src/shared/notes/actions/repost.tsx @@ -25,13 +25,13 @@ export function NoteRepost({ id, pubkey }: { id: string; pubkey: string }) { onClick={() => submit()} className="group inline-flex h-7 w-7 items-center justify-center" > - + - + Repost - + diff --git a/src/shared/notes/kinds/kind1.tsx b/src/shared/notes/kinds/kind1.tsx index f6bc0c0c..262c9633 100644 --- a/src/shared/notes/kinds/kind1.tsx +++ b/src/shared/notes/kinds/kind1.tsx @@ -17,7 +17,7 @@ export function NoteKind_1({ return (
-
+
diff --git a/src/shared/notes/kinds/kind1063.tsx b/src/shared/notes/kinds/kind1063.tsx index 3027ef4f..c5e5f0e4 100644 --- a/src/shared/notes/kinds/kind1063.tsx +++ b/src/shared/notes/kinds/kind1063.tsx @@ -13,7 +13,7 @@ export function NoteKind_1063({ event }: { event: LumeEvent }) { return (
-
+
diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index 6b92eddb..c3017643 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -33,7 +33,7 @@ export function Repost({ event }: { event: LumeEvent }) { return (
-
+
diff --git a/src/shared/notes/kinds/sub.tsx b/src/shared/notes/kinds/sub.tsx index 42228d78..49b45b9f 100644 --- a/src/shared/notes/kinds/sub.tsx +++ b/src/shared/notes/kinds/sub.tsx @@ -24,7 +24,7 @@ export function SubNote({ id, root }: { id: string; root?: string }) { return ( <> -
+
diff --git a/src/shared/notes/kinds/thread.tsx b/src/shared/notes/kinds/thread.tsx index 383947b3..a54c4dce 100644 --- a/src/shared/notes/kinds/thread.tsx +++ b/src/shared/notes/kinds/thread.tsx @@ -19,7 +19,7 @@ export function NoteThread({ return (
-
+
{root && }
{reply && }
diff --git a/src/shared/notes/kinds/unsupport.tsx b/src/shared/notes/kinds/unsupport.tsx index 8566bb6d..c77d1988 100644 --- a/src/shared/notes/kinds/unsupport.tsx +++ b/src/shared/notes/kinds/unsupport.tsx @@ -6,7 +6,7 @@ import { LumeEvent } from '@utils/types'; export function NoteKindUnsupport({ event }: { event: LumeEvent }) { return (
-
+
diff --git a/src/shared/notes/metadata.tsx b/src/shared/notes/metadata.tsx index ae60cbaf..dc6d0fa1 100644 --- a/src/shared/notes/metadata.tsx +++ b/src/shared/notes/metadata.tsx @@ -79,8 +79,8 @@ export function NoteMetadata({ id }: { id: string }) {
{data.replies > 0 ? ( <> -
-
+
+
{data.users?.map((user, index) => ( @@ -94,14 +94,13 @@ export function NoteMetadata({ id }: { id: string }) { onClick={() => add.mutate({ kind: BLOCK_KINDS.thread, title: 'Thread', content: id }) } - className="text-zinc-500" + className="text-white/50" > - {data.replies}{' '} - replies + {data.replies} replies - · -

- + · +

+ {compactNumber.format(data.zap)} {' '} zaps diff --git a/src/shared/notes/preview/link.tsx b/src/shared/notes/preview/link.tsx index 4d443422..952b4745 100644 --- a/src/shared/notes/preview/link.tsx +++ b/src/shared/notes/preview/link.tsx @@ -7,7 +7,7 @@ export function LinkPreview({ urls }: { urls: string[] }) { const domain = new URL(urls[0]); return ( -

+
{status === 'loading' ? (
@@ -21,7 +21,7 @@ export function LinkPreview({ urls }: { urls: string[] }) {
) : ( )}
-
+
{data.title}
{data.description && ( -

+

{data.description}

)} - + {domain.hostname}
diff --git a/src/shared/titleBar.tsx b/src/shared/titleBar.tsx index 77937442..fcda48a2 100644 --- a/src/shared/titleBar.tsx +++ b/src/shared/titleBar.tsx @@ -8,7 +8,7 @@ export function TitleBar({ id, title }: { id?: string; title: string }) { return (

{title}

diff --git a/src/shared/user.tsx b/src/shared/user.tsx index fefdc233..c82613e9 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -81,12 +81,12 @@ export function User({ shortenKey(pubkey)}
- {createdAt} + {createdAt}
diff --git a/src/utils/types.d.ts b/src/utils/types.d.ts index a45ffdd5..c7a28b00 100644 --- a/src/utils/types.d.ts +++ b/src/utils/types.d.ts @@ -16,7 +16,7 @@ export interface LumeEvent extends NDKEvent { content: Content; } -export interface Account { +export interface Account extends NDKUserProfile { id: number; npub: string; pubkey: string;