Skip to content

Commit

Permalink
removed unused code and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Apr 6, 2024
1 parent 0271fa0 commit a924dee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 126 deletions.
125 changes: 2 additions & 123 deletions packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,19 @@

import { useAccount } from "wagmi";
import { StylizedAddressCard } from "~~/components/rep-tokens/cards/stylized-cards/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 { StylizedTokenCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard";
// import { StylizedTokenCard2 } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard2";
import { StylizedTokenCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenCard";
import {
// ReputationComponent,
StylizedTokenGroupCard,
} from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard";
import { StylizedTokenGroupCard } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard";
import { AddressCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/AddressCard";
import { BalanceCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/BalanceCard";
// import { StylizedTokenGroupCard2 } from "~~/components/rep-tokens/cards/stylized-cards/StylizedTokenGroupCard2";
import { DescriptionCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/DescriptionCard";
import { ImageCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/ImageCard";
import { MaxMintAmountPerTxCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/MaxMintAmountPerTxCard";
import { NameCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/NameCard";
// import { RedeemableCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/RedeemableCard";
// import { SoulboundCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/SoulboundCard";
import { TokenTypeCard } from "~~/components/rep-tokens/cards/stylized-cards/token-properties/TokenTypeCard";
import { useGetRepToken, useRepTokens } from "~~/components/rep-tokens/hooks/Hooks";
import { useScaffoldContract, useScaffoldContractWrite } from "~~/hooks/scaffold-eth";

export function RepTokensDemo() {
console.log("Hello");
const { address } = useAccount();

const { token, refetchBalance } = useGetRepToken(address, BigInt(0));
Expand All @@ -52,21 +40,6 @@ export function RepTokensDemo() {
faucetTokens.tokens[i].image = faucetTokens.tokens[i].image?.replace("ipfs://", "https://ipfs.io/ipfs/");
}

// const mainComponents: ReputationComponent[] = [
// "Balance",
// "Image",
// "Name",
// "Description",
// "Address",
// "IsSoulbound",
// "IsRedeemable",
// "MaxMintAmountPerTx",
// ];

// const widgetComponents: ReputationComponent[] = ["Balance", "Image"];

console.log(token);

return (
<>
<div className="py-5 space-y-5 flex flex-col justify-center items-center bg-[length:100%_100%] py-1 px-5 sm:px-0 lg:py-auto max-w-[100vw] ">
Expand Down Expand Up @@ -119,102 +92,8 @@ export function RepTokensDemo() {
<p className="text-center text-4xl">Small</p>
<StylizedTokenGroupCard tokens={tokens} components={["Balance", "Image"]} isBalanceOverlayed={true} size="sm" />

<p className="text-center text-4xl">Faucet</p>
<p className="text-center text-4xl">Widget</p>
<StylizedTokenGroupCard tokens={tokens} components={["Balance", "Image"]} isBalanceOverlayed={true} size="xs" />

{/* <div className="flex">
<div>
<p className="text-center text-4xl">Individual Components 1</p>
<StylizedBalanceCard value={Number(token?.balance)} />
<StylizedImageCard src={token?.image} />
<StylizedStringCard value={token?.name} type="bold" />
<StylizedStringCard value={token?.description} />
<StylizedAddressCard address={token?.address} />
<StylizedStringCard value={`Token Type: ${token?.properties?.tokenType?.toString()}`} />
<StylizedStringCard
value={`Max Mint Amount Per Tx: \n${token?.properties?.maxMintAmountPerTx?.toString()}`}
/>
</div>
<div>
<p className="text-center text-4xl">Individual Components 2</p>
<BalanceCard balance={token?.balance} />
<ImageCard src={token?.image} />
<NameCard name={token?.name} />
<DescriptionCard description={token?.description} />
<AddressCard address={token?.address} />
<TokenTypeCard tokenType={token?.properties?.tokenType} />
<MaxMintAmountPerTxCard maxMintAmountPerTx={token?.properties?.maxMintAmountPerTx} />
</div>
<div>
<p className="text-center text-4xl">Individual Components 3</p>
<BalanceCard token={token} />
<ImageCard token={token} />
<NameCard token={token} />
<DescriptionCard token={token} />
<AddressCard token={token} />
<TokenTypeCard token={token} />
<MaxMintAmountPerTxCard token={token} />
</div>
</div> */}
{/* <div className="flex">
<div>
<p className="text-center text-4xl">Single Card 1</p>
<StylizedTokenCard2>
<StylizedBalanceCard value={Number(token?.balance)} />
<StylizedImageCard src={token?.image} />
<StylizedStringCard value={token?.name} type="bold" />
<StylizedStringCard value={token?.description} />
<StylizedAddressCard address={token?.address} />
<StylizedStringCard value={`Token Type: ${token?.properties?.tokenType?.toString()}`} />
<StylizedStringCard
value={`Max Mint Amount Per Tx \n${token?.properties?.maxMintAmountPerTx?.toString()}`}
/>
</StylizedTokenCard2>
</div>
<div>
<p className="text-center text-4xl">Single Card 2</p>
<StylizedTokenCard2>
<BalanceCard token={token} />
<ImageCard token={token} />
<NameCard token={token} />
<DescriptionCard token={token} />
<AddressCard token={token} />
<TokenTypeCard token={token} />
<MaxMintAmountPerTxCard token={token} />
</StylizedTokenCard2>
</div>
<div>
<p className="text-center text-4xl">Single Card 3</p>
<StylizedTokenCard token={token} />
</div>
<div>
<p className="text-center text-4xl">Single Card 4</p>
<StylizedTokenCard3 token={token} />
</div>
</div> */}
{/* <p className="text-center text-4xl">Multi-Card</p>
<StylizedTokenGroupCard
tokens={tokens}
preChildren={<StylizedAddressCard address={tokens.address} isGroup={true} />}
/>
<p className="text-center text-4xl">Multi-Card w/ Overlay</p>
<StylizedTokenGroupCard
tokens={tokens}
isBalanceOverlayed={true}
preChildren={<StylizedAddressCard address={tokens.address} isGroup={true} />}
/>
<p className="text-center text-4xl">Small</p>
<StylizedTokenGroupCard tokens={tokens} components={widgetComponents} isBalanceOverlayed={true} size="sm" />
<p className="text-center text-4xl">Faucet</p>
<StylizedTokenGroupCard tokens={tokens} components={widgetComponents} isBalanceOverlayed={true} size="xs" /> */}
</div>
</>
);
Expand Down
3 changes: 0 additions & 3 deletions packages/nextjs/components/rep-tokens/hooks/Hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ export const useGetRepToken = (address?: string, tokenId?: bigint) => {
const formattedURI = uri?.replace("ipfs://", "https://nftstorage.link/ipfs/");

const { data: result } = useFetch<any>(formattedURI);
console.log(result);
console.log("Re-rendered");

const token = {
id: Number(tokenId),
Expand All @@ -171,7 +169,6 @@ export const useGetRepToken = (address?: string, tokenId?: bigint) => {
address: repTokensInstance?.address,
} as Token;

console.log(token);
return { token, refetchBalance };
};

Expand Down

0 comments on commit a924dee

Please sign in to comment.