-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: address onboarding UI deviations (#24)
Signed-off-by: ryanml <[email protected]> Co-authored-by: vvava <[email protected]> Co-authored-by: bferenc <[email protected]> Co-authored-by: Viktor Vasas <[email protected]>
- Loading branch information
1 parent
26399f6
commit ce79553
Showing
6 changed files
with
127 additions
and
68 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
90 changes: 90 additions & 0 deletions
90
src/pages/Onboarding/pages/Seedless/components/ExistingWalletOptions.tsx
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,90 @@ | ||
import { | ||
Stack, | ||
Typography, | ||
ShieldLockIcon, | ||
LedgerIcon, | ||
KeystoneIcon, | ||
ArrowLeftIconV2, | ||
} from '@avalabs/core-k2-components'; | ||
import { forwardRef, ForwardedRef } from 'react'; | ||
import { useHistory } from 'react-router-dom'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useFeatureFlagContext } from '@src/contexts/FeatureFlagsProvider'; | ||
import { FeatureGates } from '@src/background/services/featureFlags/models'; | ||
import { OnboardingURLs } from '@src/background/services/onboarding/models'; | ||
import { Overlay } from '@src/components/common/Overlay'; | ||
import { ExistingWalletButton } from './ExistingWalletButton'; | ||
|
||
type ExistingWalletOptionsProps = { | ||
setShowExistingWalletOption: (open: boolean) => void; | ||
}; | ||
|
||
export const ExistingWalletOptions = forwardRef(function ExistingWalletOptions( | ||
{ setShowExistingWalletOption }: ExistingWalletOptionsProps, | ||
ref: ForwardedRef<HTMLDivElement> | ||
) { | ||
const history = useHistory(); | ||
const { t } = useTranslation(); | ||
const { featureFlags } = useFeatureFlagContext(); | ||
|
||
return ( | ||
<Overlay | ||
sx={{ | ||
backgroundColor: 'rgba(17, 17, 17, 0.75)', | ||
}} | ||
> | ||
<Stack | ||
ref={ref} | ||
sx={{ | ||
width: 480, | ||
alignItems: 'flex-start', | ||
rowGap: 5, | ||
position: 'fixed', | ||
top: 90, | ||
}} | ||
> | ||
<ArrowLeftIconV2 | ||
sx={{ cursor: 'pointer', width: 19, height: 14 }} | ||
onClick={() => { | ||
setShowExistingWalletOption(false); | ||
}} | ||
/> | ||
<Typography variant="h3" sx={{ textAlign: 'left' }}> | ||
{t('How would you like to access your existing wallet?')} | ||
</Typography> | ||
<Stack> | ||
<Stack sx={{ flexDirection: 'row', columnGap: 3, pb: 3 }}> | ||
<ExistingWalletButton | ||
data-testid="access-with-seed-phrase" | ||
icon={<ShieldLockIcon size={30} />} | ||
text={t('Enter recovery phrase')} | ||
onClick={() => { | ||
history.push(OnboardingURLs.SEED_PHRASE); | ||
}} | ||
/> | ||
<ExistingWalletButton | ||
data-testid="access-with-ledger" | ||
icon={<LedgerIcon size={30} />} | ||
text={t('Add using Ledger')} | ||
onClick={() => { | ||
history.push(OnboardingURLs.LEDGER); | ||
}} | ||
/> | ||
</Stack> | ||
{featureFlags[FeatureGates.KEYSTONE] && ( | ||
<Stack sx={{ flexDirection: 'row' }}> | ||
<ExistingWalletButton | ||
data-testid="access-with-seed-keystone" | ||
icon={<KeystoneIcon size={30} />} | ||
text={t('Add using Keystone')} | ||
onClick={() => { | ||
history.push(OnboardingURLs.KEYSTONE); | ||
}} | ||
/> | ||
</Stack> | ||
)} | ||
</Stack> | ||
</Stack> | ||
</Overlay> | ||
); | ||
}); |
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 |
---|---|---|
|
@@ -91,10 +91,10 @@ | |
dependencies: | ||
"@avalabs/core-utils-sdk" "^3.0.0" | ||
|
||
"@avalabs/[email protected].44": | ||
version "4.18.0-alpha.44" | ||
resolved "https://registry.yarnpkg.com/@avalabs/core-k2-components/-/core-k2-components-4.18.0-alpha.44.tgz#8daf2d8ab28cc5491adbb11d36201ec91dfc4bce" | ||
integrity sha512-2oIg1SsJ7dGedpxoezOPMTJbIcMK4s+P8fu9ba6Q3ZskjhX5OJizv42H4orvQyCb5RXgN2FvxYkft6FSufNiqA== | ||
"@avalabs/[email protected].47": | ||
version "4.18.0-alpha.47" | ||
resolved "https://registry.yarnpkg.com/@avalabs/core-k2-components/-/core-k2-components-4.18.0-alpha.47.tgz#94d588cf109350fe57d246dbf36bc127a1fc0584" | ||
integrity sha512-eXgd3mgHJKHyQRGHxcQV4MJBzJT0Orr+w2xrWZ1M9dGcQBTGbOxQ5h0Y/TPRkUXrP8SVhonEM2ACX8YTSTbKDA== | ||
dependencies: | ||
"@emotion/react" "11.11.1" | ||
"@emotion/styled" "11.11.0" | ||
|