diff --git a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/desktop-token-activity.tsx b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/desktop-token-activity.tsx new file mode 100644 index 00000000..aabce9eb --- /dev/null +++ b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/desktop-token-activity.tsx @@ -0,0 +1,100 @@ +import { + ArrowLeftRight, + CircleDot, + Gavel, + List, + ListX, + Meh, + ShoppingCart, + Tag, + X, +} from "lucide-react"; + +import type { PropsWithClassName } from "@ark-market/ui"; +import { shortAddress, timeSince } from "@ark-market/ui"; +import { PriceTag } from "@ark-market/ui/price-tag"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@ark-market/ui/table"; + +import type { TokenActivity } from "../queries/getTokenData"; + +export const activityTypeToItem = new Map([ + ["FULFILL", { icon: , title: "Sale in progress" }], + ["EXECUTED", { icon: , title: "Sale" }], + ["SALE", { icon: , title: "Sale" }], + ["TRANSFER", { icon: , title: "Transfer" }], + ["LISTING", { icon: , title: "List" }], + ["OFFER", { icon: , title: "Offer" }], + ["CANCELLED", { icon: , title: "Cancel Offer" }], + ["MINT", { icon: , title: "Mint" }], + ["AUCTION", { icon: , title: "Put in auction" }], + ["DELISTING", { icon: , title: "Delist" }], +]); + +interface DesktopTokenActivityProps { + tokenActivity: TokenActivity[]; +} + +export default function DesktopTokenActivity({ + className, + tokenActivity, +}: PropsWithClassName) { + return ( + + + + Event + Price + From + To + Date + + + {tokenActivity.length === 0 ? ( + +
+ +

No activity yet!

+
+
+ ) : ( + + {tokenActivity.map((activity, index) => { + const activityItem = activityTypeToItem.get(activity.activity_type); + + return ( + + +
+ {activityItem?.icon} +

{activityItem?.title}

+
+
+ + {activity.price !== null ? ( + + ) : ( + "_" + )} + + + {activity.from ? shortAddress(activity.from) : "_"} + + + {activity.to ? shortAddress(activity.to) : "_"} + + {timeSince(activity.time_stamp)} +
+ ); + })} +
+ )} +
+ ); +} diff --git a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/mobile-token-activity.tsx b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/mobile-token-activity.tsx index 7b0451b6..aebc2057 100644 --- a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/mobile-token-activity.tsx +++ b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/mobile-token-activity.tsx @@ -1,109 +1,67 @@ import { Fragment } from "react"; -import { - ArrowLeftRight, - List, - ListX, - ShoppingCart, - Tag, - X, -} from "lucide-react"; +import { Meh } from "lucide-react"; import type { PropsWithClassName } from "@ark-market/ui"; -import { cn } from "@ark-market/ui"; +import { shortAddress, timeSince } from "@ark-market/ui"; import { PriceTag } from "@ark-market/ui/price-tag"; import { Separator } from "@ark-market/ui/separator"; -const activityTypeToItem = new Map([ - ["sale", { icon: , title: "Sale" }], - ["transfer", { icon: , title: "Transfer" }], - ["list", { icon: , title: "List" }], - ["offer", { icon: , title: "Offer" }], - ["cancel_offer", { icon: , title: "Cancel Offer" }], - ["delist", { icon: , title: "Delist" }], -]); +import type { TokenActivity } from "../queries/getTokenData"; +import { activityTypeToItem } from "./desktop-token-activity"; -const activityData = [ - { - type: "transfer", - from: "0x123", - to: "0x456", - }, - { - type: "list", - price: 1180000000000000000n, - from: "0x123", - }, - { - type: "offer", - price: 1840000000000000000n, - from: "0x123", - to: "0x456", - }, - { - type: "cancel_offer", - price: 1540000000000000000n, - from: "0x123", - to: "0x456", - }, - { - type: "delist", - price: 3240000000000000000n, - from: "0x123", - }, - { - type: "sale", - price: 1140000000000000000n, - from: "0x123", - to: "0x456", - }, -]; +interface MobileTokenActivityProps { + tokenActivity: TokenActivity[]; +} -export default function MobileTokenActivity({ className }: PropsWithClassName) { +export default function MobileTokenActivity({ + className, + tokenActivity, +}: PropsWithClassName) { return ( -
-
-

Activity

-
- {activityData.length} -
-
+
+

Event

+ -
-

Event

- + {tokenActivity.length === 0 && ( +
+ +

No activity yet!

+
+ )} - {activityData.map((activity, index) => { - const activityItem = activityTypeToItem.get(activity.type); + {tokenActivity.map((activity, index) => { + const activityItem = activityTypeToItem.get(activity.activity_type); - return ( - -
-
-
- {activityItem?.icon} -

{activityItem?.title}

-
- {activity.price !== undefined ? ( - - ) : ( - "_" - )} -
-
-

- by{" "} - - {activity.from}{" "} - -

-

8min ago

+ return ( + +
+
+
+ {activityItem?.icon} +

{activityItem?.title}

+ {activity.price !== null ? ( + + ) : ( + "_" + )} +
+
+

+ by{" "} + + {activity.from ? shortAddress(activity.from) : "_"} + +

+

+ {timeSince(activity.time_stamp)} +

- - - ); - })} -
+
+ + + ); + })}
); } diff --git a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-about.tsx b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-about.tsx index 7166e293..d47609b0 100644 --- a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-about.tsx +++ b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-about.tsx @@ -4,7 +4,7 @@ import { useMemo, useState } from "react"; import { ChevronDown, ChevronUp } from "lucide-react"; import type { PropsWithClassName } from "@ark-market/ui"; -import { cn } from "@ark-market/ui"; +import { cn, ellipsableStyles } from "@ark-market/ui"; import { Button } from "@ark-market/ui/button"; import { Collapsible, @@ -100,9 +100,11 @@ export default function TokenAbout({ {collectionShortenedAddress}

-
-

Token ID

-

{tokenId}

+
+

Token ID

+

+ {tokenId} +

Token Standard

diff --git a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-actions-create-listing.tsx b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-actions-create-listing.tsx index 37f9a8ba..4fade84e 100644 --- a/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-actions-create-listing.tsx +++ b/apps/arkmarket/src/app/token/[contractAddress]/[tokenId]/components/token-actions-create-listing.tsx @@ -192,7 +192,7 @@ export function TokenActionsCreateListing({ -
+
List for sale
- Type of sale + Type of sale
+

+ $--- +

{formattedStartAmount !== "-" && } )} @@ -263,7 +272,9 @@ export function TokenActionsCreateListing({ name="endAmount" render={({ field }) => ( - Set reserve price + + Set reserve price + ( - Set expiration + Set expiration