Skip to content

Commit

Permalink
added nav bar component
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Feb 1, 2024
1 parent c5aa78c commit 4db5f1d
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// import { TokenCardClasses } from "../rep-tokens/cards/token-card/TokenCard";
// import { TokenGroupCardElementsClasses } from "../rep-tokens/cards/token-group-card/TokenGroupCard";

// export const tokensCardPropertiesClasses = {
// container: "flex justify-center",
// card: "bg-slate-800 flex flex-col items-center",
Expand All @@ -9,7 +8,6 @@
// value: "ml-1.5 text-${size} font-normal text-white",
// },
// } as TokenGroupCardElementsClasses;

// export const tokenCardPropertiesClasses = {
// card: "px-1 py-1 relative w-20 ",
// baseTokenCardElementsClasses: {
Expand All @@ -22,3 +20,60 @@
// },
// },
// } as TokenCardClasses;
import { ImageProps } from "../../../components/rep-tokens/cards/value-cards/ImageCard";
import {
ImageValueCardConfigProp,
TokenCardConfigProps,
TokenCardValuesConfigProps,
ValueCardConfigProps,
} from "../../../components/rep-tokens/types/Types";
import { TokenGroupCardConfigProps } from "../../../components/rep-tokens/types/Types";

export const balanceProps = {
isRendering: true,
classes: {
card: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",
value: "text-4xl mx-auto text-center text-black",
},
isPrettyLoading: true,
} as ValueCardConfigProps;

export const imageProps = {
isRendering: true,
classes: {
card: "bg-slate-300 p-1",
value: "rounded mx-auto",
},
imageProperties: new ImageProps("Token", 256, 256),
isPrettyLoading: true,
} as ImageValueCardConfigProp;

export const tokenCardValuesProps = {
balanceProps,
imageProps,
} as TokenCardValuesConfigProps;

export const tokenCardProps = {
isRendering: true,
cardClasses: "bg-slate-600 px-1 py-1 relative w-20 ",
valuesProps: tokenCardValuesProps,
} as TokenCardConfigProps;

export const tokenGroupCardConfigProps = {
isRendering: true,
cardClasses: {
card: "bg-slate-900 flex flex-col items-center p-5",
value: "bg-slate-800 flex justify-center p-5",
},
address: {
isRendering: true,
classes: {
card: "my-5 flex items-center justify-center bg-slate-300",
value: "ml-1.5 text-base font-normal text-cyan-800",
},
isPrettyLoading: true,
} as ValueCardConfigProps,

isPrettyLoading: true,
tokenCardProps,
} as TokenGroupCardConfigProps;
23 changes: 23 additions & 0 deletions packages/nextjs/app/rep-tokens-demo/_components/RepTokensDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useAccount } from "wagmi";
import { tokenGroupCardConfigProps as mainTokenGroupCardConfigProps } from "~~/app/rep-tokens-demo/_components/MainTokensCardConfig";
import { tokenGroupCardConfigProps as mainTokenGroupOverlayCardConfigProps } from "~~/app/rep-tokens-demo/_components/MainTokensCardWithNumberOverlayConfig";
import { tokenGroupCardConfigProps as navBarTokenGroupConfigProps } from "~~/app/rep-tokens-demo/_components/NavBarCardConfig";
import { TokenGroupCard } from "~~/components/rep-tokens/cards/token-group-card/TokenGroupCard";
import { useRepTokens } from "~~/components/rep-tokens/hooks/Hooks";
import { buildTokenCards, buildTokenGroupCard } from "~~/components/rep-tokens/utils/buildTokensCard";
Expand Down Expand Up @@ -45,6 +46,22 @@ export function RepTokensDemo() {
if (mainTokenGroupOverlayCardConfigProps.address?.isRendering) {
mainTokenGroupOverlayCardProps.addressOutput = <Address props={mainTokenGroupOverlayCardProps.addressProps} />;
}

const navBarTokenCards = buildTokenCards(
tokensData.tokens,
tokensData.address,
navBarTokenGroupConfigProps.tokenCardProps,
);
const navBarTokenGroupCardProps = buildTokenGroupCard(
navBarTokenGroupConfigProps,
navBarTokenCards,
tokensData.address,
);

if (navBarTokenGroupConfigProps.address?.isRendering) {
navBarTokenGroupCardProps.addressOutput = <Address props={navBarTokenGroupCardProps.addressProps} />;
}

return (
<>
{/* <div className="flex flex-col justify-center items-center bg-primary bg-[length:100%_100%] py-1 px-5 sm:px-0 lg:py-auto max-w-[100vw] ">
Expand All @@ -58,6 +75,12 @@ export function RepTokensDemo() {
</div>
</div> */}

<div className="flex flex-col justify-center items-center bg-primary bg-[length:100%_100%] py-1 px-5 sm:px-0 lg:py-auto max-w-[100vw] ">
<div>
<TokenGroupCard props={navBarTokenGroupCardProps} />
</div>
</div>

<div className="flex flex-col justify-center items-center bg-primary bg-[length:100%_100%] py-1 px-5 sm:px-0 lg:py-auto max-w-[100vw] ">
<div>
<TokenGroupCard props={mainTokenGroupCardProps} />
Expand Down

0 comments on commit 4db5f1d

Please sign in to comment.