Skip to content

Commit

Permalink
feat: remove eternum season 0 pass from market
Browse files Browse the repository at this point in the history
  • Loading branch information
MartianGreed committed Jan 2, 2025
1 parent 5673441 commit c44a254
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 482 deletions.
25 changes: 0 additions & 25 deletions apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { notFound } from "next/navigation";
import { ChainId, CollectionAddresses, Collections } from "~/config/homepage";

Check failure on line 2 in apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

'Collections' is defined but never used. Allowed unused vars must match /^_/u
import TokenPage from "~/app/token/[contractAddress]/[tokenId]/page";
import type { Metadata } from "next";
import getCollection from "~/lib/getCollection";
import { env } from "~/env";

interface GenerateMetadataProps {
Expand All @@ -14,30 +13,6 @@ export async function generateMetadata({
}: GenerateMetadataProps): Promise<Metadata> {
const collection = CollectionAddresses[params.collectionAddress];

Check failure on line 14 in apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

Unsafe assignment of an error typed value

Check failure on line 14 in apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

Computed name [params.collectionAddress] resolves to an `error` typed value
const collectionAddress = collection[ChainId.SN_MAIN];

Check failure on line 15 in apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

Unsafe assignment of an error typed value

Check failure on line 15 in apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

Unsafe member access [ChainId.SN_MAIN] on an `error` typed value
if (collectionAddress === CollectionAddresses[Collections.ETERNUMSEASONPASS][ChainId.SN_MAIN]) {
return {
title: `Eternum Season 0 Pass`,
description: 'Conquer the Realms',
openGraph: {
images: [
{
url: `https://market.realms.world/og/eternum-season-pass.png`,
width: 1200,
height: 630,
},
],
},
twitter: {
images: [
{
url: `https://market.realms.world/og/eternum-season-pass.png`,
width: 1200,
height: 630,
},
],
},
}
}
const platform =
env.NEXT_PUBLIC_THEME === "unframed" ? "Unframed" : "Ark Market";
const name = collection?.name ?? "Collection";

Check failure on line 18 in apps/arkmarket/src/app/[collectionAddress]/[tokenId]/page.tsx

View workflow job for this annotation

GitHub Actions / lint

Unsafe assignment of an error typed value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import type { CollectionToken } from "~/types";
import CollectionItemsBuyNow from "./collection-items-buy-now";
import { CollectionTokenImage } from "./collection-token-image";
import { env } from "~/env";
import { useSeasonPass } from "~/hooks/useSeasonPass";

const LargeGridContainer = forwardRef<
HTMLDivElement,
Expand Down Expand Up @@ -86,8 +85,7 @@ export default function CollectionItemsDataGridView({
}

function CollectionGridTokenItem({ token, viewType }: { token: CollectionToken, viewType: string }) {
const { realmName, isSeasonPass } = useSeasonPass(token);
const tokenName = isSeasonPass(token.collection_address) ? realmName : token.metadata?.name ?? token.token_id;
const tokenName = token.metadata?.name ?? token.token_id;

return (
<NftCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import Media from "~/components/media";
import { PriceTag } from "@ark-market/ui/price-tag";
import Link from "next/link";
import { env } from "~/env";
import { useSeasonPass } from "~/hooks/useSeasonPass";

const gridTemplateColumnValue =
"grid-cols-[minmax(10rem,2fr)_repeat(5,minmax(7.25rem,1fr))]";
Expand Down Expand Up @@ -103,8 +102,7 @@ export default function CollectionItemsDataListView({
);
}
function CollectionTokenItem({ token, rowVirtualizer, virtualRow }: { token: CollectionToken, rowVirtualizer: Virtualizer<Window, Element>, virtualRow: VirtualItem }) {
const { realmName, isSeasonPass } = useSeasonPass(token);
const tokenName = isSeasonPass(token.collection_address) ? realmName : token.metadata?.name ?? token.token_id;
const tokenName = token.metadata?.name ?? token.token_id;

return (
<TableRow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import type { PropsWithClassName } from "@ark-market/ui";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@ark-market/ui/tooltip";
import type { WalletToken } from "~/app/wallet/[walletAddress]/queries/getWalletData";
import Media from "~/components/media";
import { useBeasts } from "~/hooks/useBeasts";
import type { Resources } from "~/hooks/useSeasonPass";
import { useSeasonPass } from "~/hooks/useSeasonPass";
import type { CollectionToken } from "~/types";

interface CollectionTokenImageProps {
Expand All @@ -16,7 +13,6 @@ interface CollectionTokenImageProps {

export function CollectionTokenImage({ token, height, width }: PropsWithClassName<CollectionTokenImageProps>) {
const { attributes, isBeast, beastTypeIcon, formatBeastName } = useBeasts(token);
const { isSeasonPass, realmsResources } = useSeasonPass(token);

if (isBeast(token.collection_address)) {
const TypeIcon = beastTypeIcon(attributes.type.toLowerCase() as keyof typeof beastTypeIcon);
Expand Down Expand Up @@ -44,24 +40,6 @@ export function CollectionTokenImage({ token, height, width }: PropsWithClassNam
</div>
)
}
if (isSeasonPass(token.collection_address)) {
return (
<div className="aspect-square w-full object-contain p-3 pt-4">
<Media
src={token.metadata?.image}
mediaKey={token.metadata?.image_key}
thumbnailKey={token.metadata?.image_key_540_540}
alt={token.metadata?.name ?? "Empty"}
className="aspect-square w-full object-contain transition-transform group-hover:scale-110"
height={height}
width={width}
/>
<div className="flex flex-row gap-2 mt-4">
{realmsResources.map((r, idx) => <RealmsResourceItem key={idx} resource={r} />)}
</div>
</div>
)
}

return (
<Media
Expand All @@ -75,18 +53,3 @@ export function CollectionTokenImage({ token, height, width }: PropsWithClassNam
/>
);
}

function RealmsResourceItem({ resource }: { resource: Resources }) {
return (
<TooltipProvider>
<Tooltip>
<TooltipTrigger>
<Media src={resource.img} height={20} width={20} alt={resource.trait} />
</TooltipTrigger>
<TooltipContent>
<div>{resource.trait}</div>
</TooltipContent>
</Tooltip>
</TooltipProvider>
)
}
24 changes: 0 additions & 24 deletions apps/arkmarket/src/app/collection/[collectionAddress]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,6 @@ export async function generateMetadata({
}: GenerateMetadataProps): Promise<Metadata> {
const collectionAddress = (await params).collectionAddress;
const collection = await getCollection({ collectionAddress });
if (collectionAddress === CollectionAddresses[Collections.ETERNUMSEASONPASS][ChainId.SN_MAIN]) {
return {
title: `Eternum Season 0 Pass`,
description: 'Conquer the Realms',
openGraph: {
images: [
{
url: `https://market.realms.world/og/eternum-season-pass.png`,
width: 1200,
height: 630,
},
],
},
twitter: {
title: `Eternum Season 0 Pass`,
description: 'Conquer the Realms',
creator: '@RealmsEternum',
images: {
url: `https://market.realms.world/og/eternum-season-pass.png?121277987979`,
alt: 'Eternum Season 0 Pass',
},
},
}
}
const platform =
env.NEXT_PUBLIC_THEME === "unframed" ? "Unframed" : "Ark Market";
const name = collection?.name ?? "Collection";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { PropsWithClassName } from "@ark-market/ui";
import Media from "~/components/media";
import { useBeasts } from "~/hooks/useBeasts";
import type { Resources } from "~/hooks/useSeasonPass";
import { useSeasonPass } from "~/hooks/useSeasonPass";
import type { Token } from "~/types";

interface TokenSummaryProps {
Expand All @@ -11,7 +9,6 @@ interface TokenSummaryProps {

export function TokenImage({ token }: PropsWithClassName<TokenSummaryProps>) {
const { attributes, isBeast, beastTypeIcon, formatBeastName } = useBeasts(token);
const { isSeasonPass, realmsResources } = useSeasonPass(token);

if (isBeast(token.collection_address)) {
const TypeIcon = beastTypeIcon(attributes.type.toLowerCase() as keyof typeof beastTypeIcon);
Expand Down Expand Up @@ -40,23 +37,6 @@ export function TokenImage({ token }: PropsWithClassName<TokenSummaryProps>) {
)
}

if (isSeasonPass(token.collection_address)) {
return (
<div className="aspect-square w-full object-contain p-3 pt-4">
<Media
src={token.metadata?.image}
mediaKey={token.metadata?.image_key}
thumbnailKey={token.metadata?.image_key_540_540}
alt={token.metadata?.name ?? "Empty"}
className="aspect-square w-full object-contain transition-transform group-hover:scale-110"
/>
<div className="flex flex-row flex-wrap gap-2 mt-4">
{realmsResources.map((r, idx) => <RealmsResourceItem key={idx} resource={r} />)}
</div>
</div>
)
}

return (
<Media
src={token.metadata?.animation_url ?? token.metadata?.image}
Expand All @@ -71,12 +51,3 @@ export function TokenImage({ token }: PropsWithClassName<TokenSummaryProps>) {
/>
);
}

function RealmsResourceItem({ resource }: { resource: Resources }) {
return (
<div className="flex items-center">
<Media src={resource.img} height={25} width={25} alt={resource.trait} />
<span className="pl-2">{resource.trait}</span>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
focusableStyles,
formatUnits,
} from "@ark-market/ui";
import { NoResult, VerifiedIcon } from "@ark-market/ui/icons";
import { VerifiedIcon } from "@ark-market/ui/icons";
import {
NftCard,
NftCardAction,
Expand All @@ -21,10 +21,8 @@ import {
import type { ViewType } from "../../../../components/view-type-toggle-group";
import type { WalletToken } from "../queries/getWalletData";
import { TokenActionsCreateListing } from "~/app/token/[contractAddress]/[tokenId]/components/token-actions-create-listing";
import Media from "~/components/media";
import { CollectionDescription } from "~/config/homepage";
import { CollectionTokenImage } from "~/app/collection/[collectionAddress]/components/collection-token-image";
import { useSeasonPass } from "~/hooks/useSeasonPass";

const LargeGridContainer: Components["List"] = React.forwardRef(
({ style, children }, ref) => {
Expand Down Expand Up @@ -95,8 +93,7 @@ export default function CollectionItemsDataGridView({
}
function PortfolioTokenItem({ token, viewType, isOwner }: { token: WalletToken, viewType: string, isOwner: boolean }) {
const canListItem = isOwner && !token.list_price;
const { realmName, isSeasonPass } = useSeasonPass(token);
const tokenName = isSeasonPass(token.collection_address) ? realmName : token.metadata?.name ?? token.token_id;
const tokenName = token.metadata?.name ?? token.token_id;

return (
// TODO @YohanTz: Extract to NftCard component and sub-components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { TokenActionsCreateListing } from "~/app/token/[contractAddress]/[tokenI
import Media from "~/components/media";
import { CollectionDescription } from "~/config/homepage";
import { NoResult } from "@ark-market/ui/icons";
import { useSeasonPass } from "~/hooks/useSeasonPass";

const gridTemplateColumnValue =
"grid-cols-[minmax(11rem,2fr)_repeat(4,minmax(10rem,1fr))_minmax(6.5rem,15rem)]";
Expand Down Expand Up @@ -109,8 +108,7 @@ export default function PortfolioItemsDataListView({
}
function PortfolioTokenItem({ token, rowVirtualizer, virtualRow, isOwner }: { token: WalletToken, rowVirtualizer: Virtualizer<Window, Element>, virtualRow: VirtualItem, isOwner: boolean }) {
const canListItem = isOwner && !token.list_price;
const { realmName, isSeasonPass } = useSeasonPass(token);
const tokenName = isSeasonPass(token.collection_address) ? realmName : token.metadata?.name ?? token.token_id;
const tokenName = token.metadata?.name ?? token.token_id;

return (
<TableRow
Expand Down
29 changes: 0 additions & 29 deletions apps/arkmarket/src/config/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export enum Collections {
DUNGEON_DUCKS = "dungeonducks",
KARAT = "karat",
JOKERSOFNEON = "jokersofneon",
ETERNUMSEASONPASS = "eternumseasonpass",
}

export enum ChainId {
Expand Down Expand Up @@ -88,11 +87,6 @@ export const CollectionAddresses: {
"0x07268fcf96383f8691b91ba758cc8fefe0844146f0557909345b841fb1de042f",
[ChainId.SN_SEPOLIA]: "",
},
[Collections.ETERNUMSEASONPASS]: {
[ChainId.SN_MAIN]:
"0x057675b9c0bd62b096a2e15502a37b290fa766ead21c33eda42993e48a714b80",
[ChainId.SN_SEPOLIA]: "",
},
};

export const CollectionNames = {
Expand All @@ -106,7 +100,6 @@ export const CollectionNames = {
[Collections.DUNGEON_DUCKS]: "Dungeon Ducks",
[Collections.KARAT]: "Karat",
[Collections.JOKERSOFNEON]: "Jokers of Neon x Loot Survivor: Beasts",
[Collections.ETERNUMSEASONPASS]: "Eternum Season Pass",
};

interface CollectionDescription {
Expand Down Expand Up @@ -175,26 +168,10 @@ export const CollectionDescription: Record<string, CollectionDescription> = {
description:
"Jokers of Neon mod exclusive collection",
},
// @ts-expect-error It's ok compiler
[CollectionAddresses[Collections.ETERNUMSEASONPASS][ChainId.SN_MAIN]]: {
created: "2024",
description:
"Game passes to play Eternum Season 0, each with unique resource profiles. 8000 can be minted by Realms. All existing gamepasses shown here, but new ones are frequently minted.",
},
};

export const homepageConfig = {
mainCarousel: [
{
bannerSrc: "/banners/realms.png",
collectionSrc: "/collections/eternum-season-pass.png",
name: CollectionNames[Collections.ETERNUMSEASONPASS],
description: "Eternum Season Pass",
address: CollectionAddresses[Collections.ETERNUMSEASONPASS][ChainId.SN_MAIN],
itemsCount: 0,
slideInterval: 32_000,
// floorPrice: 0.12,
},
{
bannerSrc: "/banners/blobert.png",
collectionSrc: "/collections/blobert.png",
Expand Down Expand Up @@ -290,12 +267,6 @@ export const homepageConfig = {
image: "/collections/realms.png",
banner_image: "/banners/realms.png",
},
{
name: CollectionNames[Collections.ETERNUMSEASONPASS],
address: CollectionAddresses[Collections.ETERNUMSEASONPASS][ChainId.SN_MAIN],
image: "/collections/eternum-season-pass.png",
banner_image: "/banners/realms.png",
},
{
name: CollectionNames[Collections.BLOBERT],
address: CollectionAddresses[Collections.BLOBERT][ChainId.SN_MAIN],
Expand Down
Loading

0 comments on commit c44a254

Please sign in to comment.