diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index ccea237a..73bd8416 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -1,6 +1,16 @@ { "tauri": { "windows": [ + { + "width": 400, + "height": 500, + "decorations": false, + "title": "Lume", + "center": true, + "resizable": false, + "label": "splashscreen", + "url": "splashscreen" + }, { "width": 1080, "height": 800, @@ -14,21 +24,23 @@ "fullscreen": false, "hiddenTitle": true, "visible": false, - "fileDropEnabled": true, - "windowEffects": { - "effects": ["micaDark", "micaLight", "acrylic"], - "state": "followsWindowActiveState" - } + "fileDropEnabled": true }, { - "width": 400, - "height": 500, - "decorations": false, - "title": "Lume", - "center": true, + "width": 1080, + "height": 800, "resizable": false, - "label": "splashscreen", - "url": "splashscreen" + "theme": "Dark", + "label": "settings", + "url": "settings", + "title": "Settings", + "titleBarStyle": "Overlay", + "transparent": false, + "center": true, + "fullscreen": false, + "hiddenTitle": true, + "visible": false, + "fileDropEnabled": false } ] } diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index 9ebe7a04..f24bb14a 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -1,6 +1,18 @@ { "tauri": { "windows": [ + { + "width": 400, + "height": 500, + "decorations": true, + "title": "Lume", + "titleBarStyle": "Overlay", + "hiddenTitle": true, + "center": true, + "resizable": false, + "label": "splashscreen", + "url": "splashscreen" + }, { "width": 1080, "height": 800, @@ -22,16 +34,24 @@ } }, { - "width": 400, - "height": 500, - "decorations": true, - "title": "Lume", - "titleBarStyle": "Overlay", - "hiddenTitle": true, - "center": true, + "width": 1080, + "height": 800, "resizable": false, - "label": "splashscreen", - "url": "splashscreen" + "theme": "Dark", + "label": "settings", + "url": "settings", + "title": "Settings", + "titleBarStyle": "Overlay", + "transparent": true, + "center": true, + "fullscreen": false, + "hiddenTitle": true, + "visible": false, + "fileDropEnabled": false, + "windowEffects": { + "effects": ["hudWindow"], + "state": "followsWindowActiveState" + } } ] } diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 44754cd9..5e279375 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -1,6 +1,16 @@ { "tauri": { "windows": [ + { + "width": 400, + "height": 500, + "decorations": false, + "title": "Lume", + "center": true, + "resizable": false, + "label": "splashscreen", + "url": "splashscreen" + }, { "width": 1080, "height": 800, @@ -21,14 +31,24 @@ } }, { - "width": 400, - "height": 500, - "decorations": false, - "title": "Lume", - "center": true, + "width": 1080, + "height": 800, "resizable": false, - "label": "splashscreen", - "url": "splashscreen" + "theme": "Dark", + "label": "settings", + "url": "settings", + "title": "Settings", + "titleBarStyle": "Overlay", + "transparent": true, + "center": true, + "fullscreen": false, + "hiddenTitle": true, + "visible": false, + "fileDropEnabled": false, + "windowEffects": { + "effects": ["micaDark", "micaLight", "acrylic"], + "state": "followsWindowActiveState" + } } ] } diff --git a/src/app/auth/components/user.tsx b/src/app/auth/components/user.tsx index 5429382c..fa580f7f 100644 --- a/src/app/auth/components/user.tsx +++ b/src/app/auth/components/user.tsx @@ -19,19 +19,17 @@ export function User({ pubkey, fallback }: { pubkey: string; fallback?: string } } return ( -
-
- {pubkey} -
+
+ {pubkey}

{user?.name || user?.display_name || user?.nip05}

- + {displayNpub(pubkey, 16)}
diff --git a/src/app/auth/unlock.tsx b/src/app/auth/unlock.tsx index 77cf2921..629b6111 100644 --- a/src/app/auth/unlock.tsx +++ b/src/app/auth/unlock.tsx @@ -74,7 +74,7 @@ export function UnlockScreen() {

Enter password to unlock

-
+
@@ -82,7 +82,7 @@ export function UnlockScreen() {
@@ -124,7 +124,7 @@ export function UnlockScreen() { Reset password diff --git a/src/app/space/components/button.tsx b/src/app/space/components/button.tsx index 116629e5..96bbac9e 100644 --- a/src/app/space/components/button.tsx +++ b/src/app/space/components/button.tsx @@ -3,10 +3,10 @@ import * as DropdownMenu from '@radix-ui/react-dropdown-menu'; import { useStorage } from '@libs/storage/provider'; import { + AddWidgetIcon, FeedIcon, FileIcon, HashtagIcon, - PlusIcon, ThreadsIcon, TrendingIcon, } from '@shared/icons'; @@ -72,7 +72,7 @@ export function AddWidgetButton() { @@ -82,7 +82,7 @@ export function AddWidgetButton() { diff --git a/src/shared/icons/addWidget.tsx b/src/shared/icons/addWidget.tsx new file mode 100644 index 00000000..bcb440e4 --- /dev/null +++ b/src/shared/icons/addWidget.tsx @@ -0,0 +1,22 @@ +import { SVGProps } from 'react'; + +export function AddWidgetIcon(props: JSX.IntrinsicAttributes & SVGProps) { + return ( + + + + ); +} diff --git a/src/shared/icons/index.tsx b/src/shared/icons/index.tsx index babf8484..5af206f1 100644 --- a/src/shared/icons/index.tsx +++ b/src/shared/icons/index.tsx @@ -1,3 +1,4 @@ +export * from './addWidget'; export * from './arrowLeft'; export * from './arrowRight'; export * from './bell'; diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index 2e536888..599e774f 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -28,7 +28,7 @@ export function NoteActions({ return ( -
+
diff --git a/src/shared/notes/actions/more.tsx b/src/shared/notes/actions/more.tsx index 72976f99..2c7e7afd 100644 --- a/src/shared/notes/actions/more.tsx +++ b/src/shared/notes/actions/more.tsx @@ -50,7 +50,7 @@ export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) { @@ -59,7 +59,7 @@ export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) { @@ -67,7 +67,7 @@ export function MoreActions({ id, pubkey }: { id: string; pubkey: string }) { View profile diff --git a/src/shared/notes/actions/zap.tsx b/src/shared/notes/actions/zap.tsx index 407585b6..04851084 100644 --- a/src/shared/notes/actions/zap.tsx +++ b/src/shared/notes/actions/zap.tsx @@ -4,7 +4,6 @@ import { QRCodeSVG } from 'qrcode.react'; import { useState } from 'react'; import { twMerge } from 'tailwind-merge'; -import { Button } from '@shared/button'; import { CancelIcon, ZapIcon } from '@shared/icons'; import { useEvent } from '@utils/hooks/useEvent'; @@ -42,7 +41,7 @@ export function NoteZap({ id }: { id: string }) {
-
+
Zap (Beta) @@ -63,7 +62,7 @@ export function NoteZap({ id }: { id: string }) { type="button" onClick={() => setAmount(21000)} className={twMerge( - 'inline-flex flex-col items-center justify-center gap-2 rounded-md px-2 py-2 backdrop-blur-xl hover:bg-white/10', + 'inline-flex flex-col items-center justify-center gap-2 rounded-lg px-2 py-2 backdrop-blur-xl hover:bg-white/10', `${selected(21000) && 'bg-white/10 backdrop-blur-xl'}` )} > @@ -76,7 +75,7 @@ export function NoteZap({ id }: { id: string }) { type="button" onClick={() => setAmount(69000)} className={twMerge( - 'inline-flex flex-col items-center justify-center gap-2 rounded-md px-2 py-2 backdrop-blur-xl hover:bg-white/10', + 'inline-flex flex-col items-center justify-center gap-2 rounded-lg px-2 py-2 backdrop-blur-xl hover:bg-white/10', `${selected(69000) && 'bg-white/10 backdrop-blur-xl'}` )} > @@ -89,7 +88,7 @@ export function NoteZap({ id }: { id: string }) { type="button" onClick={() => setAmount(100000)} className={twMerge( - 'inline-flex flex-col items-center justify-center gap-2 rounded-md px-2 py-2 backdrop-blur-xl hover:bg-white/10', + 'inline-flex flex-col items-center justify-center gap-2 rounded-lg px-2 py-2 backdrop-blur-xl hover:bg-white/10', `${selected(100000) && 'bg-white/10 backdrop-blur-xl'}` )} > @@ -102,7 +101,7 @@ export function NoteZap({ id }: { id: string }) { type="button" onClick={() => setAmount(200000)} className={twMerge( - 'inline-flex flex-col items-center justify-center gap-2 rounded-md px-2 py-2 backdrop-blur-xl hover:bg-white/10', + 'inline-flex flex-col items-center justify-center gap-2 rounded-lg px-2 py-2 backdrop-blur-xl hover:bg-white/10', `${selected(200000) && 'bg-white/10 backdrop-blur-xl'}` )} > @@ -115,7 +114,7 @@ export function NoteZap({ id }: { id: string }) { type="button" onClick={() => setAmount(500000)} className={twMerge( - 'inline-flex flex-col items-center justify-center gap-2 rounded-md px-2 py-2 backdrop-blur-xl hover:bg-white/10', + 'inline-flex flex-col items-center justify-center gap-2 rounded-lg px-2 py-2 backdrop-blur-xl hover:bg-white/10', `${selected(500000) && 'bg-white/10 backdrop-blur-xl'}` )} > @@ -128,7 +127,7 @@ export function NoteZap({ id }: { id: string }) { type="button" onClick={() => setAmount(1000000)} className={twMerge( - 'inline-flex flex-col items-center justify-center gap-2 rounded-md px-2 py-2 backdrop-blur-xl hover:bg-white/10', + 'inline-flex flex-col items-center justify-center gap-2 rounded-lg px-2 py-2 backdrop-blur-xl hover:bg-white/10', `${selected(1000000) && 'bg-white/10 backdrop-blur-xl'}` )} > @@ -139,9 +138,13 @@ export function NoteZap({ id }: { id: string }) {
- +
) : ( diff --git a/src/shared/notes/child.tsx b/src/shared/notes/child.tsx index d9f2e0f2..839f7e42 100644 --- a/src/shared/notes/child.tsx +++ b/src/shared/notes/child.tsx @@ -25,8 +25,13 @@ export function ChildNote({ id, root }: { id: string; root?: string }) { if (status === 'error') { return ( -
-

Failed to fetch event: {id}

+
+

+ Lume cannot found the event with ID +

+
+

{id}

+
); } diff --git a/src/shared/notes/wrapper.tsx b/src/shared/notes/wrapper.tsx index 257e1234..b7278a60 100644 --- a/src/shared/notes/wrapper.tsx +++ b/src/shared/notes/wrapper.tsx @@ -19,7 +19,7 @@ export function NoteWrapper({ reply?: string; }) { return ( -
+
{root && }
{reply && }
diff --git a/src/shared/titleBar.tsx b/src/shared/titleBar.tsx index e0610ead..78e9c8b3 100644 --- a/src/shared/titleBar.tsx +++ b/src/shared/titleBar.tsx @@ -11,15 +11,15 @@ export function TitleBar({ id, title }: { id?: string; title: string }) { return (
-

{title}

+

{title}

{id ? ( diff --git a/src/utils/hooks/useEvent.ts b/src/utils/hooks/useEvent.ts index 4f89a351..f9d36f32 100644 --- a/src/utils/hooks/useEvent.ts +++ b/src/utils/hooks/useEvent.ts @@ -4,6 +4,8 @@ import { useQuery } from '@tanstack/react-query'; import { useNDK } from '@libs/ndk/provider'; import { useStorage } from '@libs/storage/provider'; +import { toRawEvent } from '@utils/rawEvent'; + export function useEvent(id: string, embed?: string) { const { db } = useStorage(); const { ndk } = useNDK(); @@ -34,9 +36,10 @@ export function useEvent(id: string, embed?: string) { reply = event.tags.find((el) => el[3] === 'reply')?.[1]; } + const rawEvent = toRawEvent(event); await db.createEvent( event.id, - JSON.stringify(event), + JSON.stringify(rawEvent), event.pubkey, event.kind, root, diff --git a/src/utils/hooks/useNostr.ts b/src/utils/hooks/useNostr.ts index 271809b6..0db96820 100644 --- a/src/utils/hooks/useNostr.ts +++ b/src/utils/hooks/useNostr.ts @@ -45,14 +45,6 @@ export function useNostr() { subManager.set(JSON.stringify(filter), subEvent); subEvent.addListener('event', (event: NDKEvent) => { - delete event.ndk; - delete event.decrypt; - delete event.encrypt; - delete event.encode; - delete event.isParamReplaceable; - delete event.isReplaceable; - delete event.repost; - delete event.relay; callback(event); }); }; diff --git a/src/utils/rawEvent.ts b/src/utils/rawEvent.ts new file mode 100644 index 00000000..0532cb23 --- /dev/null +++ b/src/utils/rawEvent.ts @@ -0,0 +1,13 @@ +import { NDKEvent } from '@nostr-dev-kit/ndk'; + +export function toRawEvent(event: NDKEvent) { + delete event.ndk; + delete event.decrypt; + delete event.encrypt; + delete event.encode; + delete event.isParamReplaceable; + delete event.isReplaceable; + delete event.repost; + delete event.relay; + return event; +}