-
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 0cb729d
Showing
14 changed files
with
358 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
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: 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.