-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c427db
commit 512dc72
Showing
15 changed files
with
401 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { ReactElement } from "react" | ||
|
||
interface Props { | ||
networkName: string | ||
} | ||
|
||
export default function EcosystemNetworkIcon(props: Props): ReactElement { | ||
const { networkName } = props | ||
|
||
return ( | ||
<span className="icon_child"> | ||
<style jsx> | ||
{` | ||
.icon_child { | ||
margin-right: 2px; | ||
background: url("./images/networks/${networkName | ||
.replaceAll(" ", "") | ||
.toLowerCase()}@2x.png"); | ||
background-size: cover; | ||
width: 12px; | ||
height: 12px; | ||
} | ||
`} | ||
</style> | ||
</span> | ||
) | ||
} |
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,52 @@ | ||
import React, { ReactElement } from "react" | ||
import { | ||
ARBITRUM_ONE, | ||
ETHEREUM, | ||
OPTIMISM, | ||
AVALANCHE, | ||
BINANCE_SMART_CHAIN, | ||
POLYGON, | ||
ROOTSTOCK, | ||
} from "@tallyho/tally-background/constants" | ||
import { sameNetwork } from "@tallyho/tally-background/networks" | ||
import { selectCurrentNetwork } from "@tallyho/tally-background/redux-slices/selectors" | ||
import { useBackgroundSelector } from "../../hooks" | ||
import LedgerMenuProtocolListItem from "./LedgerMenuProtocolListItem" | ||
|
||
const LEDGER_APPS = [ | ||
{ | ||
network: ETHEREUM, | ||
ecosystem: [OPTIMISM, ARBITRUM_ONE], | ||
}, | ||
{ | ||
network: POLYGON, | ||
}, | ||
{ | ||
network: ROOTSTOCK, | ||
}, | ||
{ | ||
network: AVALANCHE, | ||
}, | ||
{ | ||
network: BINANCE_SMART_CHAIN, | ||
}, | ||
] | ||
|
||
export default function LedgerMenuProtocolList(): ReactElement { | ||
const currentNetwork = useBackgroundSelector(selectCurrentNetwork) | ||
|
||
return ( | ||
<div className="standard_width_padded center_horizontal"> | ||
<ul> | ||
{LEDGER_APPS.map((info) => ( | ||
<LedgerMenuProtocolListItem | ||
isSelected={sameNetwork(currentNetwork, info.network)} | ||
key={info.network.name} | ||
network={info.network} | ||
ecosystem={info.ecosystem} | ||
/> | ||
))} | ||
</ul> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.