Skip to content

Commit

Permalink
Merge pull request #150 from BibliothecaDAO/content-tweaks
Browse files Browse the repository at this point in the history
add games and linke to avnu
  • Loading branch information
RedBeardEth authored Mar 5, 2024
2 parents 9d4dd3e + b46a051 commit 533db56
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
Binary file modified apps/nextjs/public/games/realms-eternum/screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions apps/nextjs/src/app/games/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import path from "path";*/
import type { Metadata } from "next";

import { CHAIN_IDS_TO_NAMES, games } from "@realms-world/constants";
import { CHAIN_IDS_TO_NAMES, Tokens, games } from "@realms-world/constants";
import {
Button,
Carousel,
Expand All @@ -17,8 +17,10 @@ export async function generateMetadata({
}: {
params: { id: string };
}): Promise<Metadata> {
const name = games.find((game) => game.id === params.id)?.name ?? "Game";

return {
title: `${params.id} Homepage`,
title: `${name}`,
description: `${params.id} - Created for Adventurers by Bibliotheca DAO`,
};
}
Expand Down Expand Up @@ -52,11 +54,21 @@ export default async function Page({ params }: { params: { id: string } }) {
content: (
<div>
<div className="flex gap-x-2">
{game?.tokens?.map((token, index) => (
<Button href={`/tokens/${token}`} key={index}>
{token}
</Button>
))}
{game?.tokens?.map((token, index) =>
token === Tokens.LORDS ? (
<Button
href="https://app.avnu.fi/en?amount=100&tokenFrom=0x124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49&tokenTo=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
key={index}
>
{token}
</Button>
) : (
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
<Button href={`/tokens/${token}`} key={index}>
{token}
</Button>
),
)}
{game?.collections?.map((collection, index) => (
<Button href={`/collection/${collection}`} key={index}>
{collection}
Expand Down
3 changes: 2 additions & 1 deletion apps/nextjs/src/app/games/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { Metadata } from "next";
import { GameCard } from "@/app/games/GameCard";

import type { Game } from "@realms-world/constants";
import { games } from "@realms-world/constants";

import { PageLayout } from "../_components/PageLayout";

export const metadata = {
export const metadata: Metadata = {
title: "Games of the Realms",
description:
"Fully Onchain Games in the Realms Autonomous World- Created for adventurers by Bibliotheca DAO",
Expand Down
10 changes: 5 additions & 5 deletions packages/constants/src/Games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ export const games: Game[] = [
name: "Realms: Eternum",
id: "realms-eternum",
developer: "BiblioDAO",
genres: ["Economic Strategy", "PvP", "Raiding"],
genres: ["Economic Strategy", "PvP", "Raiding", "Economy"],
color: "#f5f5f5",
status: "alpha",
description: "Conquer the Realms",
description: "The Economic Seed of the Realms World",
longform:
"Eternum is a strategy game that is built on StarkNet. It is a game of management and conquest, where players must build and defend their Realm to thrive. The game is governed by a set of rules that are enforced by the game's smart contracts.",
"Eternum is built on Cairo smart contracts and runs on the Dojo game engine. It's open-source, licensed under both MIT for software freedom and CC0 for public domain use, ensuring wide accessibility and community-driven development.",
links: {
homepage: "https://next-eternum.realms.world/",
discord: "https://discord.gg/uQnjZhZPfu",
Expand All @@ -50,7 +50,7 @@ export const games: Game[] = [
chains: [ChainId.SN_SEPOLIA],
collections: [Collections.REALMS],
tokens: [Tokens.LORDS],
screenshotLength: 1,
screenshotLength: 3,
},
{
name: "Loot Survivor",
Expand Down Expand Up @@ -282,5 +282,5 @@ export const games: Game[] = [
operatingSystems: ["Web Browser"],
tokens: [Tokens.LORDS],
screenshotLength: 4,
}
},
];

0 comments on commit 533db56

Please sign in to comment.