Skip to content

Commit

Permalink
fix: remove unsupported networks from ui (#156)
Browse files Browse the repository at this point in the history
* remove unsupported networks from ui;

Signed-off-by: tcar <tcar121293@gmail.com>

* chore: clean testnet workflow file removing unsused explorer urls

---------

Signed-off-by: tcar <tcar121293@gmail.com>
Co-authored-by: Nicolás Riquelme Guzmán <nrriquelme@gmail.com>
  • Loading branch information
tcar121293 and wainola authored Feb 20, 2024
1 parent aa60682 commit b3267ae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cf-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
VITE_INDEXER_URL: "https://api.test.buildwithsygma.com"
VITE_SHARED_CONFIG_URL: "https://chainbridge-assets-stage.s3.us-east-2.amazonaws.com/shared-config-test.json"
VITE_EXPLORER_URLS: '[{ "id": 1, "url": "https://goerli.etherscan.io" }, { "id": 2, "url": "https://sepolia.etherscan.io" }, {"id": 3, "url": "https://cloudflare-ipfs.com/ipns/dotapps.io/?rpc=wss%3A%2F%2Fsubbridge-test.phala.network%2Frhala%2Fws#/explorer" }, { "id": 4, "url": "https://base-goerli.blockscout.com" }, { "id": 5, "url": "https://explorer.cronos.org/testnet" }, { "id": 6, "url": "https://holesky.etherscan.io"}, { "id": 7, "url": "https://mumbai.polygonscan.com" }, { "id": 8, "url": "https://sepolia.arbiscan.io" }, { "id": 9, "url": "https://gnosis-chiado.blockscout.com" }]'
VITE_EXPLORER_URLS: '[{ "id": 2, "url": "https://sepolia.etherscan.io" }, {"id": 3, "url": "https://cloudflare-ipfs.com/ipns/dotapps.io/?rpc=wss%3A%2F%2Fsubbridge-test.phala.network%2Frhala%2Fws#/explorer" }, { "id": 5, "url": "https://explorer.cronos.org/testnet" }, { "id": 6, "url": "https://holesky.etherscan.io"}, { "id": 7, "url": "https://mumbai.polygonscan.com" }, { "id": 8, "url": "https://sepolia.arbiscan.io" }, { "id": 9, "url": "https://gnosis-chiado.blockscout.com" }]'
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
Expand Down
3 changes: 2 additions & 1 deletion src/components/ExplorerTable/ExplorerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
formatAmountDecimals,
renderAmountValue,
renderFormatedConvertedAmount,
filterTransfers,
} from "../../utils/Helpers"
import { useStyles } from "./styles"

Expand Down Expand Up @@ -140,7 +141,7 @@ const ExplorerTable: React.FC<ExplorerTable> = ({ state, sharedConfig }: Explore
<TableCell sx={{ borderTopRightRadius: "12px !important" }}>Value</TableCell>
</TableRow>
</TableHead>
{state.isLoading === "done" && <TableBody>{renderTransferList(state.transfers)}</TableBody>}
{state.isLoading === "done" && <TableBody>{renderTransferList(filterTransfers(state.transfers, sharedConfig))}</TableBody>}
{state.isLoading === "loading" && (
<TableBody>
<TableRow>
Expand Down
15 changes: 15 additions & 0 deletions src/utils/Helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,18 @@ export const accountLinks = (type: DomainTypes, accountId: string, domainExplore
return ""
}
}

export const filterTransfers = (transfers: Transfer[], sharedConfig: SharedConfigDomain[]) => {

return transfers.filter((transfer) => {
const { fromDomainId, toDomainId } = transfer

const fromDomainInfo = getDomainData(fromDomainId, sharedConfig)
const toDomainInfo = getDomainData(toDomainId, sharedConfig)
if(!fromDomainInfo || !toDomainInfo) {
return
}

return transfer
})
}

0 comments on commit b3267ae

Please sign in to comment.