-
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
33ab3cb
commit 22f1574
Showing
20 changed files
with
391 additions
and
60 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,39 @@ | ||
import React, { ReactElement } from "react" | ||
import { useTranslation } from "react-i18next" | ||
import LedgerContinueButton from "./LedgerContinueButton" | ||
import LedgerPanelContainer from "./LedgerPanelContainer" | ||
import LedgerMenuProtocolList from "../LedgerMenu/LedgerMenuProtocolList" | ||
|
||
export default function LedgerSelectNetwork({ | ||
onContinue, | ||
}: { | ||
onContinue: () => void | ||
}): ReactElement { | ||
const { t } = useTranslation("translation", { | ||
keyPrefix: "ledger.onboarding.selectLedgerApp", | ||
}) | ||
|
||
return ( | ||
<LedgerPanelContainer | ||
indicatorImageSrc="/images/connect_ledger_indicator_disconnected.svg" | ||
heading={t("initialScreenHeader")} | ||
subHeading={t("subheading")} | ||
> | ||
<div className="box"> | ||
<LedgerMenuProtocolList /> | ||
</div> | ||
<LedgerContinueButton onClick={onContinue}> | ||
{t("continueButton")} | ||
</LedgerContinueButton> | ||
|
||
<style jsx>{` | ||
.box { | ||
margin: 0.5rem 0; | ||
padding: 0.8rem 0.8rem; | ||
border-radius: 4px; | ||
background: var(--hunter-green); | ||
} | ||
`}</style> | ||
</LedgerPanelContainer> | ||
) | ||
} |
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.