-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
635 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ouranos", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import FeedContainer from "@/containers/FeedContainer"; | ||
import FeedContainer from "@/containers/posts/FeedContainer"; | ||
|
||
export default function Home() { | ||
return <FeedContainer feed="timeline" />; | ||
return <FeedContainer feed="timeline" mode="feed" />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Layout from "@/containers/Layout"; | ||
import type { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Ouranos — Lists", | ||
description: "Lists", | ||
}; | ||
|
||
export default function FeedLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <Layout>{children}</Layout>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import ListsSkeleton from "@/components/contentDisplay/lists/ListsSkeleton"; | ||
|
||
export default function Loading() { | ||
return ( | ||
<section> | ||
<h2 className="mx-3 mb-2 text-2xl font-semibold md:mx-0">My Lists</h2> | ||
<ListsSkeleton /> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Lists from "@/components/contentDisplay/lists/Lists"; | ||
|
||
export default function Page() { | ||
return ( | ||
<section> | ||
<h2 className="mx-3 mb-2 text-2xl font-semibold md:mx-0">My Lists</h2> | ||
<Lists /> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/app/dashboard/user/[handle]/(lists)/lists/[uri]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Ouranos — List", | ||
description: "List", | ||
}; | ||
|
||
export default function FeedLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <>{children}</>; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/app/dashboard/user/[handle]/(lists)/lists/[uri]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import ListContainer from "@/containers/lists/ListContainer"; | ||
|
||
interface Props { | ||
searchParams: { | ||
uri: string; | ||
}; | ||
} | ||
|
||
export default function Page(props: Props) { | ||
const { searchParams } = props; | ||
|
||
return <ListContainer uri={searchParams.uri} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"use client"; | ||
|
||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import FallbackList from "@/assets/images/fallbackList.png"; | ||
import ListHeaderSkeleton from "./ListHeaderSkeleton"; | ||
import useListInfo from "@/lib/hooks/bsky/list/useListInfo"; | ||
|
||
interface Props { | ||
list: string; | ||
} | ||
|
||
export default function FeedHeader(props: Props) { | ||
const { list } = props; | ||
const { | ||
listInfo, | ||
isLoadingListInfo, | ||
isFetchingListInfo, | ||
isRefetchingListInfo, | ||
listInfoError, | ||
} = useListInfo(list); | ||
|
||
return ( | ||
<> | ||
{isFetchingListInfo && <ListHeaderSkeleton />} | ||
{!isFetchingListInfo && listInfo && ( | ||
<> | ||
<article className="flex flex-col gap-2 border border-x-0 border-y-0 p-3 md:rounded-t-2xl md:border md:border-b-0"> | ||
<div className="flex flex-wrap items-center justify-between gap-3"> | ||
<div className="flex flex-wrap items-center gap-3"> | ||
<Image | ||
src={listInfo.list.avatar ?? FallbackList} | ||
alt={listInfo.list.name} | ||
width={60} | ||
height={60} | ||
className={`rounded-lg ${!listInfo.list.avatar && "border"}`} | ||
/> | ||
<div className="flex flex-col"> | ||
<h2 className="break-words text-xl font-semibold text-neutral-700"> | ||
{listInfo.list.name} | ||
</h2> | ||
<h3 className="break-all text-neutral-500"> | ||
By{" "} | ||
<Link | ||
href={`/dashboard/user/${listInfo.list.creator.handle}`} | ||
className="font-medium hover:text-neutral-400" | ||
> | ||
@{listInfo.list.creator.handle} | ||
</Link> | ||
</h3> | ||
</div> | ||
</div> | ||
</div> | ||
{listInfo.list.description && ( | ||
<p className="break-words text-neutral-700" dir="auto"> | ||
{listInfo.list.description} | ||
</p> | ||
)} | ||
</article> | ||
</> | ||
)} | ||
</> | ||
); | ||
} |
21 changes: 21 additions & 0 deletions
21
src/components/contentDisplay/listHeader/ListHeaderSkeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export default function ListHeaderSkeleton() { | ||
return ( | ||
<article className="flex flex-col gap-2 border border-x-0 border-y-0 p-3 md:rounded-t-2xl md:border-x md:border-t"> | ||
<div className="flex flex-wrap items-center justify-between gap-3"> | ||
<div className="flex items-center gap-3"> | ||
<div className="h-[60px] w-[60px] animate-pulse rounded-lg bg-gray-200" /> | ||
<div className="flex flex-col gap-3"> | ||
<div className="h-4 w-20 animate-pulse rounded bg-gray-200" /> | ||
<div className="h-4 w-32 animate-pulse rounded bg-gray-200" /> | ||
</div> | ||
</div> | ||
<div className="flex flex-wrap gap-3"> | ||
<div className="h-9 w-9 animate-pulse rounded-lg bg-gray-200" /> | ||
</div> | ||
</div> | ||
<div className="mt-2 h-3 w-4/5 animate-pulse rounded bg-gray-200" /> | ||
<div className="h-3 w-3/4 animate-pulse rounded bg-gray-200" /> | ||
<div className="h-3 w-5/6 animate-pulse rounded bg-gray-200" /> | ||
</article> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { ListView } from "@atproto/api/dist/client/types/app/bsky/graph/defs"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import FallbackList from "@/assets/images/fallbackList.png"; | ||
|
||
interface Props { | ||
list: ListView; | ||
} | ||
|
||
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 ( | ||
<Link | ||
href={{ | ||
pathname: `/dashboard/user/${creator.handle}/lists/${encodeURIComponent(formattedUri)}`, | ||
query: { uri: uri }, | ||
}} | ||
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" | ||
> | ||
<div className="flex flex-wrap items-center justify-between gap-3"> | ||
<div className="flex flex-wrap items-center gap-3"> | ||
<Image | ||
src={avatar ?? FallbackList} | ||
alt={name} | ||
width={40} | ||
height={40} | ||
className={`rounded-lg ${!avatar && "border"}`} | ||
/> | ||
<div className="flex flex-col"> | ||
<h2 className="break-words font-semibold text-neutral-700"> | ||
{list.name} | ||
</h2> | ||
<h3 className="break-all text-sm text-neutral-500"> | ||
By @{creator.handle} | ||
</h3> | ||
</div> | ||
</div> | ||
</div> | ||
{description && ( | ||
<p className="break-words text-neutral-700">{description}</p> | ||
)} | ||
</Link> | ||
); | ||
} |
Oops, something went wrong.