Skip to content

Commit

Permalink
Pass through showOfferedStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
wbt committed Oct 22, 2023
1 parent 61161cf commit 6db1e5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions packages/nextjs/components/example-ui/TierList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TierCard } from "./TierCard";
import { TierSetup } from "./TierSetup";

export const TierList = (props: { merchant?: string; tiersLength?: bigint }) => {
export const TierList = (props: { merchant?: string; tiersLength?: bigint; showOfferedStatus: boolean }) => {
const tiersLength = props.tiersLength;
const merchant = props.merchant;
if (typeof tiersLength == "undefined" || typeof merchant == "undefined") {
Expand All @@ -16,7 +16,12 @@ export const TierList = (props: { merchant?: string; tiersLength?: bigint }) =>
<div className="flex justify-between w-full">
<ol>
{indicies.map(index => (
<TierCard key={index.toString()} merchant={merchant} tierIndex={index} showOfferedStatus={true} />
<TierCard
key={index.toString()}
merchant={merchant}
tierIndex={index}
showOfferedStatus={props.showOfferedStatus}
/>
))}
<TierSetup />
</ol>
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/components/example-ui/TierListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useScaffoldEventSubscriber,
} from "~~/hooks/scaffold-eth";

export const TierListing = () => {
export const TierListing = (props: { showOfferedStatus: boolean }) => {
const { address } = useAccount();

const { data: tiersLength, isLoading: isTierCountLoading } = useScaffoldContractRead({
Expand Down Expand Up @@ -60,7 +60,7 @@ export const TierListing = () => {
<div className="topRow">
<h2 className="text-4xl">{tierCountText}</h2>
</div>
<TierList merchant={address} tiersLength={tiersLength} />
<TierList merchant={address} tiersLength={tiersLength} showOfferedStatus={props.showOfferedStatus} />
</div>
);
};
2 changes: 1 addition & 1 deletion packages/nextjs/pages/merchant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MerchantSetup: NextPage = () => {
description="Allows the maker of an API to set up offerings to sell access for cryptocurrency payments."
/>
<div className="grid lg:grid-cols-2 flex-grow" data-theme="exampleUi">
<TierListing />
<TierListing showOfferedStatus={true} />
</div>
</>
);
Expand Down

0 comments on commit 6db1e5d

Please sign in to comment.