-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
149 changed files
with
5,070 additions
and
5,789 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { type Meta, type StoryObj } from "@storybook/react"; | ||
import { AddressCard as AddressCardComponent } from "./AddressCard"; | ||
|
||
type Story = StoryObj<typeof AddressCardComponent>; | ||
|
||
const meta: Meta<typeof AddressCardComponent> = { | ||
title: "Atoms/Address Card", | ||
component: AddressCardComponent, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const AddressCard: Story = { | ||
args: { | ||
address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", | ||
type: "effigy", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { type Meta, type StoryObj } from "@storybook/react"; | ||
import { NFT as NFTComponent } from "./NFT"; | ||
|
||
const meta: Meta<typeof NFTComponent> = { | ||
title: "Atoms/NFT", | ||
component: NFTComponent, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof NFTComponent>; | ||
|
||
export const NFT: Story = { | ||
args: { | ||
src: "https://nftassets.covalenthq.com/cdn-cgi/image/width=512,fit/bbf729c26915a469c16249db7c8af10e3db93765d26be4ec54426d0e5dc511d0.png", | ||
attributes: [ | ||
{ | ||
trait_type: "Background", | ||
value: "Purple Pink", | ||
}, | ||
{ | ||
trait_type: "Skin Tone", | ||
value: "Deep Neutral", | ||
}, | ||
{ | ||
trait_type: "Eyes", | ||
value: "Brown Straight", | ||
}, | ||
{ | ||
trait_type: "Facial Features", | ||
value: "Feline Eyes", | ||
}, | ||
{ | ||
trait_type: "Hairstyle", | ||
value: "Silver", | ||
}, | ||
{ | ||
trait_type: "Clothes", | ||
value: "Polka Dot Top", | ||
}, | ||
{ | ||
trait_type: "Earrings", | ||
value: "Flower Power", | ||
}, | ||
{ | ||
trait_type: "Mouth", | ||
value: "Slight Smile", | ||
}, | ||
{ | ||
trait_type: "Lips Color", | ||
value: "Passion Red", | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { type NFTProps } from "@/utils/types/atoms.types"; | ||
import { Card } from "@tremor/react"; | ||
import { CardContent, CardDescription } from "@/components/ui/card"; | ||
import { GRK_SIZES, defaultErrorNFT } from "@/utils/constants/shared.constants"; | ||
import { CardDetail } from "@/components/Shared"; | ||
import { TokenAvatar } from "../TokenAvatar/TokenAvatar"; | ||
import { useGoldRush } from "@/utils/store"; | ||
import { type ChainItem } from "@covalenthq/client-sdk"; | ||
import { useMemo } from "react"; | ||
|
||
export const NFT: React.FC<NFTProps> = ({ | ||
collection_name, | ||
token_id, | ||
attributes = [], | ||
src, | ||
children = null, | ||
chain_name = null, | ||
}) => { | ||
const { chains } = useGoldRush(); | ||
|
||
const chain = useMemo<ChainItem | null>( | ||
() => chains?.find((o) => o.name === chain_name) ?? null, | ||
[chains, chain_name] | ||
); | ||
|
||
return ( | ||
<Card className="w-64 overflow-hidden break-all bg-background-light p-0 dark:bg-background-dark"> | ||
<CardContent className="relative rounded transition-all"> | ||
<img | ||
className="block h-64 w-64 object-cover" | ||
src={src || defaultErrorNFT} | ||
onError={(e) => { | ||
e.currentTarget.src = defaultErrorNFT; | ||
}} | ||
/> | ||
|
||
{chain ? ( | ||
<div | ||
className="absolute -bottom-4 right-2 flex h-9 w-9 items-center justify-center rounded-[100%] bg-background-light p-1 dark:bg-background-dark" | ||
style={{ | ||
border: `2px solid `, | ||
borderColor: `${chain.color_theme.hex}`, | ||
}} | ||
> | ||
<TokenAvatar | ||
is_chain_logo | ||
size={GRK_SIZES.EXTRA_SMALL} | ||
chain_color={chain.color_theme.hex} | ||
token_url={chain?.logo_url} | ||
/> | ||
</div> | ||
) : ( | ||
<></> | ||
)} | ||
</CardContent> | ||
|
||
<CardDetail | ||
heading={collection_name?.toUpperCase() ?? null} | ||
content={token_id ? `#${token_id}` : null} | ||
wrapperClassName="p-2" | ||
/> | ||
|
||
{children} | ||
|
||
{attributes?.length ? ( | ||
<ul className="p-2 text-sm"> | ||
<CardDescription className="mb-1"> | ||
ATTRIBUTES | ||
</CardDescription> | ||
|
||
{attributes.map(({ trait_type, value }) => ( | ||
<li key={trait_type} className="flex justify-between"> | ||
<CardDescription>{trait_type}</CardDescription> | ||
|
||
{value} | ||
</li> | ||
))} | ||
</ul> | ||
) : ( | ||
<></> | ||
)} | ||
</Card> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export { Address } from "./Address/Address"; | ||
export { AddressAvatar } from "./AddressAvatar/AddressAvatar"; | ||
export { AddressCard } from "./AddressCard/AddressCard"; | ||
export { NFT } from "./NFT/NFT"; | ||
export { TokenAvatar } from "./TokenAvatar/TokenAvatar"; |
18 changes: 0 additions & 18 deletions
18
src/components/Molecules/AccountCard/AccountCard.stories.tsx
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/components/Molecules/Address/AddressActivityDetails/AddressActivityDetails.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { type Meta, type StoryObj } from "@storybook/react"; | ||
import { AddressActivityDetails as AddressActivityDetailsComponent } from "./AddressActivityDetails"; | ||
|
||
type Story = StoryObj<typeof AddressActivityDetailsComponent>; | ||
|
||
const meta: Meta<typeof AddressActivityDetailsComponent> = { | ||
title: "Molecules/Address/Address Activity Details", | ||
component: AddressActivityDetailsComponent, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const AddressActivityDetails: Story = { | ||
args: { | ||
address: "ganeshswami.eth", | ||
hide_no_activity: true, | ||
}, | ||
}; |
Oops, something went wrong.