From 93711e1d36011c5a2572a8d692f56dd49999c8bd Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sat, 3 Jun 2023 15:32:47 +0700 Subject: [PATCH] polish --- package.json | 1 + pnpm-lock.yaml | 25 ++++++++++++++ src/app/channel/components/createModal.tsx | 38 ++++++++++------------ src/app/channel/components/updateModal.tsx | 12 +++---- src/app/note/components/base.tsx | 2 +- src/app/note/components/mentions/note.tsx | 17 +++++++++- src/app/note/components/metadata.tsx | 2 +- src/app/note/components/parent.tsx | 19 +++++++++-- src/app/note/components/preview/image.tsx | 21 ++++++++---- src/app/note/components/rootNote.tsx | 19 +++++++++-- src/app/space/components/addFeed.tsx | 3 +- src/app/space/components/addImage.tsx | 2 +- src/renderer/index.css | 2 +- src/shared/multiAccounts.tsx | 2 +- src/shared/navigation.tsx | 2 +- src/stores/accounts.tsx | 6 ++++ src/utils/parser.tsx | 5 +-- 17 files changed, 128 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index f1134bc0..8567fcb2 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@vidstack/react": "^0.4.5", "dayjs": "^1.11.7", "destr": "^1.2.2", + "embla-carousel-react": "8.0.0-rc06", "immer": "^10.0.2", "light-bolt11-decoder": "^3.0.0", "nostr-relaypool": "^0.6.28", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f2da6564..1c3a9975 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,9 @@ dependencies: destr: specifier: ^1.2.2 version: 1.2.2 + embla-carousel-react: + specifier: 8.0.0-rc06 + version: 8.0.0-rc06(react@18.2.0) immer: specifier: ^10.0.2 version: 10.0.2 @@ -1256,6 +1259,28 @@ packages: resolution: {integrity: sha512-AUYh0XDTb2vrj0rj82jb3P9hHSyzQNdTPYWZIhPdCOui7/vpme7+HTE07BE5jwuqg/34TZ8ktlRz6GImJ4IXjA==} dev: true + /embla-carousel-react@8.0.0-rc06(react@18.2.0): + resolution: {integrity: sha512-aZfVqTptCA6uq3VLPFXLKGSkxVdoiNjQa1sjVOJc+9FL6pbwImaVR0oL7jA0kfW9l67XoQOEOq1gRiImbYr/Ew==} + peerDependencies: + react: ^16.8.0 || ^17.0.1 || ^18.0.0 + dependencies: + embla-carousel: 8.0.0-rc06 + embla-carousel-reactive-utils: 8.0.0-rc06(embla-carousel@8.0.0-rc06) + react: 18.2.0 + dev: false + + /embla-carousel-reactive-utils@8.0.0-rc06(embla-carousel@8.0.0-rc06): + resolution: {integrity: sha512-AlTrD9eh8aNlDsSjnEOM15Z9f4vQVgG+ULLMSl3BfWdqYvxsbinRcVQd2Buj3KlNq3pH7pm20G63CEz1h8p/Ig==} + peerDependencies: + embla-carousel: 8.0.0-rc06 + dependencies: + embla-carousel: 8.0.0-rc06 + dev: false + + /embla-carousel@8.0.0-rc06: + resolution: {integrity: sha512-Dq27CG9OgZjKxK+JJS3uyEW4dwQ3oVkvlTHEP17idVnP8vmuhi4WtGe4UVGj8m0O2WASR4kNu4efFXkF7u6A+g==} + dev: false + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true diff --git a/src/app/channel/components/createModal.tsx b/src/app/channel/components/createModal.tsx index bd155f6b..d339472a 100644 --- a/src/app/channel/components/createModal.tsx +++ b/src/app/channel/components/createModal.tsx @@ -47,15 +47,19 @@ export function ChannelCreateModal() { pubkey: account.pubkey, tags: [], }; + event.id = getEventHash(event); event.sig = getSignature(event, account.privkey); // publish channel pool.publish(event, WRITEONLY_RELAYS); + // insert to database createChannel(event.id, event.pubkey, event.content, event.created_at); + // reset form reset(); + setTimeout(() => { // close modal setIsOpen(false); @@ -111,12 +115,12 @@ export function ChannelCreateModal() { leaveTo="opacity-0 scale-95" > -
+
Create channel @@ -132,7 +136,7 @@ export function ChannelCreateModal() { />
- + Channels are freedom square, everyone can speech freely, no one can stop you or deceive what to speech @@ -150,7 +154,7 @@ export function ChannelCreateModal() { className="relative h-10 w-full rounded-lg border border-black/5 px-3 py-2 shadow-input shadow-black/5 !outline-none placeholder:text-zinc-400 dark:bg-zinc-800 dark:text-white dark:shadow-black/10 dark:placeholder:text-zinc-500" />
-
-
-
-
-
-
- - Make Private - -
- - Coming soon - -
-
-

- Private channels can only be viewed by member +

+
+ + Encrypted + +

+ All messages are encrypted and only invited members + can view and send message

diff --git a/src/app/channel/components/updateModal.tsx b/src/app/channel/components/updateModal.tsx index 454d2f3e..ea43515d 100644 --- a/src/app/channel/components/updateModal.tsx +++ b/src/app/channel/components/updateModal.tsx @@ -113,12 +113,12 @@ export function ChannelUpdateModal({ id }: { id: string }) { leaveTo="opacity-0 scale-95" > -
+
Update channel @@ -134,7 +134,7 @@ export function ChannelUpdateModal({ id }: { id: string }) { />
- + New metadata will be published on all relays, and will be immediately available to all users, so please carefully. @@ -152,7 +152,7 @@ export function ChannelUpdateModal({ id }: { id: string }) { className="relative h-10 w-full rounded-lg border border-black/5 px-3 py-2 shadow-input shadow-black/5 !outline-none placeholder:text-zinc-400 dark:bg-zinc-800 dark:text-white dark:shadow-black/10 dark:placeholder:text-zinc-500" />
-
-
-