Skip to content

Commit 5275237

Browse files
committed
fix(accordion): replace ternary operator with if statement
Refactor the pattern used to get the default accordion items to use if statements and a helper method.
1 parent ddfa5b8 commit 5275237

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/hypercerts/[hypercertId]/page.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ export default async function HypercertPage({ params, searchParams }: Props) {
6262
);
6363
}
6464

65-
const defaultAccordionItems = isMarketplaceListingsEnabledOnChain
66-
? ["marketplace-listings"]
67-
: isEvaluationsEnabledOnChain
68-
? ["evaluations"]
69-
: isCreatorFeedEnabledOnChain
70-
? ["creator-feed"]
71-
: [];
65+
const getDefaultAccordionItems = () => {
66+
if (isMarketplaceListingsEnabledOnChain) return ["marketplace-listings"];
67+
if (isEvaluationsEnabledOnChain) return ["evaluations"];
68+
if (isCreatorFeedEnabledOnChain) return ["creator-feed"];
69+
return [];
70+
};
71+
72+
const defaultAccordionItems = getDefaultAccordionItems();
7273

7374
return (
7475
<main className="flex flex-col p-8 md:px-24 md:pt-14 pb-24 space-y-4 flex-1">

0 commit comments

Comments
 (0)