Skip to content

Commit

Permalink
feat: metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
leduyhien152 committed Mar 28, 2024
1 parent a509a61 commit 0b48811
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
37 changes: 37 additions & 0 deletions app/[server]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { serverList } from "@/constants/servers";

type Props = {
params: { server: string };
};

export async function generateMetadata(props: Props): Promise<Metadata> {
const {
params: { server },
} = props;
const serverName = serverList.find((s) => s.id === server)?.name;

if (!serverName) return {};

return {
title: `${serverName} Earning`,
openGraph: {
title: `${serverName} Earning`,
},
};
}

export default function Layout({
children,
...props
}: { children: React.ReactNode } & Props) {
const {
params: { server },
} = props;
const serverInfo = serverList.find((s) => s.id === server);

if (!serverInfo) return notFound();

return <>{children}</>;
}
File renamed without changes.
File renamed without changes.
Binary file modified app/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions components/stake/stake-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const StakeInput = (props: Props) => {

return (
<div className="rounded-xl bg-background-level2 p-3 space-y-3">
<div className="flex items-center justify-between min-h-[34px] flex-col space-y-1 sm:flex-row sm:space-y-0">
<div className="flex items-center justify-between min-h-[34px]">
<Typography level="h9" color="textSecondary">
You’re staking
</Typography>
Expand Down Expand Up @@ -174,7 +174,7 @@ export const StakeInput = (props: Props) => {
</Button>
</div>
</div>
<div className="flex items-center justify-between flex-col sm:flex-row">
<div className="flex items-center justify-between">
<Typography className="!text-[13px] text-text-tertiary">
≈ $0.00 USD
</Typography>
Expand Down
6 changes: 6 additions & 0 deletions constants/servers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const serverList = [
{
id: "dwarves",
name: "Dwarves Foundation",
},
];

0 comments on commit 0b48811

Please sign in to comment.