Skip to content

Commit

Permalink
Added metadata for wave pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dkildar committed Dec 6, 2024
1 parent 9d2b985 commit aa19172
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 20 deletions.
6 changes: 6 additions & 0 deletions src/app/waves/[author]/[permlink]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { WaveEntry } from "@/entities";
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
import { getQueryClient } from "@/core/react-query";
import { EcencyConfigManager } from "@/config";
import { Metadata } from "next";

interface Props {
params: Promise<{
Expand All @@ -13,6 +14,11 @@ interface Props {
}>;
}

export const metadata: Metadata = {
title: "Waves | Ecency",
description: "Micro-blogging in decentralized system of Web 3.0"
};

export default async function WaveViewPage({ params }: Props) {
const isWavesEnabled = EcencyConfigManager.useConfig(
({ visionFeatures }) => visionFeatures.waves.enabled
Expand Down
16 changes: 9 additions & 7 deletions src/app/waves/_components/waves-list-item-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ export function WavesListItemHeader({ entry, status, hasParent, pure }: Props) {
</>
)}

<Link
target="_blank"
className="text-sm text-gray-600 dark:text-gray-400 after:!content-none hover:underline"
href={`/created/${entry.category}`}
>
#{entry.host}
</Link>
{entry.host && (
<Link
target="_blank"
className="text-sm text-gray-600 dark:text-gray-400 after:!content-none hover:underline"
href={`/created/${entry.category}`}
>
#{entry.host}
</Link>
)}
</div>
</div>

Expand Down
18 changes: 18 additions & 0 deletions src/app/waves/_page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use client";

import useLocalStorage from "react-use/lib/useLocalStorage";
import { PREFIX } from "@/utils/local-storage";
import { WavesHostSelection } from "@/app/waves/_components/waves-host-selection";
import { WavesCreateCard, WavesList } from "@/app/waves/_components";

export function WavesPage() {
const [host, setHost] = useLocalStorage(PREFIX + "_wh", "ecency.waves");

return (
<>
<WavesHostSelection host={host!} setHost={setHost} />
<WavesCreateCard />
<WavesList host={host!} />
</>
);
}
26 changes: 13 additions & 13 deletions src/app/waves/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"use client";

import { WavesCreateCard, WavesList } from "@/app/waves/_components";
import { WavesHostSelection } from "@/app/waves/_components/waves-host-selection";
import useLocalStorage from "react-use/lib/useLocalStorage";
import { PREFIX } from "@/utils/local-storage";
import { WavesPage } from "@/app/waves/_page";
import { Metadata } from "next";
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
import { getQueryClient } from "@/core/react-query";
import { EcencyConfigManager } from "@/config";
import { notFound } from "next/navigation";

export default function WavesPage() {
const [host, setHost] = useLocalStorage(PREFIX + "_wh", "ecency.waves");
export const metadata: Metadata = {
title: "Waves | Ecency",
description: "Micro-blogging in decentralized system of Web 3.0"
};

export default function WavesServerPage() {
const isWavesEnabled = EcencyConfigManager.useConfig(
({ visionFeatures }) => visionFeatures.waves.enabled
);
Expand All @@ -18,10 +20,8 @@ export default function WavesPage() {
}

return (
<>
<WavesHostSelection host={host!} setHost={setHost} />
<WavesCreateCard />
<WavesList host={host!} />
</>
<HydrationBoundary state={dehydrate(getQueryClient())}>
<WavesPage />
</HydrationBoundary>
);
}

0 comments on commit aa19172

Please sign in to comment.