-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: pre prod cleanup * fix: package types * fix: package structure * fix: components generations * fix: package version * fix: deploy
- Loading branch information
Showing
598 changed files
with
1,301 additions
and
1,798 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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Icons | ||
|
||
**Do not edit these files directly.** They are automatically generated by the `generate.ts` and `generateChains.ts` script located in the `scripts` directory and are intended for use in the published packages. | ||
**Do not edit these files directly.** They are automatically generated by the `generate.ts` and `generateChains.ts` scripts located in the `scripts` directory and are intended for use in the published packages. |
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 |
---|---|---|
@@ -1,22 +1,38 @@ | ||
"use client"; | ||
|
||
import React, { Suspense } from "react"; | ||
|
||
import { ChainType } from "./types"; | ||
import { getChainName } from "./utils"; | ||
import { capitalize } from "./utils/capitalize"; | ||
import { getChainName } from "./utils/getChainName"; | ||
|
||
/** | ||
* Renders a chain icon specified by chainId. | ||
*/ | ||
export const ChainIcon = ({ chainId }: { chainId: number }) => { | ||
export const ChainIcon = ({ chainId }: Pick<ChainType, "chainId">) => { | ||
const chainName = getChainName({ chainId }); | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const Icon = require( | ||
`./components/chains/Icon${capitalize(chainName.replace(/\s/g, "").toLowerCase())}`, | ||
)?.default; | ||
return <Icon />; | ||
const Icon = React.lazy( | ||
() => | ||
import( | ||
`./components/chains/Icon${capitalize(chainName.replace(/\s/g, "").toLowerCase())}` | ||
), | ||
); | ||
return ( | ||
// TODO: need think about fallback | ||
<Suspense fallback={<div />}> | ||
<Icon /> | ||
</Suspense> | ||
); | ||
} catch (e) { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const UnknownIcon = require(`./components/IconUnknownFull`).default; | ||
return <UnknownIcon />; | ||
const UnknownIcon = React.lazy( | ||
() => import(`./components/IconUnknownFull`), | ||
); | ||
return ( | ||
// TODO: need think about fallback | ||
<Suspense fallback={<div />}> | ||
<UnknownIcon /> | ||
</Suspense> | ||
); | ||
} | ||
}; |
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
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
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.