From 0271fa05f6cb9280f2198d1b5b8eb77d5b1358f2 Mon Sep 17 00:00:00 2001 From: Jacob Homanics Date: Fri, 5 Apr 2024 23:58:31 -0500 Subject: [PATCH] added indications for deprecated cards --- .../_components/RepTokensDemo.tsx | 4 +- .../stylized-cards/StylizedTokenCard.tsx | 44 ++---- .../stylized-cards/StylizedTokenGroupCard.tsx | 4 +- .../StylizedTokenGroupCard3.tsx | 142 ------------------ .../StylizedTokenCard.tsx} | 44 +++--- .../{ => deprecated}/StylizedTokenCard2.tsx | 0 .../StylizedTokenGroupCard2.tsx | 0 .../deprecated/StylizedTokenGroupCard3.tsx | 69 +++++++++ 8 files changed, 114 insertions(+), 193 deletions(-) delete mode 100644 packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard3.tsx rename packages/nextjs/components/rep-tokens/cards/stylized-cards/{StylizedTokenCard3.tsx => deprecated/StylizedTokenCard.tsx} (55%) rename packages/nextjs/components/rep-tokens/cards/stylized-cards/{ => deprecated}/StylizedTokenCard2.tsx (100%) rename packages/nextjs/components/rep-tokens/cards/stylized-cards/{ => deprecated}/StylizedTokenGroupCard2.tsx (100%) create mode 100644 packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenGroupCard3.tsx diff --git a/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx b/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx index 4a001d6..f6382e6 100644 --- a/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx +++ b/packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx @@ -7,7 +7,7 @@ import { StylizedAddressCard } from "~~/components/rep-tokens/cards/stylized-car // import { StylizedStringCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedStringCard"; // import { StylizedTokenCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard"; // import { StylizedTokenCard2 } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard2"; -import { StylizedTokenCard3 } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard3"; +import { StylizedTokenCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard"; import { // ReputationComponent, StylizedTokenGroupCard, @@ -101,7 +101,7 @@ export function RepTokensDemo() {

Single Card

- +

Multi-Card

