-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create connect ledger component
- Loading branch information
1 parent
8de28a1
commit e0d1905
Showing
14 changed files
with
216 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { FC } from 'react'; | ||
import { Box, Flex, CheckmarkCircleIcon } from '@blockstack/ui'; | ||
|
||
import { LedgerConnectStep } from '../../pages/onboarding'; | ||
import { LedgerStepText } from './ledger-step-text'; | ||
|
||
interface LedgerConnectInstructions { | ||
step: LedgerConnectStep; | ||
} | ||
|
||
export const LedgerConnectInstructions: FC<LedgerConnectInstructions> = ({ step }) => { | ||
const hasConnected = (step: LedgerConnectStep) => step > LedgerConnectStep.Disconnected; | ||
const hasOpenedApp = (step: LedgerConnectStep) => step > LedgerConnectStep.ConnectedAppClosed; | ||
const hasAddress = (step: LedgerConnectStep) => step === LedgerConnectStep.HasAddress; | ||
|
||
return ( | ||
<Box border="1px solid #F0F0F5" mt="extra-loose" borderRadius="8px"> | ||
<Flex height="56px" alignItems="center" px="extra-loose" borderBottom="1px solid #F0F0F5"> | ||
<LedgerStepText step={LedgerConnectStep.Disconnected}>Connect your Ledger</LedgerStepText> | ||
{hasConnected(step) && <CheckmarkCircleIcon color="blue" size="16px" ml="tight" />} | ||
</Flex> | ||
<Flex height="56px" alignItems="center" px="extra-loose" borderBottom="1px solid #F0F0F5"> | ||
<LedgerStepText step={LedgerConnectStep.ConnectedAppClosed}> | ||
Open the Stacks app | ||
</LedgerStepText> | ||
{hasOpenedApp(step) && <CheckmarkCircleIcon color="blue" size="16px" ml="tight" />} | ||
</Flex> | ||
<Flex height="56px" alignItems="center" px="extra-loose"> | ||
<LedgerStepText step={LedgerConnectStep.ConnectedAppOpen}> | ||
Confirm your Ledger address | ||
</LedgerStepText> | ||
{hasAddress(step) && <CheckmarkCircleIcon color="blue" size="16px" ml="tight" />} | ||
</Flex> | ||
</Box> | ||
); | ||
}; |
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,24 @@ | ||
import React, { FC } from 'react'; | ||
import { Text } from '@blockstack/ui'; | ||
import { LedgerConnectStep } from '../../pages/onboarding/04-connect-ledger/connect-ledger'; | ||
|
||
interface LedgerStepTextProps { | ||
step: LedgerConnectStep; | ||
} | ||
export const LedgerStepText: FC<LedgerStepTextProps> = ({ step, children }) => { | ||
return ( | ||
<> | ||
<Text | ||
color="ink" | ||
fontWeight={500} | ||
mr="base-tight" | ||
display="inline-block" | ||
width="10px" | ||
textAlign="center" | ||
> | ||
{step + 1} | ||
</Text> | ||
{children} | ||
</> | ||
); | ||
}; |
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
Oops, something went wrong.