-
Notifications
You must be signed in to change notification settings - Fork 393
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
10cba2f
commit fdd260a
Showing
12 changed files
with
352 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { ReactElement } from "react" | ||
import { EVMNetwork } from "@tallyho/tally-background/networks" | ||
|
||
interface Props { | ||
network: EVMNetwork | ||
} | ||
|
||
export default function EcosystemNetworkIcon(props: Props): ReactElement { | ||
const { network } = props | ||
|
||
return ( | ||
<span className="icon_child"> | ||
<style jsx> | ||
{` | ||
.icon_child { | ||
margin-right: 2px; | ||
background: url("./images/networks/${network.name | ||
.replaceAll(" ", "") | ||
.toLowerCase()}@2x.png"); | ||
background-size: cover; | ||
width: 15px; | ||
height: 15px; | ||
} | ||
`} | ||
</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,49 @@ | ||
import React, { ReactElement } from "react" | ||
import { | ||
ARBITRUM_ONE, | ||
ETHEREUM, | ||
OPTIMISM, | ||
POLYGON, | ||
ROOTSTOCK, | ||
} from "@tallyho/tally-background/constants" | ||
import { FeatureFlags, isEnabled } from "@tallyho/tally-background/features" | ||
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 ledgerApps = [ | ||
{ | ||
network: ETHEREUM, | ||
ecosystem: [OPTIMISM, ARBITRUM_ONE], | ||
}, | ||
{ | ||
network: POLYGON, | ||
}, | ||
...(isEnabled(FeatureFlags.SUPPORT_RSK) | ||
? [ | ||
{ | ||
network: ROOTSTOCK, | ||
}, | ||
] | ||
: []), | ||
] | ||
|
||
export default function LedgerMenuProtocolList(): ReactElement { | ||
const currentNetwork = useBackgroundSelector(selectCurrentNetwork) | ||
|
||
return ( | ||
<div className="standard_width_padded center_horizontal"> | ||
<ul> | ||
{ledgerApps.map((info) => ( | ||
<LedgerMenuProtocolListItem | ||
isSelected={sameNetwork(currentNetwork, info.network)} | ||
key={info.network.name} | ||
network={info.network} | ||
ecosystem={info.ecosystem} | ||
/> | ||
))} | ||
</ul> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.