-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac1e8d4
commit 34b2a59
Showing
5 changed files
with
199 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 142 additions & 0 deletions
142
packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard3.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
// import { BalanceImageOverlay } from "./BalanceImageOverlay"; | ||
// import { StylizedAddressCard } from "./StylizedAddressCard"; | ||
// import { StylizedBalanceCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedBalanceCard"; | ||
// import { StylizedImageCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedImageCard"; | ||
// import { StylizedStringCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedStringCard"; | ||
import { | ||
/*Token,*/ | ||
TokenGroup, | ||
} from "../../hooks/Hooks"; | ||
import { StylizedTokenCard3 } from "./StylizedTokenCard3"; | ||
|
||
// import { StylizedTokenCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard"; | ||
|
||
export interface TokenCardInternalProps { | ||
tokens: TokenGroup; | ||
components?: ReputationComponent[]; | ||
isBalanceOverlayed?: boolean; | ||
size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl"; | ||
children?: React.ReactNode; | ||
} | ||
|
||
const sizeMap = { | ||
xs: "p-1", | ||
sm: "p-5", | ||
base: "p-5", | ||
lg: "", | ||
xl: "", | ||
"2xl": "", | ||
"3xl": "", | ||
}; | ||
|
||
export type ReputationComponent = | ||
| "Balance" | ||
| "Image" | ||
| "Name" | ||
| "Description" | ||
| "Address" | ||
| "TokenType" | ||
| "MaxMintAmountPerTx"; | ||
|
||
export const StylizedTokenGroupCard3 = ({ | ||
tokens, | ||
components = ["Balance", "Image", "Name", "Description", "Address", "TokenType", "MaxMintAmountPerTx"], | ||
isBalanceOverlayed, | ||
children, | ||
size = "base", | ||
}: TokenCardInternalProps) => { | ||
const output: any[] = []; | ||
|
||
for (let i = 0; i < tokens?.tokens?.length; i++) { | ||
// const cardContent: any[] = []; | ||
|
||
// for (let j = 0; j < components?.length; j++) { | ||
// if (components[j] === "Balance") { | ||
// if (isBalanceOverlayed) { | ||
// let doesImageComponentExist; | ||
// for (let k = 0; k < components?.length; k++) { | ||
// if (k === j) continue; | ||
|
||
// if (components[k] === "Image") { | ||
// doesImageComponentExist = true; | ||
// break; | ||
// } | ||
// } | ||
|
||
// if (doesImageComponentExist) { | ||
// cardContent.push( | ||
// <BalanceImageOverlay key={j} balance={Number(tokens[i]?.balance)} image={tokens[i]?.image} size={size} />, | ||
// ); | ||
// } else { | ||
// cardContent.push( | ||
// <StylizedBalanceCard key={j} value={Number(tokens[i]?.balance)} isOverlay={false} size={size} />, | ||
// ); | ||
// } | ||
// } else { | ||
// cardContent.push( | ||
// <StylizedBalanceCard key={j} value={Number(tokens[i]?.balance)} isOverlay={false} size={size} />, | ||
// ); | ||
// } | ||
// } | ||
|
||
// if (!isBalanceOverlayed) { | ||
// if (components[j] === "Image") { | ||
// cardContent.push(<StylizedImageCard key={j} src={tokens[i]?.image} size={size} />); | ||
// } | ||
// } | ||
|
||
// if (components[j] === "Name") { | ||
// cardContent.push(<StylizedStringCard key={j} value={tokens[i]?.name} type="bold" />); | ||
// } | ||
|
||
// if (components[j] === "Description") { | ||
// cardContent.push(<StylizedStringCard key={j} value={tokens[i]?.description} />); | ||
// } | ||
|
||
// if (components[j] === "IsSoulbound") { | ||
// cardContent.push( | ||
// <StylizedStringCard key={j} value={`Soulbound: ${tokens[i]?.properties.isSoulbound.toString()}`} />, | ||
// ); | ||
// } | ||
|
||
// if (components[j] === "IsRedeemable") { | ||
// cardContent.push( | ||
// <StylizedStringCard key={j} value={`Redeemable: ${tokens[i]?.properties.isRedeemable.toString()}`} />, | ||
// ); | ||
// } | ||
|
||
// if (components[j] === "MaxMintAmountPerTx") { | ||
// cardContent.push( | ||
// <StylizedStringCard | ||
// key={j} | ||
// value={`Max Mint Amount Per Tx: ${tokens[i]?.properties.maxMintAmountPerTx.toString()}`} | ||
// />, | ||
// ); | ||
// } | ||
|
||
// if (components[j] === "Address") { | ||
// cardContent.push(<StylizedAddressCard key={j} address={tokens[i].address} />); | ||
// } | ||
// } | ||
|
||
const card = ( | ||
<StylizedTokenCard3 | ||
key={i} | ||
size={size} | ||
token={tokens.tokens[i]} | ||
components={components} | ||
isBalanceOverlayed={isBalanceOverlayed} | ||
> | ||
{/* {cardContent} */} | ||
</StylizedTokenCard3> | ||
); | ||
output.push(card); | ||
} | ||
|
||
return ( | ||
<div className={`bg-base-100 flex flex-col rounded-lg ${sizeMap[size]}`}> | ||
{children} | ||
<div className={`flex flex-wrap justify-center ${sizeMap[size]} rounded-lg bg-base-200`}>{output}</div> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.