Skip to content

Commit

Permalink
Feat: unlisted token support (#5)
Browse files Browse the repository at this point in the history
* feat: add unlisted tokens support

* fix: lint

* fix: show unlisted collection even if a verified collection matches address
  • Loading branch information
marthendalnunes authored Apr 3, 2024
1 parent 763d368 commit 32ece43
Show file tree
Hide file tree
Showing 15 changed files with 617 additions and 177 deletions.
2 changes: 1 addition & 1 deletion apps/website/app/(general)/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card } from "@/components/ui/card"
import { FormCreateL2ERC721 } from "@/components/form-create-l2-erc721"
import { FormCreateL2ERC721 } from "@/components/forms/form-create-l2-erc721"
import { LinkComponent } from "@/components/shared/link-component"

export default function CreatePage() {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/app/(general)/mint/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card } from "@/components/ui/card"
import { FormMintERC721 } from "@/components/form-mint-erc721"
import { FormMintERC721 } from "@/components/forms/form-mint-erc721"

export default function MintPage() {
return (
Expand Down
31 changes: 12 additions & 19 deletions apps/website/app/(general)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ import { LinkComponent } from "@/components/shared/link-component"
export default function HomePage() {
const [selectedTokenL1, setSelectedTokenL1] = useState<{
localToken: string
remoteToken: string
tokenId: string
name: string
logoURI: string
destinationNetwork: string
}>()
const [selectedTokenL2, setSelectedTokenL2] = useState<{
localToken: string
remoteToken: string
tokenId: string
name: string
logoURI: string
sourceNetwork: string
}>()

Expand Down Expand Up @@ -87,16 +93,9 @@ export default function HomePage() {
appMode={appMode}
localToken={selectedTokenL1.localToken as Address}
tokenId={selectedTokenL1.tokenId}
destinationNetwork={selectedTokenL1?.destinationNetwork}
remoteToken={
tokenList.tokens.find(
({ address }) =>
address.toLowerCase() ===
selectedTokenL1.localToken.toLowerCase()
)?.extensions?.bridgeInfo?.[
selectedTokenL1?.destinationNetwork
]?.tokenAddress as Address
}
remoteToken={selectedTokenL1.remoteToken as Address}
name={selectedTokenL1.name}
logoURI={selectedTokenL1.logoURI}
l2ChainId={Number(selectedTokenL1?.destinationNetwork)}
l1ERC721BridgeAddress={
l2NetworksOptions[appMode][
Expand Down Expand Up @@ -128,15 +127,9 @@ export default function HomePage() {
localToken={selectedTokenL2.localToken as Address}
tokenId={selectedTokenL2.tokenId}
sourceNetwork={selectedTokenL2?.sourceNetwork}
remoteToken={
tokenList.tokens.find(
(token) =>
token?.extensions?.bridgeInfo?.[
selectedTokenL2.sourceNetwork
]?.tokenAddress.toLowerCase() ===
selectedTokenL2.localToken.toLowerCase()
)?.address as Address
}
remoteToken={selectedTokenL2.remoteToken as Address}
name={selectedTokenL2.name}
logoURI={selectedTokenL2.logoURI}
l2ERC721BridgeAddress={
l2NetworksOptions[appMode][
Number(selectedTokenL2?.sourceNetwork)
Expand Down
Loading

0 comments on commit 32ece43

Please sign in to comment.