diff --git a/package.json b/package.json index 3cc77264..9d3fdd05 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@tauri-apps/plugin-upload": "^2.0.0", "@tauri-apps/plugin-window-state": "^2.0.0", "bitcoin-units": "^1.0.0", - "boring-avatars": "^1.11.2", "dayjs": "^1.11.13", "embla-carousel-react": "^8.3.0", "i18next": "^23.15.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e912bb0..dc4a7783 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,9 +89,6 @@ importers: bitcoin-units: specifier: ^1.0.0 version: 1.0.0 - boring-avatars: - specifier: ^1.11.2 - version: 1.11.2 dayjs: specifier: ^1.11.13 version: 1.11.13 @@ -1504,9 +1501,6 @@ packages: bitcoin-units@1.0.0: resolution: {integrity: sha512-brac+Ttz7ovf/8D0jQHSWHnN2hmdjxDRBStxhjO752URLJlQIFpfZxzUteSZ81UYnRNiMkvsW9WsYPDuxHfnYA==} - boring-avatars@1.11.2: - resolution: {integrity: sha512-3+wkwPeObwS4R37FGXMYViqc4iTrIRj5yzfX9Qy4mnpZ26sX41dGMhsAgmKks1r/uufY1pl4vpgzMWHYfJRb2A==} - brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} @@ -3556,8 +3550,6 @@ snapshots: dependencies: big.js: 6.2.2 - boring-avatars@1.11.2: {} - brace-expansion@2.0.1: dependencies: balanced-match: 1.0.2 diff --git a/public/poster_1.jpeg b/public/poster_1.jpeg deleted file mode 100644 index e18dfc22..00000000 Binary files a/public/poster_1.jpeg and /dev/null differ diff --git a/public/poster_2.jpeg b/public/poster_2.jpeg deleted file mode 100644 index 5f326b48..00000000 Binary files a/public/poster_2.jpeg and /dev/null differ diff --git a/public/poster_3.jpeg b/public/poster_3.jpeg deleted file mode 100644 index 54a12747..00000000 Binary files a/public/poster_3.jpeg and /dev/null differ diff --git a/public/poster_4.jpeg b/public/poster_4.jpeg deleted file mode 100644 index 3615a5fd..00000000 Binary files a/public/poster_4.jpeg and /dev/null differ diff --git a/src-tauri/src/commands/event.rs b/src-tauri/src/commands/event.rs index 2127ed19..444a3d1c 100644 --- a/src-tauri/src/commands/event.rs +++ b/src-tauri/src/commands/event.rs @@ -290,13 +290,7 @@ pub async fn get_group_events( let authors: Vec = public_keys .iter() - .map(|p| { - if p.starts_with("npub1") { - PublicKey::from_bech32(p).map_err(|err| err.to_string()) - } else { - PublicKey::from_hex(p).map_err(|err| err.to_string()) - } - }) + .map(|p| PublicKey::from_str(p).map_err(|err| err.to_string())) .collect::, _>>()?; let filter = Filter::new() @@ -340,6 +334,7 @@ pub async fn get_global_events( state: State<'_, Nostr>, ) -> Result, String> { let client = &state.client; + let as_of = match until { Some(until) => Timestamp::from_str(until).map_err(|err| err.to_string())?, None => Timestamp::now(), diff --git a/src/components/column.tsx b/src/components/column.tsx index 85c22c54..01cf368f 100644 --- a/src/components/column.tsx +++ b/src/components/column.tsx @@ -1,6 +1,6 @@ import { commands } from "@/commands.gen"; import type { LumeColumn } from "@/types"; -import { Check, DotsThree } from "@phosphor-icons/react"; +import { CaretDown, Check } from "@phosphor-icons/react"; import { useParams } from "@tanstack/react-router"; import { invoke } from "@tauri-apps/api/core"; import { listen } from "@tauri-apps/api/event"; @@ -86,10 +86,10 @@ export const Column = memo(function Column({ column }: { column: LumeColumn }) { }, [params.account]); return ( -
-
+
+
-
+
{!isCreated ? (
@@ -102,7 +102,7 @@ export const Column = memo(function Column({ column }: { column: LumeColumn }) { }); function Header({ label, name }: { label: string; name: string }) { - const [title, setTitle] = useState(name); + const [title, setTitle] = useState(""); const [isChanged, setIsChanged] = useState(false); const saveNewTitle = async () => { @@ -173,19 +173,18 @@ function Header({ label, name }: { label: string; name: string }) { }, []); useEffect(() => { - if (title.length !== name.length) setIsChanged(true); - }, [title]); + if (title.length > 0) setIsChanged(true); + }, [title.length]); return ( -
-
+
setTitle(e.currentTarget.textContent)} - className="text-sm font-medium focus:outline-none" + className="text-[12px] font-semibold focus:outline-none" > {name}
@@ -193,9 +192,9 @@ function Header({ label, name }: { label: string; name: string }) { ) : null}
@@ -203,9 +202,9 @@ function Header({ label, name }: { label: string; name: string }) {
); diff --git a/src/components/note/content.tsx b/src/components/note/content.tsx index c473d28b..f5a31ceb 100644 --- a/src/components/note/content.tsx +++ b/src/components/note/content.tsx @@ -94,7 +94,6 @@ export function NoteContent({
500 ? "max-h-[250px] gradient-mask-b-0" : "", className, )} > diff --git a/src/components/quote.tsx b/src/components/quote.tsx index 68dfcc48..f848fa8e 100644 --- a/src/components/quote.tsx +++ b/src/components/quote.tsx @@ -13,12 +13,7 @@ export const Quote = memo(function Quote({ }) { return ( - +
diff --git a/src/components/repost.tsx b/src/components/repost.tsx index 534b733c..e93fd8eb 100644 --- a/src/components/repost.tsx +++ b/src/components/repost.tsx @@ -15,12 +15,7 @@ export const RepostNote = memo(function RepostNote({ const { isLoading, isError, data } = useEvent(event.repostId); return ( - + {isLoading ? (
diff --git a/src/components/text.tsx b/src/components/text.tsx index 3cd475b2..c491c57e 100644 --- a/src/components/text.tsx +++ b/src/components/text.tsx @@ -12,12 +12,7 @@ export const TextNote = memo(function TextNote({ }) { return ( - +
diff --git a/src/routes/$account/_app.lazy.tsx b/src/routes/$account/_app.lazy.tsx index 650a3aa7..0498f8d4 100644 --- a/src/routes/$account/_app.lazy.tsx +++ b/src/routes/$account/_app.lazy.tsx @@ -1,9 +1,8 @@ -import { appSettings, cn } from "@/commons"; +import { cn } from "@/commons"; import { User } from "@/components/user"; import { LumeWindow } from "@/system"; import { CaretDown, Feather, MagnifyingGlass } from "@phosphor-icons/react"; import { Outlet, createLazyFileRoute } from "@tanstack/react-router"; -import { useStore } from "@tanstack/react-store"; import { Menu, MenuItem, PredefinedMenuItem } from "@tauri-apps/api/menu"; import { writeText } from "@tauri-apps/plugin-clipboard-manager"; import { memo, useCallback } from "react"; @@ -14,7 +13,6 @@ export const Route = createLazyFileRoute("/$account/_app")({ function Screen() { const context = Route.useRouteContext(); - const transparent = useStore(appSettings, (state) => state.transparent); return (
@@ -54,14 +52,7 @@ function Screen() { className="relative z-[200] flex-1 flex items-center justify-end gap-1" />
-
+
diff --git a/src/routes/$account/_app/home.lazy.tsx b/src/routes/$account/_app/home.lazy.tsx index 30c6669c..a2b07b02 100644 --- a/src/routes/$account/_app/home.lazy.tsx +++ b/src/routes/$account/_app/home.lazy.tsx @@ -179,8 +179,8 @@ function Screen() { )) )} -
-
+
+
-
+
@@ -85,19 +86,19 @@ function Screen() { />
-
+
setNpub(e.target.value)} placeholder="npub1..." - className="w-full px-3 text-sm border-none rounded-lg h-9 bg-black/10 dark:bg-white/10 placeholder:text-neutral-600 focus:border-neutral-500 focus:ring-0 dark:placeholder:text-neutral-400" + className="w-full px-3 text-sm border-none rounded-lg h-9 bg-neutral-300 dark:bg-neutral-700 placeholder:text-neutral-600 focus:border-neutral-500 focus:ring-0 dark:placeholder:text-neutral-400" /> @@ -125,7 +126,7 @@ function Screen() { )) ) : ( -
+
Empty.
)} diff --git a/src/routes/columns/_layout/events.$id.lazy.tsx b/src/routes/columns/_layout/events.$id.lazy.tsx index ba02a838..24ea9296 100644 --- a/src/routes/columns/_layout/events.$id.lazy.tsx +++ b/src/routes/columns/_layout/events.$id.lazy.tsx @@ -29,9 +29,12 @@ function Screen() { - + @@ -54,28 +57,24 @@ function RootEvent() { if (isLoading) { return ( -
-
- - Loading... -
+
+ + Loading...
); } if (isError) { return ( -
-
- {error.message} -
+
+ {error.message}
); } return ( - +
@@ -217,7 +216,7 @@ function ReplyList() { }, []); return ( -
+
All replies
diff --git a/src/routes/columns/_layout/gallery.lazy.tsx b/src/routes/columns/_layout/gallery.lazy.tsx index fe1e2ebe..1839b1ff 100644 --- a/src/routes/columns/_layout/gallery.lazy.tsx +++ b/src/routes/columns/_layout/gallery.lazy.tsx @@ -2,7 +2,6 @@ import type { LumeColumn } from "@/types"; import * as ScrollArea from "@radix-ui/react-scroll-area"; import { createLazyFileRoute } from "@tanstack/react-router"; import { getCurrentWindow } from "@tauri-apps/api/window"; -import Avatar from "boring-avatars"; export const Route = createLazyFileRoute("/columns/_layout/gallery")({ component: Screen, @@ -26,31 +25,14 @@ function Screen() { {columns.map((column) => (
-
-
- +
+
+ {column.name}
-
-
- {column.name} -
-
- {column.description} -
+
+ {column.description}
+
+
+
+
+ +
+ + + + {events.map((event) => ( + + ))} + + + + + + + +
- - - - {events.map((event) => ( - - ))} - - - - - - -
); } diff --git a/src/routes/columns/_layout/search.lazy.tsx b/src/routes/columns/_layout/search.lazy.tsx index ba603a78..f740b34f 100644 --- a/src/routes/columns/_layout/search.lazy.tsx +++ b/src/routes/columns/_layout/search.lazy.tsx @@ -84,59 +84,61 @@ function Screen() { }; return ( -
-
- setQuery(e.target.value)} - onKeyDown={(event) => { - if (event.key === "Enter") search(); - }} - className="h-9 px-5 flex-1 rounded-full border-none bg-black/5 dark:bg-white/10 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus:bg-black/10 dark:focus:bg-white/10 focus:outline-none focus:ring-0" - /> - -
- - - +
+
+
+ setQuery(e.target.value)} + onKeyDown={(event) => { + if (event.key === "Enter") search(); + }} + className="h-9 px-5 flex-1 rounded-full border-none bg-black/5 dark:bg-white/10 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus:bg-black/10 dark:focus:bg-white/10 focus:outline-none focus:ring-0" + /> +
+ - - - - + + + {isPending ? ( +
+ + Searching... +
+ ) : !events.length ? ( +
+ Type somethings to search. +
+ ) : ( + events.map((event) => renderItem(event)) + )} +
+
+ + + + + +
); } diff --git a/src/routes/columns/_layout/stories.lazy.tsx b/src/routes/columns/_layout/stories.lazy.tsx index ca9f3430..1167c68b 100644 --- a/src/routes/columns/_layout/stories.lazy.tsx +++ b/src/routes/columns/_layout/stories.lazy.tsx @@ -65,7 +65,7 @@ function StoryItem({ contact }: { contact: string }) { const ref = useRef(null); return ( -
+
diff --git a/src/routes/columns/_layout/trending.lazy.tsx b/src/routes/columns/_layout/trending.lazy.tsx index ed81b35d..5b6f0e2f 100644 --- a/src/routes/columns/_layout/trending.lazy.tsx +++ b/src/routes/columns/_layout/trending.lazy.tsx @@ -12,7 +12,7 @@ export const Route = createLazyFileRoute("/columns/_layout/trending")({ }); function Screen() { - const { isLoading, isError, data } = useQuery({ + const { isLoading, data } = useQuery({ queryKey: ["trending-notes"], queryFn: async ({ signal }) => { const res = await fetch("https://api.nostr.band/v0/trending/notes", { @@ -43,12 +43,30 @@ function Screen() { if (!event) return; switch (event.kind) { case Kind.Repost: - return ; + return ( + + ); default: { if (event.isQuote) { - return ; + return ( + + ); } else { - return ; + return ( + + ); } } } @@ -60,22 +78,21 @@ function Screen() { - + {isLoading ? ( -
-
- - Loading... -
+
+ + Loading...
- ) : isError ? ( -
-
- Error. -
+ ) : !data.length ? ( +
+ 🎉 Yo. You're catching up on all latest notes.
) : ( data.map((item) => renderItem(item)) diff --git a/src/routes/columns/_layout/users.$id.lazy.tsx b/src/routes/columns/_layout/users.$id.lazy.tsx index 73a33153..81900986 100644 --- a/src/routes/columns/_layout/users.$id.lazy.tsx +++ b/src/routes/columns/_layout/users.$id.lazy.tsx @@ -22,7 +22,7 @@ function Screen() { const { isLoading, data: events } = useQuery({ queryKey: ["stories", id], queryFn: async () => { - const res = await commands.getEventsBy(id, 20); + const res = await commands.getEventsBy(id, 100); if (res.status === "ok") { const data = toLumeEvents(res.data); @@ -41,12 +41,30 @@ function Screen() { if (!event) return; switch (event.kind) { case Kind.Repost: - return ; + return ( + + ); default: { if (event.isQuote) { - return ; + return ( + + ); } - return ; + return ( + + ); } } }, @@ -57,21 +75,24 @@ function Screen() { - + -
+
-
+
- +