From 2075d1b15a753887ebd6544e1949a53784b414d1 Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Sun, 28 Jan 2024 18:29:46 -0800 Subject: [PATCH 1/4] Update ListItem.tsx --- src/components/contentDisplay/listItem/ListItem.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/contentDisplay/listItem/ListItem.tsx b/src/components/contentDisplay/listItem/ListItem.tsx index 69c1f326..3114adb6 100644 --- a/src/components/contentDisplay/listItem/ListItem.tsx +++ b/src/components/contentDisplay/listItem/ListItem.tsx @@ -10,12 +10,13 @@ interface Props { export default function ListItem(props: Props) { const { list } = props; const { avatar, name, description, creator, uri, viewer, indexedAt } = list; - const formattedUri = uri.split(":")[3].split("/")[2]; return ( Date: Sun, 28 Jan 2024 19:06:10 -0800 Subject: [PATCH 2/4] Move lists to correct directory --- .../[handle]/{(lists) => }/lists/[uri]/layout.tsx | 2 +- .../[handle]/{(lists) => }/lists/[uri]/page.tsx | 0 src/app/dashboard/user/[handle]/lists/layout.tsx | 14 ++++++++++++++ .../contentDisplay/listItem/ListItem.tsx | 2 ++ src/components/dataDisplay/postEmbed/FeedEmbed.tsx | 2 -- 5 files changed, 17 insertions(+), 3 deletions(-) rename src/app/dashboard/user/[handle]/{(lists) => }/lists/[uri]/layout.tsx (84%) rename src/app/dashboard/user/[handle]/{(lists) => }/lists/[uri]/page.tsx (100%) create mode 100644 src/app/dashboard/user/[handle]/lists/layout.tsx diff --git a/src/app/dashboard/user/[handle]/(lists)/lists/[uri]/layout.tsx b/src/app/dashboard/user/[handle]/lists/[uri]/layout.tsx similarity index 84% rename from src/app/dashboard/user/[handle]/(lists)/lists/[uri]/layout.tsx rename to src/app/dashboard/user/[handle]/lists/[uri]/layout.tsx index c58b815d..65cbbee0 100644 --- a/src/app/dashboard/user/[handle]/(lists)/lists/[uri]/layout.tsx +++ b/src/app/dashboard/user/[handle]/lists/[uri]/layout.tsx @@ -5,7 +5,7 @@ export const metadata: Metadata = { description: "List", }; -export default function FeedLayout({ +export default function ListsLayout({ children, }: { children: React.ReactNode; diff --git a/src/app/dashboard/user/[handle]/(lists)/lists/[uri]/page.tsx b/src/app/dashboard/user/[handle]/lists/[uri]/page.tsx similarity index 100% rename from src/app/dashboard/user/[handle]/(lists)/lists/[uri]/page.tsx rename to src/app/dashboard/user/[handle]/lists/[uri]/page.tsx diff --git a/src/app/dashboard/user/[handle]/lists/layout.tsx b/src/app/dashboard/user/[handle]/lists/layout.tsx new file mode 100644 index 00000000..65cbbee0 --- /dev/null +++ b/src/app/dashboard/user/[handle]/lists/layout.tsx @@ -0,0 +1,14 @@ +import type { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Ouranos — List", + description: "List", +}; + +export default function ListsLayout({ + children, +}: { + children: React.ReactNode; +}) { + return <>{children}; +} diff --git a/src/components/contentDisplay/listItem/ListItem.tsx b/src/components/contentDisplay/listItem/ListItem.tsx index 3114adb6..dfe6810e 100644 --- a/src/components/contentDisplay/listItem/ListItem.tsx +++ b/src/components/contentDisplay/listItem/ListItem.tsx @@ -1,3 +1,5 @@ +"use client"; + import { ListView } from "@atproto/api/dist/client/types/app/bsky/graph/defs"; import Image from "next/image"; import Link from "next/link"; diff --git a/src/components/dataDisplay/postEmbed/FeedEmbed.tsx b/src/components/dataDisplay/postEmbed/FeedEmbed.tsx index 31ad06c5..8f684055 100644 --- a/src/components/dataDisplay/postEmbed/FeedEmbed.tsx +++ b/src/components/dataDisplay/postEmbed/FeedEmbed.tsx @@ -3,7 +3,6 @@ import { AppBskyFeedDefs } from "@atproto/api"; import FallbackFeed from "@/assets/images/fallbackFeed.png"; import { BiSolidHeart } from "react-icons/bi"; import Link from "next/link"; -import { useRouter } from "next/navigation"; interface Props { feed: AppBskyFeedDefs.GeneratorView; @@ -12,7 +11,6 @@ interface Props { export default function FeedEmbed(props: Props) { const { feed, depth } = props; - const router = useRouter(); return ( <> From b601ee850c0085b17bd5bf92817a4419a0ca8b77 Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Sun, 28 Jan 2024 19:23:10 -0800 Subject: [PATCH 3/4] Log list uri --- .../user/[handle]/lists/{[uri] => [list]}/layout.tsx | 0 .../user/[handle]/lists/{[uri] => [list]}/page.tsx | 0 src/components/contentDisplay/listItem/ListItem.tsx | 1 + src/containers/lists/ListContainer.tsx | 8 +++++++- 4 files changed, 8 insertions(+), 1 deletion(-) rename src/app/dashboard/user/[handle]/lists/{[uri] => [list]}/layout.tsx (100%) rename src/app/dashboard/user/[handle]/lists/{[uri] => [list]}/page.tsx (100%) diff --git a/src/app/dashboard/user/[handle]/lists/[uri]/layout.tsx b/src/app/dashboard/user/[handle]/lists/[list]/layout.tsx similarity index 100% rename from src/app/dashboard/user/[handle]/lists/[uri]/layout.tsx rename to src/app/dashboard/user/[handle]/lists/[list]/layout.tsx diff --git a/src/app/dashboard/user/[handle]/lists/[uri]/page.tsx b/src/app/dashboard/user/[handle]/lists/[list]/page.tsx similarity index 100% rename from src/app/dashboard/user/[handle]/lists/[uri]/page.tsx rename to src/app/dashboard/user/[handle]/lists/[list]/page.tsx diff --git a/src/components/contentDisplay/listItem/ListItem.tsx b/src/components/contentDisplay/listItem/ListItem.tsx index dfe6810e..1b23cb3b 100644 --- a/src/components/contentDisplay/listItem/ListItem.tsx +++ b/src/components/contentDisplay/listItem/ListItem.tsx @@ -24,6 +24,7 @@ export default function ListItem(props: Props) { className="flex flex-col gap-2 border border-x-0 p-3 last:border-b hover:bg-neutral-50 md:border-x md:first:rounded-t-2xl md:last:rounded-b-2xl odd:[&:not(:last-child)]:border-b-0 even:[&:not(:last-child)]:border-b-0" >
+ <>{uri}
("posts"); + const searchParams = useSearchParams(); + const uriLookedUp = searchParams.get("uri"); + console.log("uri received using searchPrams hooks:", uriLookedUp); const handleTabChange = (tab: "posts" | "members") => { setCurrentTab(tab); @@ -23,7 +27,9 @@ export default function ListContainer(props: Props) {