-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update styles to the latest design (#94)
- Loading branch information
Showing
41 changed files
with
856 additions
and
240 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
87 changes: 87 additions & 0 deletions
87
packages/circle-demo-webapp/app/components/ChainIcon/ChainIcon.stories.ts
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,87 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Blockchain } from '~/lib/constants'; | ||
|
||
import { ChainIcon } from './ChainIcon'; | ||
|
||
const meta = { | ||
title: 'ChainIcon', | ||
component: ChainIcon, | ||
tags: ['autodocs'], | ||
} satisfies Meta<typeof ChainIcon>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const EthSepolia: Story = { | ||
args: { | ||
blockchain: Blockchain.EthSepolia, | ||
}, | ||
}; | ||
|
||
export const EthMainnet: Story = { | ||
args: { | ||
blockchain: Blockchain.Eth, | ||
}, | ||
}; | ||
|
||
export const ArbSepolia: Story = { | ||
args: { | ||
blockchain: Blockchain.ArbSepolia, | ||
}, | ||
}; | ||
|
||
export const ArbMainnet: Story = { | ||
args: { | ||
blockchain: Blockchain.Arb, | ||
}, | ||
}; | ||
|
||
export const AvaxFuji: Story = { | ||
args: { | ||
blockchain: Blockchain.AvaxFuji, | ||
}, | ||
}; | ||
|
||
export const AvaxMainnet: Story = { | ||
args: { | ||
blockchain: Blockchain.Avax, | ||
}, | ||
}; | ||
|
||
export const PolygonAmoy: Story = { | ||
args: { | ||
blockchain: Blockchain.MaticAmoy, | ||
}, | ||
}; | ||
|
||
export const PolygonMainnet: Story = { | ||
args: { | ||
blockchain: Blockchain.Matic, | ||
}, | ||
}; | ||
|
||
export const SolanaDevnet: Story = { | ||
args: { | ||
blockchain: Blockchain.SolDevnet, | ||
}, | ||
}; | ||
|
||
export const SolanaMainnet: Story = { | ||
args: { | ||
blockchain: Blockchain.Sol, | ||
}, | ||
}; | ||
|
||
export const NearTestnet: Story = { | ||
args: { | ||
blockchain: Blockchain.NearTestnet, | ||
}, | ||
}; | ||
|
||
export const NearMainnet: Story = { | ||
args: { | ||
blockchain: Blockchain.Near, | ||
}, | ||
}; |
38 changes: 38 additions & 0 deletions
38
packages/circle-demo-webapp/app/components/ChainIcon/ChainIcon.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,38 @@ | ||
import { NetworkIcon } from '@web3icons/react'; | ||
|
||
import { Blockchain } from '~/lib/constants'; | ||
|
||
export interface ChainIconProps { | ||
/** The blockchain network */ | ||
blockchain: string; | ||
} | ||
|
||
const BLOCKCHAIN_TO_ICON_MAP: Record<string, string> = { | ||
[Blockchain.ArbSepolia]: 'arbitrum', | ||
[Blockchain.Arb]: 'arbitrum', | ||
[Blockchain.AvaxFuji]: 'avalanche', | ||
[Blockchain.Avax]: 'avalanche', | ||
[Blockchain.EthSepolia]: 'ethereum', | ||
[Blockchain.Eth]: 'ethereum', | ||
[Blockchain.EvmTestnet]: '', | ||
[Blockchain.Evm]: '', | ||
[Blockchain.MaticAmoy]: 'polygon', | ||
[Blockchain.Matic]: 'polygon', | ||
[Blockchain.NearTestnet]: 'near-protocol', | ||
[Blockchain.Near]: 'near-protocol', | ||
[Blockchain.SolDevnet]: 'solana', | ||
[Blockchain.Sol]: 'solana', | ||
}; | ||
|
||
/** A label with an icon and text to identify a blockchain network */ | ||
export function ChainIcon({ blockchain }: ChainIconProps) { | ||
const network = BLOCKCHAIN_TO_ICON_MAP[blockchain]; | ||
|
||
const icon = <NetworkIcon network={network} size={20} variant="branded" />; | ||
|
||
return network === 'arbitrum' ? ( | ||
<span className="rounded-full bg-[#2D3649]">{icon}</span> | ||
) : ( | ||
icon | ||
); | ||
} |
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 @@ | ||
export * from './ChainIcon'; |
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
28 changes: 15 additions & 13 deletions
28
packages/circle-demo-webapp/app/components/ComplianceEngineText/ComplianceEngineText.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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
export function ComplianceEngineText({ result }: { result: boolean }) { | ||
return ( | ||
<div className="flex"> | ||
{result ? ( | ||
<p className="bg-teal-600/10 rounded-lg py-1 px-3 my-2 text-xs text-success"> | ||
Approved by Circle Compliance Engine ✓ | ||
</p> | ||
) : ( | ||
<p className="bg-teal-600/10 rounded-lg py-1 px-3 my-2 text-xs text-error denied"> | ||
Denied by Circle Compliance Engine ✘ | ||
</p> | ||
)} | ||
</div> | ||
import { Badge } from '~/components/ui/badge'; | ||
|
||
export interface ComplianceEngineTextProps { | ||
result: boolean; | ||
} | ||
|
||
export function ComplianceEngineText({ result }: ComplianceEngineTextProps) { | ||
return result ? ( | ||
<Badge variant="accent" className="font-normal text-green-600 dark:text-green-500"> | ||
Approved by Circle Compliance Engine ✓ | ||
</Badge> | ||
) : ( | ||
<Badge variant="accent" className="font-normal text-red-500 dark:text-red-400"> | ||
Denied by Circle Compliance Engine ✘ | ||
</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
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
Oops, something went wrong.