-
Notifications
You must be signed in to change notification settings - Fork 440
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
1 parent
9da305d
commit 1a8cc14
Showing
6 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
import { Badge } from "@/components/ui/Badge"; | ||
import { CHAINS } from "@/config/chains"; | ||
import type { Register } from "wagmi"; | ||
|
||
export const ChainIndicator = ({ | ||
chain, | ||
}: { chain: Register["config"]["chains"][number]["id"] }) => ( | ||
<Badge size="sm"> | ||
<img | ||
src={CHAINS[chain].icon} | ||
alt={CHAINS[chain].name} | ||
className="size-3.5" | ||
/> | ||
<span>{CHAINS[chain].name}</span> | ||
</Badge> | ||
); |
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
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,19 @@ | ||
import { mainnet, sepolia } from "viem/chains"; | ||
import type { Register } from "wagmi"; | ||
|
||
export const CHAINS = { | ||
[mainnet.id]: { | ||
name: mainnet.name, | ||
icon: "/chainLogos/eth.svg", | ||
}, | ||
[sepolia.id]: { | ||
name: sepolia.name, | ||
icon: "/chainLogos/eth.svg", | ||
}, | ||
} satisfies Record< | ||
Register["config"]["chains"][number]["id"], | ||
{ | ||
name: string; | ||
icon: string; | ||
} | ||
>; |
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,17 @@ | ||
import { ChainIndicator } from "@/components/requirements/ChainIndicator"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const meta: Meta<typeof ChainIndicator> = { | ||
title: "Requirement building blocks/ChainIndicator", | ||
component: ChainIndicator, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ChainIndicator>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
chain: 1, | ||
}, | ||
}; |