Skip to content

Commit

Permalink
Merge branch 'pdelfan:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan authored Sep 13, 2024
2 parents 63da2b2 + 4d7d367 commit d79cc08
Show file tree
Hide file tree
Showing 39 changed files with 198 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/app/(auth)/login/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Metadata } from "next";
import Image from "next/image";

export const metadata: Metadata = {
title: "Ouranos — Login",
title: "Login",
description: "Your Bluesky web client",
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/(site)/about/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos - About",
title: "About",
description: "About Ouranos",
};

Expand Down
7 changes: 0 additions & 7 deletions src/app/dashboard/feeds/[feed]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Feed",
description: "Feed",
};

export default function FeedLayout({
children,
}: {
Expand Down
14 changes: 14 additions & 0 deletions src/app/dashboard/feeds/[feed]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import FeedHeader from "@/components/contentDisplay/feedHeader/FeedHeader";
import FeedContainer from "@/containers/posts/FeedContainer";
import { getFeedInfo } from "@/lib/api/bsky/feed";
import { Metadata } from "next";

export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
const feedInfo = await getFeedInfo(searchParams.uri);
const title = feedInfo.view.displayName
? feedInfo.view.displayName
: "Feed";

return {
title: title + " — Ouranos",
description: "Feed",
};
}

interface Props {
searchParams: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/feeds/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Feeds",
title: "Feeds",
description: "Feeds",
};

Expand Down
14 changes: 14 additions & 0 deletions src/app/dashboard/home/[feed]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import FeedContainer from "@/containers/posts/FeedContainer";
import { getFeedInfo } from "@/lib/api/bsky/feed";
import { Metadata } from "next";

export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
const feedInfo = await getFeedInfo(searchParams.uri);
const title = feedInfo.view.displayName
? feedInfo.view.displayName
: "Feed";

return {
title: title + " — Ouranos",
description: "Feed",
};
}

interface Props {
searchParams: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/home/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import FeedTabs from "@/components/navigational/feedTabs/FeedTabs";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Home",
title: "Home",
description: "Home",
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getProfile } from "@/lib/api/bsky/actor";
import { getSessionFromServer } from "@/lib/api/auth/session";

export const metadata: Metadata = {
title: "Ouranos",
title: { template: "%s — Ouranos", default: "Ouranos" },
description: "Home",
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/lists/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Lists",
title: "Lists",
description: "Lists",
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/notifications/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Notifications",
title: "Notifications",
description: "Notifications",
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/search/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Search",
title: "Search",
description: "Search",
};

Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/settings/appearance/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import AppearanceContainer from "@/containers/settings/AppearanceContainer/AppearanceContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Appearance",
description: "Appearance",
};

export default function Page() {
return <AppearanceContainer />;
Expand Down
7 changes: 7 additions & 0 deletions src/app/dashboard/settings/blocked-users/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import BlockedUsersContainer from "@/containers/settings/blockedUsersContainer/BlockedUsersContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Blocked Users",
description: "Blocked Users",
};


export default function Page() {
return <BlockedUsersContainer />;
Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/settings/content-filtering/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import ContentFilteringContainer from "@/containers/settings/contentFilteringContainer/ContentFilteringContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Content Filtering",
description: "Content Filtering",
};

export default function Page() {
return <ContentFilteringContainer />;
Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/settings/home-feed/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import HomeFeedContainer from "@/containers/settings/homeFeedContainer/HomeFeedContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Home Feed Preferences",
description: "Home Feed Preferences",
};

export default function Page() {
return <HomeFeedContainer />;
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Settings",
title: { template: "%sOuranos", default: "Settings" },
description: "Settings",
};

Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/settings/muted-users/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import MutedUsersContainer from "@/containers/settings/mutedUsersContainer/MutedUsersContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Muted Users",
description: "Muted Users",
};

export default function Page() {
return <MutedUsersContainer />;
Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/settings/my-feeds/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import MyFeedsContainer from "@/containers/settings/myFeedsContainer/MyFeedsContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "My Feeds",
description: "My Feeds",
};