, ); } else { - cardContent.push( - , - ); + cardContent.push(); } } else { - cardContent.push(); + cardContent.push(); } } if (!isBalanceOverlayed) { if (components[j] === "Image") { - cardContent.push(); + cardContent.push(); } } if (components[j] === "Name") { - cardContent.push(); + cardContent.push(); } if (components[j] === "Description") { - cardContent.push(); + cardContent.push(); } if (components[j] === "TokenType") { - cardContent.push( - , - ); + cardContent.push(); } if (components[j] === "MaxMintAmountPerTx") { - cardContent.push( - , - ); + cardContent.push(); } if (components[j] === "Address") { - cardContent.push(); + cardContent.push(); } } - return ( -
- {/* {children} */} - {cardContent} -
- ); + return
{cardContent}
; }; diff --git a/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard.tsx b/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard.tsx index db86daa..acd1eeb 100644 --- a/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard.tsx +++ b/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard.tsx @@ -1,5 +1,5 @@ import { TokenGroup } from "../../hooks/Hooks"; -import { StylizedTokenCard3 } from "./StylizedTokenCard3"; +import { StylizedTokenCard } from "./StylizedTokenCard"; export interface TokenCardInternalProps { tokens: TokenGroup; @@ -41,7 +41,7 @@ export const StylizedTokenGroupCard = ({ for (let i = 0; i < tokens?.tokens?.length; i++) { const card = ( - { - 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( - // , - // ); - // } else { - // cardContent.push( - // , - // ); - // } - // } else { - // cardContent.push( - // , - // ); - // } - // } - - // if (!isBalanceOverlayed) { - // if (components[j] === "Image") { - // cardContent.push(); - // } - // } - - // if (components[j] === "Name") { - // cardContent.push(); - // } - - // if (components[j] === "Description") { - // cardContent.push(); - // } - - // if (components[j] === "IsSoulbound") { - // cardContent.push( - // , - // ); - // } - - // if (components[j] === "IsRedeemable") { - // cardContent.push( - // , - // ); - // } - - // if (components[j] === "MaxMintAmountPerTx") { - // cardContent.push( - // , - // ); - // } - - // if (components[j] === "Address") { - // cardContent.push(); - // } - // } - - const card = ( - - {/* {cardContent} */} - - ); - output.push(card); - } - - return ( -
- {children} -
{output}
-
- ); -}; diff --git a/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenCard3.tsx b/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenCard.tsx similarity index 55% rename from packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenCard3.tsx rename to packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenCard.tsx index 92d45b3..3edba2d 100644 --- a/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenCard3.tsx +++ b/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenCard.tsx @@ -1,13 +1,10 @@ -import { Token } from "../../hooks/Hooks"; -import { BalanceImageOverlay } from "./BalanceImageOverlay"; -import { ReputationComponent } from "./StylizedTokenGroupCard"; -import { AddressCard } from "./token-properties/AddressCard"; -import { BalanceCard } from "./token-properties/BalanceCard"; -import { DescriptionCard } from "./token-properties/DescriptionCard"; -import { ImageCard } from "./token-properties/ImageCard"; -import { MaxMintAmountPerTxCard } from "./token-properties/MaxMintAmountPerTxCard"; -import { NameCard } from "./token-properties/NameCard"; -import { TokenTypeCard } from "./token-properties/TokenTypeCard"; +import { Token } from "../../../hooks/Hooks"; +import { BalanceImageOverlay } from "../BalanceImageOverlay"; +import { StylizedAddressCard } from "../StylizedAddressCard"; +import { StylizedBalanceCard } from "../StylizedBalanceCard"; +import { StylizedImageCard } from "../StylizedImageCard"; +import { StylizedStringCard } from "../StylizedStringCard"; +import { ReputationComponent } from "../StylizedTokenGroupCard"; export type Size = "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl"; @@ -29,7 +26,7 @@ const sizeMap = { "3xl": "", }; -export const StylizedTokenCard3 = ({ +export const StylizedTokenCard = ({ size = "base", // children, token, @@ -56,37 +53,46 @@ export const StylizedTokenCard3 = ({ , ); } else { - cardContent.push(); + cardContent.push( + , + ); } } else { - cardContent.push(); + cardContent.push(); } } if (!isBalanceOverlayed) { if (components[j] === "Image") { - cardContent.push(); + cardContent.push(); } } if (components[j] === "Name") { - cardContent.push(); + cardContent.push(); } if (components[j] === "Description") { - cardContent.push(); + cardContent.push(); } if (components[j] === "TokenType") { - cardContent.push(); + cardContent.push( + , + ); } if (components[j] === "MaxMintAmountPerTx") { - cardContent.push(); + cardContent.push( + , + ); } if (components[j] === "Address") { - cardContent.push(); + cardContent.push(); } } diff --git a/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenCard2.tsx b/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenCard2.tsx similarity index 100% rename from packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenCard2.tsx rename to packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenCard2.tsx diff --git a/packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard2.tsx b/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenGroupCard2.tsx similarity index 100% rename from packages/nextjs/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard2.tsx rename to packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenGroupCard2.tsx diff --git a/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenGroupCard3.tsx b/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenGroupCard3.tsx new file mode 100644 index 0000000..2659cd9 --- /dev/null +++ b/packages/nextjs/components/rep-tokens/cards/stylized-cards/deprecated/StylizedTokenGroupCard3.tsx @@ -0,0 +1,69 @@ +// // 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 { StylizedTokenCard } from "./StylizedTokenCard"; + +// // 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 card = ( +// +// ); +// output.push(card); +// } + +// return ( +//
+// {children} +//
{output}
+//
+// ); +// };