diff --git a/package-lock.json b/package-lock.json index de01fa68..d7a4ff95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@covalenthq/goldrush-kit", - "version": "0.2.6", + "version": "0.2.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@covalenthq/goldrush-kit", - "version": "0.2.6", + "version": "0.2.7", "license": "Apache-2.0", "dependencies": { "@covalenthq/client-sdk": "^0.6.6", diff --git a/src/components/Atoms/Address/Address.stories.tsx b/src/components/Atoms/Address/Address.stories.tsx index 9da75cab..a92546aa 100644 --- a/src/components/Atoms/Address/Address.stories.tsx +++ b/src/components/Atoms/Address/Address.stories.tsx @@ -1,16 +1,16 @@ import { type Meta, type StoryObj } from "@storybook/react"; -import { Address } from "./Address"; +import { Address as AddressComponent } from "./Address"; -const meta: Meta = { +const meta: Meta = { title: "Atoms/Address", - component: Address, + component: AddressComponent, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; -export const AddressDisplay: Story = { +export const Address: Story = { args: { address: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", }, diff --git a/src/components/Atoms/Address/Address.tsx b/src/components/Atoms/Address/Address.tsx index 7d192a0b..b1c3e1fc 100644 --- a/src/components/Atoms/Address/Address.tsx +++ b/src/components/Atoms/Address/Address.tsx @@ -1,5 +1,5 @@ import { copyToClipboard, truncate } from "@/utils/functions"; -import { IconWrapper } from "@/components/Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "@/components/Shared"; import { type AddressProps } from "@/utils/types/atoms.types"; export const Address: React.FC = ({ address }) => { diff --git a/src/components/Atoms/AddressAvatar/AddressAvatar.stories.tsx b/src/components/Atoms/AddressAvatar/AddressAvatar.stories.tsx index 60410f44..c5315a90 100644 --- a/src/components/Atoms/AddressAvatar/AddressAvatar.stories.tsx +++ b/src/components/Atoms/AddressAvatar/AddressAvatar.stories.tsx @@ -1,65 +1,63 @@ import { type Meta, type StoryObj } from "@storybook/react"; -import { AddressAvatar } from "./AddressAvatar"; +import { AddressAvatar as AddressAvatarComponent } from "./AddressAvatar"; import { type AddressAvatarProps } from "@/utils/types/atoms.types"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; -const meta: Meta = { - title: "Atoms/AddressAvatar", - component: AddressAvatar, +const meta: Meta = { + title: "Atoms/Address Avatar", + component: AddressAvatarComponent, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; -const render = ({ size, type, address, rounded }: AddressAvatarProps) => { - return ( - <> -
- -
- -
- - - - - -
- - ); -}; - -export const AvatarSizes: Story = { +export const AddressAvatar: Story = { args: { size: GRK_SIZES.SMALL, type: "fingerprint", address: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", }, - render: render, + render: ({ size, type, address, rounded }: AddressAvatarProps) => { + return ( + <> +
+ +
+ +
+ + + + + +
+ + ); + }, }; diff --git a/src/components/Atoms/NetPriceDelta/NetPriceDelta.tsx b/src/components/Atoms/NetPriceDelta/NetPriceDelta.tsx deleted file mode 100644 index a4fadffa..00000000 --- a/src/components/Atoms/NetPriceDelta/NetPriceDelta.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useMemo } from "react"; -import { type NetPriceDeltaProps } from "@/utils/types/atoms.types"; - -export const NetPriceDelta: React.FC = ({ - numerator, - denominator, -}) => { - const DELTA = useMemo( - () => ((numerator - denominator) / denominator) * 100, - [numerator, denominator] - ); - - const AMOUNT = useMemo(() => (DELTA / 100) * denominator, [DELTA]); - - const SUMMARY_STRING = useMemo( - () => - `${DELTA.toLocaleString("en", { - maximumFractionDigits: 2, - })}% (${AMOUNT.toLocaleString("en", { - style: "currency", - currency: "USD", - maximumFractionDigits: 2, - })})`, - [AMOUNT, DELTA] - ); - - if (DELTA > 1) { - return ▲{SUMMARY_STRING}; - } else if (DELTA < 1) { - return ▼{SUMMARY_STRING}; - } - - return -; -}; diff --git a/src/components/Atoms/TokenAvatar/TokenAvatar.stories.tsx b/src/components/Atoms/TokenAvatar/TokenAvatar.stories.tsx index 4c76c86d..dd9c7a4a 100644 --- a/src/components/Atoms/TokenAvatar/TokenAvatar.stories.tsx +++ b/src/components/Atoms/TokenAvatar/TokenAvatar.stories.tsx @@ -1,17 +1,17 @@ import { type Meta, type StoryObj } from "@storybook/react"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; -import { TokenAvatar } from "./TokenAvatar"; +import { TokenAvatar as TokenAvatarComponent } from "./TokenAvatar"; -const meta: Meta = { +const meta: Meta = { title: "Atoms/TokenAvatar", - component: TokenAvatar, + component: TokenAvatarComponent, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; -export const TokenAvatarDisplay: Story = { +export const TokenAvatar: Story = { args: { size: GRK_SIZES.SMALL, }, @@ -19,36 +19,36 @@ export const TokenAvatarDisplay: Story = { return ( <>
-
- - - - -
- - - - ; +type Story = StoryObj; -const meta: Meta = { +const meta: Meta = { title: "Molecules", - component: AccountCardView, + component: AccountCardComponent, }; export default meta; diff --git a/src/components/Molecules/AccountCardView/AccountCardView.tsx b/src/components/Molecules/AccountCard/AccountCard.tsx similarity index 95% rename from src/components/Molecules/AccountCardView/AccountCardView.tsx rename to src/components/Molecules/AccountCard/AccountCard.tsx index 0e55478b..4a52738b 100644 --- a/src/components/Molecules/AccountCardView/AccountCardView.tsx +++ b/src/components/Molecules/AccountCard/AccountCard.tsx @@ -9,11 +9,11 @@ import QRCode from "react-qr-code"; import { useState } from "react"; import { useToast } from "../../../utils/hooks/use-toast"; import { AddressAvatar } from "../../Atoms/AddressAvatar/AddressAvatar"; -import { IconWrapper } from "../../Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "../../Shared"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; -import { type AccountCardViewProps } from "@/utils/types/molecules.types"; +import { type AccountCardProps } from "@/utils/types/molecules.types"; -export const AccountCardView: React.FC = ({ +export const AccountCard: React.FC = ({ address, type = "effigy", name = "Unnamed Wallet", diff --git a/src/components/Molecules/CollectionCardView/CollectionCardView.tsx b/src/components/Molecules/CollectionCardView/CollectionCardView.tsx index c2bff11f..f5d0b916 100644 --- a/src/components/Molecules/CollectionCardView/CollectionCardView.tsx +++ b/src/components/Molecules/CollectionCardView/CollectionCardView.tsx @@ -9,7 +9,7 @@ import QRCode from "react-qr-code"; import { useEffect, useState } from "react"; import { useToast } from "../../../utils/hooks/use-toast"; import { AddressAvatar } from "../../Atoms/AddressAvatar/AddressAvatar"; -import { IconWrapper } from "../../Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "@/components/Shared"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; import { type CollectionCardViewProps } from "@/utils/types/molecules.types"; import { useCovalent } from "@/utils/store/Covalent"; diff --git a/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.stories.tsx b/src/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice.stories.tsx similarity index 60% rename from src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.stories.tsx rename to src/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice.stories.tsx index 51d3a76c..203a2340 100644 --- a/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.stories.tsx +++ b/src/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice.stories.tsx @@ -1,12 +1,12 @@ import { type Meta, type StoryObj } from "@storybook/react"; -import { NFTFloorPriceView } from "./NFTFloorPriceView"; +import { NFTFloorPrice as NFTFloorPriceComponent } from "./NFTFloorPrice"; import { NFT_COLLECTIONS } from "@/utils/constants/shared.constants"; -type Story = StoryObj; +type Story = StoryObj; -const meta: Meta = { +const meta: Meta = { title: "Molecules/NFTs", - component: NFTFloorPriceView, + component: NFTFloorPriceComponent, }; export default meta; diff --git a/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx b/src/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice.tsx similarity index 97% rename from src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx rename to src/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice.tsx index 5b6c66ea..829d20e3 100644 --- a/src/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView.tsx +++ b/src/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice.tsx @@ -16,9 +16,9 @@ import { } from "@/utils/constants/shared.constants"; import { CHART_COLORS } from "@/utils/constants/shared.constants"; import { useCovalent } from "@/utils/store/Covalent"; -import { type NFTFloorPriceViewProps } from "@/utils/types/molecules.types"; +import { type NFTFloorPriceProps } from "@/utils/types/molecules.types"; -export const NFTFloorPriceView: React.FC = ({ +export const NFTFloorPrice: React.FC = ({ chain_name, collection_address, }) => { diff --git a/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.stories.tsx b/src/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount.stories.tsx similarity index 60% rename from src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.stories.tsx rename to src/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount.stories.tsx index f7342b53..c68a6689 100644 --- a/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.stories.tsx +++ b/src/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount.stories.tsx @@ -1,12 +1,12 @@ import { type Meta, type StoryObj } from "@storybook/react"; -import { NFTSalesCountView } from "./NFTSalesCountView"; +import { NFTSalesCount as NFTSalesCountComponent } from "./NFTSalesCount"; import { NFT_COLLECTIONS } from "@/utils/constants/shared.constants"; -type Story = StoryObj; +type Story = StoryObj; -const meta: Meta = { +const meta: Meta = { title: "Molecules/NFTs", - component: NFTSalesCountView, + component: NFTSalesCountComponent, }; export default meta; diff --git a/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx b/src/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount.tsx similarity index 96% rename from src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx rename to src/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount.tsx index 2b152b5a..60299a02 100644 --- a/src/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView.tsx +++ b/src/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount.tsx @@ -8,9 +8,9 @@ import { Skeleton } from "@/components/ui/skeleton"; import { GRK_SIZES, PERIOD } from "@/utils/constants/shared.constants"; import { CHART_COLORS } from "@/utils/constants/shared.constants"; import { useCovalent } from "@/utils/store/Covalent"; -import { type NFTSalesCountViewProps } from "@/utils/types/molecules.types"; +import { type NFTSalesCountProps } from "@/utils/types/molecules.types"; -export const NFTSalesCountView: React.FC = ({ +export const NFTSalesCount: React.FC = ({ chain_name, collection_address, }) => { diff --git a/src/components/Molecules/NFTs/NFTVolumeView/NFTVolumeView.stories.tsx b/src/components/Molecules/NFTs/NFTVolume/NFTVolume.stories.tsx similarity index 88% rename from src/components/Molecules/NFTs/NFTVolumeView/NFTVolumeView.stories.tsx rename to src/components/Molecules/NFTs/NFTVolume/NFTVolume.stories.tsx index 266162db..4b0bcb84 100644 --- a/src/components/Molecules/NFTs/NFTVolumeView/NFTVolumeView.stories.tsx +++ b/src/components/Molecules/NFTs/NFTVolume/NFTVolume.stories.tsx @@ -1,5 +1,5 @@ import { type Meta, type StoryObj } from "@storybook/react"; -import { NFTVolumeView } from "./NFTVolumeView"; +import { NFTVolume as NFTVolumeView } from "./NFTVolume"; import { NFT_COLLECTIONS } from "@/utils/constants/shared.constants"; type Story = StoryObj; diff --git a/src/components/Molecules/NFTs/NFTVolumeView/NFTVolumeView.tsx b/src/components/Molecules/NFTs/NFTVolume/NFTVolume.tsx similarity index 97% rename from src/components/Molecules/NFTs/NFTVolumeView/NFTVolumeView.tsx rename to src/components/Molecules/NFTs/NFTVolume/NFTVolume.tsx index 73630d67..c6948f00 100644 --- a/src/components/Molecules/NFTs/NFTVolumeView/NFTVolumeView.tsx +++ b/src/components/Molecules/NFTs/NFTVolume/NFTVolume.tsx @@ -12,10 +12,10 @@ import { } from "@/utils/constants/shared.constants"; import { CHART_COLORS } from "@/utils/constants/shared.constants"; import { useCovalent } from "@/utils/store/Covalent"; -import { type NFTVolumeViewProps } from "@/utils/types/molecules.types"; +import { type NFTVolumeProps } from "@/utils/types/molecules.types"; import { prettifyCurrency } from "@covalenthq/client-sdk"; -export const NFTVolumeView: React.FC = ({ +export const NFTVolume: React.FC = ({ chain_name, collection_address, }) => { diff --git a/src/components/Organisms/NFTs/NFTCollectionTokenListView/NFTCollectionTokenListView.tsx b/src/components/Organisms/NFTs/NFTCollectionTokenListView/NFTCollectionTokenListView.tsx index 8276b2dd..00546df3 100644 --- a/src/components/Organisms/NFTs/NFTCollectionTokenListView/NFTCollectionTokenListView.tsx +++ b/src/components/Organisms/NFTs/NFTCollectionTokenListView/NFTCollectionTokenListView.tsx @@ -26,7 +26,7 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -import { IconWrapper } from "@/components/Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "@/components/Shared"; export const NFTCollectionTokenListView: React.FC< NFTCollectionTokenListViewProps diff --git a/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.stories.tsx b/src/components/Organisms/NFTs/NFTDetailsView/NFTDetailsView.stories.tsx similarity index 57% rename from src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.stories.tsx rename to src/components/Organisms/NFTs/NFTDetailsView/NFTDetailsView.stories.tsx index 7af61473..958a3fa4 100644 --- a/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.stories.tsx +++ b/src/components/Organisms/NFTs/NFTDetailsView/NFTDetailsView.stories.tsx @@ -1,16 +1,16 @@ import { type Meta, type StoryObj } from "@storybook/react"; -import { NFTDetailView } from "./NFTDetailView"; +import { NFTDetailsView } from "./NFTDetailsView"; -type Story = StoryObj; +type Story = StoryObj; -const meta: Meta = { +const meta: Meta = { title: "Organisms/NFTs", - component: NFTDetailView, + component: NFTDetailsView, }; export default meta; -export const NFTDetail: Story = { +export const NFTDetails: Story = { args: { chain_name: "eth-mainnet", collection_address: "0xe785e82358879f061bc3dcac6f0444462d4b5330", diff --git a/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx b/src/components/Organisms/NFTs/NFTDetailsView/NFTDetailsView.tsx similarity index 93% rename from src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx rename to src/components/Organisms/NFTs/NFTDetailsView/NFTDetailsView.tsx index 39b8a88d..6ee98e53 100644 --- a/src/components/Organisms/NFTs/NFTDetailView/NFTDetailView.tsx +++ b/src/components/Organisms/NFTs/NFTDetailsView/NFTDetailsView.tsx @@ -1,15 +1,15 @@ import { TypographyH1, TypographyH4 } from "@/components/ui/typography"; import { useCovalent } from "@/utils/store/Covalent"; -import { NFTSalesCountView } from "@/components/Molecules/NFTs/NFTSalesCountView/NFTSalesCountView"; -import { NFTFloorPriceView } from "@/components/Molecules/NFTs/NFTFloorPriceView/NFTFloorPriceView"; +import { NFTSalesCount } from "@/components/Molecules/NFTs/NFTSalesCount/NFTSalesCount"; +import { NFTFloorPrice } from "@/components/Molecules/NFTs/NFTFloorPrice/NFTFloorPrice"; import { type Option, Some, None } from "@/utils/option"; -import { type NFTDetailViewProps } from "@/utils/types/organisms.types"; +import { type NFTDetailsViewProps } from "@/utils/types/organisms.types"; import { type NftTokenContract } from "@covalenthq/client-sdk"; import { useEffect, useState } from "react"; import { Skeleton } from "@/components/ui/skeleton"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; -export const NFTDetailView: React.FC = ({ +export const NFTDetailsView: React.FC = ({ chain_name, collection_address, token_id, @@ -125,14 +125,14 @@ export const NFTDetailView: React.FC = ({ })}
-
-
- +

diff --git a/src/components/Organisms/NFTs/NFTWalletTokenListView/NFTWalletTokenListView.tsx b/src/components/Organisms/NFTs/NFTWalletTokenListView/NFTWalletTokenListView.tsx index 1c0c5bea..72852819 100644 --- a/src/components/Organisms/NFTs/NFTWalletTokenListView/NFTWalletTokenListView.tsx +++ b/src/components/Organisms/NFTs/NFTWalletTokenListView/NFTWalletTokenListView.tsx @@ -14,7 +14,7 @@ import { } from "@/components/ui/card"; import flatMap from "lodash/flatMap"; import sum from "lodash/sum"; -import { AccountCardView } from "@/components/Molecules/AccountCardView/AccountCardView"; +import { AccountCard } from "@/components/Molecules/AccountCard/AccountCard"; import { Skeleton } from "@/components/ui/skeleton"; import { useCovalent } from "@/utils/store/Covalent"; import { type NFTWalletTokenListViewProps } from "@/utils/types/organisms.types"; @@ -85,7 +85,7 @@ export const NFTWalletTokenListView: React.FC = ({ return (
- +

@@ -114,7 +114,7 @@ export const NFTWalletTokenListView: React.FC = ({ }, })} -
+
{" "} ( diff --git a/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.stories.tsx b/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.stories.tsx index 9aef9f6b..6e9536e1 100644 --- a/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.stories.tsx +++ b/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.stories.tsx @@ -4,7 +4,7 @@ import { AddressActivityListView } from "./AddressActivityListView"; type Story = StoryObj; const meta: Meta = { - title: "Organisms/Address Activity", + title: "Organisms/Token Balances", component: AddressActivityListView, }; diff --git a/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.tsx b/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.tsx index 3e63a795..0364041d 100644 --- a/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.tsx +++ b/src/components/Organisms/TokenBalances/AddressActivityListView/AddressActivityListView.tsx @@ -18,12 +18,12 @@ import { TableRow, } from "@/components/ui/table"; import { Checkbox } from "@/components/ui/checkbox"; -import { AccountCardView } from "@/components/Molecules/AccountCardView/AccountCardView"; +import { AccountCard } from "@/components/Molecules/AccountCard/AccountCard"; import { Skeleton } from "@/components/ui/skeleton"; import { timestampParser } from "@/utils/functions"; import { TokenAvatar } from "@/components/Atoms/TokenAvatar/TokenAvatar"; import { TableHeaderSorting } from "@/components/ui/tableHeaderSorting"; -import { IconWrapper } from "@/components/Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "@/components/Shared"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; import { useCovalent } from "@/utils/store/Covalent"; import { type AddressActivityListViewProps } from "@/utils/types/organisms.types"; @@ -262,7 +262,7 @@ export const AddressActivityListView: React.FC< return (
- +
{" "} diff --git a/src/components/Organisms/TokenBalances/TokenBalancesListView/TokenBalancesListView.tsx b/src/components/Organisms/TokenBalances/TokenBalancesListView/TokenBalancesListView.tsx index 8208bc40..da34506d 100644 --- a/src/components/Organisms/TokenBalances/TokenBalancesListView/TokenBalancesListView.tsx +++ b/src/components/Organisms/TokenBalances/TokenBalancesListView/TokenBalancesListView.tsx @@ -35,11 +35,10 @@ import { Skeleton } from "@/components/ui/skeleton"; import { TokenAvatar } from "../../../Atoms/TokenAvatar/TokenAvatar"; import { Button } from "@/components/ui/button"; import { timestampParser } from "@/utils/functions"; -import { BalancePriceDelta } from "@/components/Atoms/BalancePriceDelta/BalancePriceDelta"; -import { AccountCardView } from "@/components/Molecules/AccountCardView/AccountCardView"; +import { BalancePriceDelta, IconWrapper } from "@/components/Shared"; +import { AccountCard } from "@/components/Molecules/AccountCard/AccountCard"; import { TableHeaderSorting } from "@/components/ui/tableHeaderSorting"; import { sum } from "lodash"; -import { IconWrapper } from "@/components/Atoms/IconWrapper/IconWrapper"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; import { useCovalent } from "@/utils/store/Covalent"; import { @@ -293,7 +292,6 @@ export const TokenBalancesListView: React.FC = ({ return (
- {" "} = ({ return (
- +

Total Quote

diff --git a/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.stories.tsx b/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.stories.tsx index b5151355..c9f8cdae 100644 --- a/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.stories.tsx +++ b/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.stories.tsx @@ -4,7 +4,7 @@ import { TokenTransfersListView } from "./TokenTransfersListView"; type Story = StoryObj; const meta: Meta = { - title: "Organisms/Token Transfers", + title: "Organisms/Token Balances", component: TokenTransfersListView, }; diff --git a/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.tsx b/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.tsx index a1e2f395..17a830f7 100644 --- a/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.tsx +++ b/src/components/Organisms/TokenBalances/TokenTransfersListView/TokenTransfersListView.tsx @@ -33,7 +33,7 @@ import { calculateTimeSeriesGroup, } from "@/utils/functions"; import { Badge } from "@/components/ui/badge"; -import { AccountCardView } from "@/components/Molecules/AccountCardView/AccountCardView"; +import { AccountCard } from "@/components/Molecules/AccountCard/AccountCard"; import { TableHeaderSorting } from "@/components/ui/tableHeaderSorting"; import { Button } from "@/components/ui/button"; import { @@ -45,7 +45,7 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { AddressAvatar } from "@/components/Atoms/AddressAvatar/AddressAvatar"; -import { IconWrapper } from "@/components/Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "@/components/Shared"; import { GRK_SIZES } from "@/utils/constants/shared.constants"; import { type TokenTransfersListViewProps, @@ -458,7 +458,7 @@ export const TokenTransfersListView: React.FC = ({ return (
- +
Network diff --git a/src/components/Atoms/BalancePriceDelta/BalancePriceDelta.tsx b/src/components/Shared/BalancePriceDelta.tsx similarity index 78% rename from src/components/Atoms/BalancePriceDelta/BalancePriceDelta.tsx rename to src/components/Shared/BalancePriceDelta.tsx index 116c287a..df909394 100644 --- a/src/components/Atoms/BalancePriceDelta/BalancePriceDelta.tsx +++ b/src/components/Shared/BalancePriceDelta.tsx @@ -1,7 +1,7 @@ -import { type BalancePriceDeltaProps } from "@/utils/types/atoms.types"; +import { type BalancePriceDeltaProps } from "@/utils/types/shared.types"; import { useMemo } from "react"; -export const BalancePriceDelta: React.FC = ({ +const BalancePriceDelta: React.FC = ({ numerator, denominator, }) => { @@ -26,3 +26,5 @@ export const BalancePriceDelta: React.FC = ({ return -; }; + +export default BalancePriceDelta; diff --git a/src/components/Atoms/CopyImage/CopyImage.tsx b/src/components/Shared/CopyImage.tsx similarity index 79% rename from src/components/Atoms/CopyImage/CopyImage.tsx rename to src/components/Shared/CopyImage.tsx index e08a439f..1d43a69f 100644 --- a/src/components/Atoms/CopyImage/CopyImage.tsx +++ b/src/components/Shared/CopyImage.tsx @@ -1,9 +1,9 @@ import { useState } from "react"; -import { IconWrapper } from "../IconWrapper/IconWrapper"; -import { type CopyImageProps } from "@/utils/types/atoms.types"; +import { IconWrapper } from "."; +import { type CopyImageProps } from "@/utils/types/shared.types"; import { copyToClipboard } from "@/utils/functions"; -export const CopyImage: React.FC = ({ url }) => { +const CopyImage: React.FC = ({ url }) => { const [copied, showCopied] = useState(false); return copied ? ( @@ -26,3 +26,5 @@ export const CopyImage: React.FC = ({ url }) => { /> ); }; + +export default CopyImage; diff --git a/src/components/Atoms/IconWrapper/IconWrapper.tsx b/src/components/Shared/IconWrapper.tsx similarity index 77% rename from src/components/Atoms/IconWrapper/IconWrapper.tsx rename to src/components/Shared/IconWrapper.tsx index 85bea7dc..3e5fd292 100644 --- a/src/components/Atoms/IconWrapper/IconWrapper.tsx +++ b/src/components/Shared/IconWrapper.tsx @@ -1,6 +1,6 @@ -import { type IconWrapperPropsType } from "@/utils/types/atoms.types"; +import { type IconWrapperProps } from "@/utils/types/shared.types"; -export const IconWrapper: React.FC = ({ +const IconWrapper: React.FC = ({ class_name, icon_class_name, on_click, @@ -23,3 +23,5 @@ export const IconWrapper: React.FC = ({
); }; + +export default IconWrapper; diff --git a/src/components/Shared/index.tsx b/src/components/Shared/index.tsx new file mode 100644 index 00000000..f8458170 --- /dev/null +++ b/src/components/Shared/index.tsx @@ -0,0 +1,3 @@ +export { default as BalancePriceDelta } from "./BalancePriceDelta"; +export { default as CopyImage } from "./CopyImage"; +export { default as IconWrapper } from "./IconWrapper"; diff --git a/src/components/Atoms/ThemeChange/ThemeChange.stories.tsx b/src/components/ThemeConfig/ThemeConfig.stories.tsx similarity index 99% rename from src/components/Atoms/ThemeChange/ThemeChange.stories.tsx rename to src/components/ThemeConfig/ThemeConfig.stories.tsx index 507b4f53..5fa6564b 100644 --- a/src/components/Atoms/ThemeChange/ThemeChange.stories.tsx +++ b/src/components/ThemeConfig/ThemeConfig.stories.tsx @@ -9,7 +9,7 @@ import { Checkbox } from "@/components/ui/checkbox"; import { COLORS, GRK_SIZES } from "@/utils/constants/shared.constants"; const meta: Meta = { - title: "ThemeConfig", + title: "Theme Config", component: Button, argTypes: { default_color: { @@ -239,7 +239,7 @@ const renderNeoBrutalism = ({ changeToNeo, changeToClassic }: any) => { ); }; -export const ChangeColor: Story = { +export const ThemeConfig: Story = { render: ({ default_color, border_radius }) => { function changeColor(accentcolor: string, border_radius: string) { const theme = { diff --git a/src/components/ui/tableHeaderSorting.tsx b/src/components/ui/tableHeaderSorting.tsx index 3b386175..538cb817 100644 --- a/src/components/ui/tableHeaderSorting.tsx +++ b/src/components/ui/tableHeaderSorting.tsx @@ -1,5 +1,5 @@ import { type Column } from "@tanstack/react-table"; -import { IconWrapper } from "../Atoms/IconWrapper/IconWrapper"; +import { IconWrapper } from "../Shared"; export interface TableHeaderSortingProps { header_name: string; diff --git a/src/utils/types/atoms.types.ts b/src/utils/types/atoms.types.ts index fbc3d1f9..899b9615 100644 --- a/src/utils/types/atoms.types.ts +++ b/src/utils/types/atoms.types.ts @@ -13,28 +13,6 @@ export interface AddressAvatarProps { class_name?: string; } -export interface BalancePriceDeltaProps { - numerator: number; - denominator: number; -} - -export interface CopyImageProps { - url: string; -} - -export interface IconWrapperPropsType { - class_name?: string; - icon_class_name?: string; - on_click?: (e?: React.MouseEvent) => void; - icon_size?: string; - icon_type?: string; -} - -export interface NetPriceDeltaProps { - numerator: number; - denominator: number; -} - export interface TokenAvatarProps { token_url?: string | null; sub_url?: string | null; diff --git a/src/utils/types/molecules.types.ts b/src/utils/types/molecules.types.ts index a79ee6e9..dd37702b 100644 --- a/src/utils/types/molecules.types.ts +++ b/src/utils/types/molecules.types.ts @@ -1,6 +1,6 @@ import { type Chain } from "@covalenthq/client-sdk"; -export interface AccountCardViewProps { +export interface AccountCardProps { name?: string; address: string; type?: "fingerprint" | "effigy" | "wallet"; @@ -11,19 +11,19 @@ export interface CollectionCardViewProps { collection_address: string; } -export interface NFTFloorPriceViewProps { +export interface NFTFloorPriceProps { chain_name: Chain; collection_address: string; token_id?: string; } -export interface NFTSalesCountViewProps { +export interface NFTSalesCountProps { chain_name: Chain; collection_address: string; token_id?: string; } -export interface NFTVolumeViewProps { +export interface NFTVolumeProps { chain_name: Chain; collection_address: string; token_id?: string; diff --git a/src/utils/types/organisms.types.ts b/src/utils/types/organisms.types.ts index 56739014..24ea0b39 100644 --- a/src/utils/types/organisms.types.ts +++ b/src/utils/types/organisms.types.ts @@ -5,7 +5,7 @@ import { type Chain, } from "@covalenthq/client-sdk"; -export interface NFTDetailViewProps { +export interface NFTDetailsViewProps { chain_name: Chain; collection_address: string; token_id: string; diff --git a/src/utils/types/shared.types.ts b/src/utils/types/shared.types.ts new file mode 100644 index 00000000..1e7302b8 --- /dev/null +++ b/src/utils/types/shared.types.ts @@ -0,0 +1,16 @@ +export interface BalancePriceDeltaProps { + numerator: number; + denominator: number; +} + +export interface CopyImageProps { + url: string; +} + +export interface IconWrapperProps { + class_name?: string; + icon_class_name?: string; + on_click?: (e?: React.MouseEvent) => void; + icon_size?: string; + icon_type?: string; +}