-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove kit-wallet dependency from kit (#40)
- Loading branch information
1 parent
3af4c31
commit 99de6a9
Showing
10 changed files
with
146 additions
and
20 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
22 changes: 22 additions & 0 deletions
22
packages/kit/src/components/KitProvider/CollectibleTileImage.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,22 @@ | ||
import React from 'react' | ||
import { Card, Image } from '@0xsequence/design-system' | ||
|
||
interface CollectibleTileImageProps { | ||
imageUrl?: string | ||
} | ||
|
||
export const CollectibleTileImage = ({ imageUrl }: CollectibleTileImageProps) => { | ||
return ( | ||
<Card | ||
padding="0" | ||
aspectRatio="1/1" | ||
justifyContent="center" | ||
alignItems="center" | ||
overflow="hidden" | ||
borderRadius="sm" | ||
background="backgroundSecondary" | ||
> | ||
<Image style={{ height: '100%' }} src={imageUrl} /> | ||
</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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react' | ||
import { Box, Image, Text } from '@0xsequence/design-system' | ||
import { getNativeTokenInfoByChainId, getNetwork, getNetworkColor, getNetworkBackgroundColor } from '@0xsequence/kit' | ||
import { useConfig } from 'wagmi' | ||
|
||
import { capitalize } from '../../utils/string' | ||
|
||
interface NetworkBadgeProps { | ||
chainId: number | ||
} | ||
|
||
export const NetworkBadge = ({ chainId }: NetworkBadgeProps) => { | ||
const { chains } = useConfig() | ||
const network = getNetwork(chainId) | ||
const nativeTokenInfo = getNativeTokenInfoByChainId(chainId, chains) | ||
const chainColor = getNetworkColor(chainId) | ||
const chainBGColor = getNetworkBackgroundColor(chainId) | ||
|
||
return ( | ||
<Box | ||
height="6" | ||
paddingY="1" | ||
paddingLeft="1.5" | ||
paddingRight="2" | ||
gap="1" | ||
style={{ | ||
background: chainBGColor | ||
}} | ||
borderRadius="xs" | ||
flexDirection="row" | ||
justifyContent="center" | ||
alignItems="center" | ||
width="fit" | ||
> | ||
<Image style={{ width: '14px' }} src={nativeTokenInfo.logoURI} /> | ||
<Text | ||
fontWeight="bold" | ||
fontSize="xsmall" | ||
style={{ | ||
color: chainColor | ||
}} | ||
> | ||
{capitalize(network.title ?? network.name)} | ||
</Text> | ||
</Box> | ||
) | ||
} |
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
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,3 @@ | ||
export const capitalize = (word: string) => { | ||
return word.charAt(0).toUpperCase() + word.slice(1) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.