Skip to content

Commit

Permalink
feat(web): add market data enabled flag for collections (#214)
Browse files Browse the repository at this point in the history
## Description
In some cases, collections won't have market data available. 
This PR introduces a new property `market_data_enabled` that indicates
whether market data tracking is enabled for a specific collection. This
flag helps clients determine whether to display the collection's
statistics block in the UI.
  • Loading branch information
remiroyc authored Dec 11, 2024
1 parent e1c7ef4 commit 3e6b8bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ export default function CollectionHeader({
</div>
</div>
</div>
<div className="hidden lg:block">
<CollectionHeaderStats collection={collection} />
</div>
{collection.market_data_enabled && (
<div className="hidden lg:block">
<CollectionHeaderStats collection={collection} />
</div>
)}
</div>
<CollapsibleContent className="data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down">
<p className="mb-2 max-w-lg pt-4 text-sm">{collection.description}</p>
Expand All @@ -116,9 +118,11 @@ export default function CollectionHeader({
Creator earnings
<span className="text-muted-foreground"> 5%</span>
</p>
<div className="block lg:hidden">
<CollectionHeaderStats collection={data} />
</div>
{collection.market_data_enabled && (
<div className="block lg:hidden">
<CollectionHeaderStats collection={data} />
</div>
)}
</CollapsibleContent>
</Collapsible>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export default function MobileCollectionHeader({
<Globe className="h-6 w-auto" />
</ExternalLink>
</div>
<CollectionHeaderStats collection={collection} />
{collection.market_data_enabled && (
<CollectionHeaderStats collection={collection} />
)}
</div>
</CollapsibleContent>
</Collapsible>
Expand Down
1 change: 1 addition & 0 deletions apps/arkmarket/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Collection {
twitter?: string;
volume_7d_eth: number;
website?: string;
market_data_enabled: boolean;
}

export type CollectionTrait = Record<string, number>;
Expand Down

0 comments on commit 3e6b8bb

Please sign in to comment.