Skip to content

Commit

Permalink
figured out naming order
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Jan 27, 2024
1 parent 2155d3b commit 6645d7b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseImageProps } from "../rep-tokens/cards/property-cards/ImageCard";
import { ImageProps } from "../rep-tokens/cards/property-cards/ImageCard";
import {
BaseElementConfigProp,
ImageElementConfigProp,
Expand All @@ -21,7 +21,7 @@ export const imageProps = {
container: "bg-slate-300 p-1",
value: "rounded mx-auto",
},
imageProperties: new BaseImageProps("Token", 256, 256),
imageProperties: new ImageProps("Token", 256, 256),
isPrettyLoading: true,
} as ImageElementConfigProp;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ElementClasses } from "../../types/Types";

export interface BalanceCardProps {
export interface BigIntCardPropsInternal {
props: BigIntCardProps;
}

Expand All @@ -10,7 +10,7 @@ export interface BigIntCardProps {
isPrettyLoading?: boolean;
}

export const BalanceCard = ({ props }: BalanceCardProps) => {
export const BalanceCard = ({ props }: BigIntCardPropsInternal) => {
let output;

props?.isPrettyLoading
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Image from "next/image";
import { ElementClasses } from "../../types/Types";

export interface ImageCardProps {
props: ImageProps;
export interface ImageCardPropsInternal {
props: ImageCardProps;
}

export interface ImageProps {
export interface ImageCardProps {
value: string;
properties?: BaseImageProps;
properties?: ImageProps;
classes?: ElementClasses;
isPrettyLoading?: boolean;
}

export class BaseImageProps {
export class ImageProps {
alt: string;
height: number;
width: number;
Expand All @@ -23,7 +23,7 @@ export class BaseImageProps {
}
}

export const ImageCard = ({ props }: ImageCardProps) => {
export const ImageCard = ({ props }: ImageCardPropsInternal) => {
const output = (
<div className={props?.classes?.container}>
<Image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ElementClasses } from "../../types/Types";

export interface StringCardProps {
props: StringProps;
export interface StringCardPropsInternal {
props: StringCardProps;
}

export interface StringProps {
export interface StringCardProps {
value?: string;
classes?: ElementClasses;
isPrettyLoading?: boolean;
}

export const StringCard = ({ props }: StringCardProps) => {
export const StringCard = ({ props }: StringCardPropsInternal) => {
const output = props?.isPrettyLoading ? (props?.value !== undefined ? props?.value : "Loading...") : props?.value;

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// import { Token } from "../../hooks/Hooks";
// import { ElementClasses } from "../../types/Types";
import { BalanceCard } from "../property-cards/BalanceCard";
import { BigIntCardProps } from "../property-cards/BalanceCard";
import { ImageCard } from "../property-cards/ImageCard";
import { ImageProps } from "../property-cards/ImageCard";
// import { ImageProperties } from "../property-cards/ImageCard";
import { StringCard, StringProps } from "../property-cards/StringCard";
import { BalanceCard, BigIntCardProps } from "../property-cards/BalanceCard";
import { ImageCard, ImageCardProps } from "../property-cards/ImageCard";
import { StringCard, StringCardProps } from "../property-cards/StringCard";
import { Address } from "~~/components/scaffold-eth";

export interface BaseTokenCardProps {
Expand All @@ -14,10 +9,10 @@ export interface BaseTokenCardProps {

export interface BaseTokenCardElementsProps {
balanceProp?: BigIntCardProps;
nameProp?: StringProps;
descriptionProp?: StringProps;
imageProp?: ImageProps;
addressProp?: StringProps;
nameProp?: StringCardProps;
descriptionProp?: StringCardProps;
imageProp?: ImageCardProps;
addressProp?: StringCardProps;
}

export const BaseTokenCard = ({ elementsProps }: BaseTokenCardProps) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/components/rep-tokens/types/Types.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseImageProps } from "../cards/property-cards/ImageCard";
import { ImageProps } from "../cards/property-cards/ImageCard";

export interface ElementClasses {
container?: string;
Expand All @@ -12,7 +12,7 @@ export interface BaseElementConfigProp {
}

export interface ImageElementConfigProp extends BaseElementConfigProp {
imageProperties: BaseImageProps;
imageProperties: ImageProps;
}

export interface TokenElementsConfigProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/components/scaffold-eth/Address.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import Link from "next/link";
import { StringProps } from "../rep-tokens/cards/property-cards/StringCard";
import { StringCardProps } from "../rep-tokens/cards/property-cards/StringCard";
// import { ElementClasses } from "../rep-tokens/types/Types";
import { CopyToClipboard } from "react-copy-to-clipboard";
import { isAddress } from "viem";
Expand All @@ -16,7 +16,7 @@ type TAddressProps = {
format?: "short" | "long";
size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl";
// classes?: ElementClasses;
props?: StringProps;
props?: StringCardProps;
};

const blockieSizeMap = {
Expand Down

0 comments on commit 6645d7b

Please sign in to comment.