-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: begin implementing import approval steps
- Loading branch information
Showing
4 changed files
with
89 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Heading, ProgressIndicator, Stack } from "@namada/components"; | ||
|
||
type LedgerApprovalStepProps = { | ||
currentApprovalStep: number; | ||
}; | ||
|
||
export const LedgerApprovalStep = ({ | ||
currentApprovalStep, | ||
}: LedgerApprovalStepProps): JSX.Element => { | ||
const stepText = [ | ||
"Deriving Bip44 public key...", | ||
"Deriving Zip32 Viewing Key... This could take a few seconds!", | ||
"Deriving Zip32 Proof-Generation Key... This could take a few seconds!", | ||
]; | ||
|
||
// Ensure that steps are within stepText limits | ||
const totalSteps = stepText.length; | ||
const currentStep = Math.min(Math.max(currentApprovalStep, 1), totalSteps); | ||
|
||
return ( | ||
<Stack gap={1} className="bg-black w-full p-4 rounded-md min-h-[240px]"> | ||
<Stack direction="horizontal" className="flex"> | ||
<span className="flex-none"> | ||
<ProgressIndicator | ||
keyName="ledger-import" | ||
totalSteps={totalSteps} | ||
currentStep={currentStep} | ||
/> | ||
</span> | ||
<span className="flex-1 text-white font-medium text-right"> | ||
Approval {currentStep}/{totalSteps} | ||
</span> | ||
</Stack> | ||
<Heading | ||
level="h2" | ||
className="text-base text-center text-white font-medium" | ||
> | ||
Please wait for Ledger to respond! | ||
</Heading> | ||
<p className="font-medium text-yellow text-base text-center px-12"> | ||
{stepText[currentStep - 1]} | ||
</p> | ||
</Stack> | ||
); | ||
}; |
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