-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What This PR implements flow of exporting mnemonics. - adding menu option and slideup for exporting mnemonics - handling both short and long mnemonics Improvements: - code cleanup and improvements - fixing small visual bugs - making export slideups bigger - hiding unnecessary locked wallet snackbar ### Testing - go through both flows - mnemonic export and private keys export ### Known problems - the blur over the mnemonic is buggy in chrome, part of the blur that is not initially visible inside the viewport may not be blurred. Will be resolved later. ![image](https://user-images.githubusercontent.com/20949277/230622272-2dc46f8a-37c4-48c5-9370-8bde36733fbf.png)![image](https://user-images.githubusercontent.com/20949277/230622371-b16f4383-164c-4ec2-89b3-48f42c80ca31.png) Latest build: [extension-builds-3259](https://github.com/tahowallet/extension/suites/12131636841/artifacts/639590688) (as of Mon, 10 Apr 2023 12:54:22 GMT).
- Loading branch information
Showing
19 changed files
with
702 additions
and
261 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 was deleted.
Oops, something went wrong.
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,61 @@ | ||
import React, { ReactElement, useState } from "react" | ||
import SharedButton from "../Shared/SharedButton" | ||
import SharedCheckbox from "../Shared/SharedCheckbox" | ||
|
||
export default function ConfirmReveal({ | ||
description, | ||
invalidMessage, | ||
confirmButton, | ||
onConfirm, | ||
}: { | ||
description: string | ||
invalidMessage: string | ||
confirmButton: string | ||
onConfirm: () => void | ||
}): ReactElement { | ||
const [showInvalidMessage, setShowInvalidMessage] = useState(false) | ||
const [isConfirmed, setIsConfirmed] = useState(false) | ||
|
||
return ( | ||
<> | ||
<div className="confirmation_container"> | ||
<SharedCheckbox | ||
label={description} | ||
message={invalidMessage} | ||
value={isConfirmed} | ||
invalid={showInvalidMessage && !isConfirmed} | ||
onChange={(value) => { | ||
setIsConfirmed(value) | ||
setShowInvalidMessage(false) | ||
}} | ||
/> | ||
<div> | ||
<SharedButton | ||
type="primary" | ||
size="medium" | ||
isDisabled={!isConfirmed} | ||
hideEvents={false} | ||
onClick={() => { | ||
if (isConfirmed) { | ||
onConfirm() | ||
} else { | ||
setShowInvalidMessage(true) | ||
} | ||
}} | ||
> | ||
{confirmButton} | ||
</SharedButton> | ||
</div> | ||
</div> | ||
<style jsx>{` | ||
.confirmation_container { | ||
height: 175px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
margin-top: 16px; | ||
} | ||
`}</style> | ||
</> | ||
) | ||
} |
Oops, something went wrong.