export default function Page() {
return <MyFeedsContainer />;
Expand Down
6 changes: 6 additions & 0 deletions src/app/dashboard/settings/thread-preferences/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import ThreadPreferencesContainer from "@/containers/settings/threadPreferencesContainer/ThreadPreferencesContainer";
import { Metadata } from "next";

export const metadata: Metadata = {
title: "Thread Preferences",
description: "Thread Preferences",
};

export default function Page() {
return <ThreadPreferencesContainer />;
Expand Down
16 changes: 12 additions & 4 deletions src/app/dashboard/user/[handle]/(content)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import type { Metadata } from "next";
import ProfileHeader from "@/components/contentDisplay/profileHeader/ProfileHeader";
import { getProfile } from "@/lib/api/bsky/actor";

export const metadata: Metadata = {
title: "Ouranos — Profile",
description: "Profile",
};
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const profile = await getProfile(params.handle);
const title = profile?.displayName
? `${profile.displayName} (@${params.handle})`
: params.handle;

return {
title: title,
description: "Profile",
};
}

interface Props {
params: { handle: string };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import FollowingContainer from "@/containers/users/FollowingContainer";
import KnownFollowersContainer from "@/containers/users/KnownFollowersContainer";
import type { Metadata } from "next";

export function generateMetadata({ params }: Props): Metadata {
const title = `Followers of @${params.handle} that you know`;
const descripton = `Followers of @${params.handle} that you know`;

return {
title: title,
description: descripton,
};
}

interface Props {
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Liked By",
description: "Liked By",
};

export default function LikedByLayout({
children,
Expand Down
11 changes: 11 additions & 0 deletions src/app/dashboard/user/[handle]/(post)/post/[id]/liked-by/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import LikedByContainer from "@/containers/thread/LikedByContainer";
import type { Metadata } from "next";

export function generateMetadata({ params }: Props): Metadata {
const title = `@${params.handle}'s Post Liked By`;
const descripton = `Users who have liked @${params.handle}'s post`;

return {
title: title,
description: descripton,
};
}

interface Props {
params: {
Expand Down
27 changes: 27 additions & 0 deletions src/app/dashboard/user/[handle]/(post)/post/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
import PostThreadContainer from "@/containers/thread/PostThreadContainer";
import { getSessionFromServer } from "@/lib/api/auth/session";
import { getProfile } from "@/lib/api/bsky/actor";
import { getAgent } from "@/lib/api/bsky/agent";
import { getPostThread } from "@/lib/api/bsky/feed";
import { AppBskyFeedDefs, AppBskyFeedPost } from "@atproto/api";
import { Metadata } from "next";

export async function generateMetadata({ params }: Props): Promise<Metadata> {
const agent = await getAgent();
const { handle, id } = params;
const { data } = await agent.resolveHandle({ handle });
const uri = `at://${data.did}/app.bsky.feed.post/${id}`;
const post = await getPostThread(uri);

const isThreadViewPost = AppBskyFeedDefs.isThreadViewPost(post) ? true : false;
const threadPost = isThreadViewPost ? post.post as AppBskyFeedDefs.PostView : null;

const text =
threadPost && AppBskyFeedPost.isRecord(threadPost.record)
? threadPost.record.text
: "";

const title = text !== "" ? `${threadPost?.author.displayName || params.handle}: "${text}"` : `Post by ${params.handle}`;

return {
title: title,
description: "Feed",
};
}

interface Props {
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Quotes",
description: "Quotes for this post",
};

export default function RepostedByLayout({
children,
Expand Down
11 changes: 11 additions & 0 deletions src/app/dashboard/user/[handle]/(post)/post/[id]/quotes/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import QuotesContainer from "@/containers/thread/QuotesContainer";
import type { Metadata } from "next";

export function generateMetadata({ params }: Props): Metadata {
const title = `@${params.handle}'s Post Quotes`;
const descripton = `Users who have quoted @${params.handle}'s post`;

return {
title: title,
description: descripton,
};
}

interface Props {
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import Layout from "@/containers/Layout";
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — Reposted By",
description: "Reposted By",
};

export default function RepostedByLayout({
children,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import RepostedByContainer from "@/containers/thread/RepostedByContainer";
import type { Metadata } from "next";

export function generateMetadata({ params }: Props): Metadata {
const title = `@${params.handle}'s Post Reposted By`;
const descripton = `Users who have reposted @${params.handle}'s post`;

return {
title: title,
description: descripton,
};
}

interface Props {
params: {
Expand Down
7 changes: 0 additions & 7 deletions src/app/dashboard/user/[handle]/lists/[list]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Ouranos — List",
description: "List",
};

export default function ListsLayout({
children,
}: {
Expand Down
14 changes: 14 additions & 0 deletions src/app/dashboard/user/[handle]/lists/[list]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import ListContainer from "@/containers/lists/ListContainer";
import { getListInfo } from "@/lib/api/bsky/list";
import { Metadata } from "next";

export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
const listInfo = await getListInfo(searchParams.uri);
const title = listInfo.list.name
? listInfo.list.name
: "List";

return {
title: title,
description: "Feed",
};
}

interface Props {
searchParams: {
Expand Down
Loading

0 comments on commit d79cc08

Please sign in to comment.