-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: improve extension in-tab view (#988)
* Improve extension in-tab view * Update Overlay component and add delays in e2e tests The Overlay component's position and size properties were adjusted to fit its new design requirements. The width is now fixed, and it is centered using transform. Meanwhile, explicit delays were added in the end-to-end tests for 'buy-cspr.spec.ts' to ensure proper closing of modal windows before continuing with the tests.
- Loading branch information
Showing
21 changed files
with
644 additions
and
496 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
44 changes: 44 additions & 0 deletions
44
src/apps/import-account-with-file/pages/import-account-with-file-failure/content.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,44 @@ | ||
import React from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
|
||
import { useTypedLocation } from '@import-account-with-file/router'; | ||
|
||
import { | ||
ContentContainer, | ||
IllustrationContainer, | ||
ParagraphContainer, | ||
SpacingSize | ||
} from '@libs/layout'; | ||
import { SvgIcon, Typography } from '@libs/ui/components'; | ||
|
||
export function ImportAccountWithFileFailureContentPage() { | ||
const { t } = useTranslation(); | ||
const location = useTypedLocation(); | ||
const state = location.state; | ||
|
||
return ( | ||
<ContentContainer> | ||
<IllustrationContainer> | ||
<SvgIcon | ||
src="assets/illustrations/error.svg" | ||
width={200} | ||
height={120} | ||
/> | ||
</IllustrationContainer> | ||
<ParagraphContainer top={SpacingSize.XL}> | ||
<Typography type="header"> | ||
<Trans t={t}>Something went wrong</Trans> | ||
</Typography> | ||
</ParagraphContainer> | ||
<ParagraphContainer top={SpacingSize.Medium}> | ||
<Typography type="body" color="contentSecondary"> | ||
{state?.importAccountStatusMessage | ||
? state.importAccountStatusMessage | ||
: t( | ||
': We couldn’t import your account. Please confirm that you’re importing a file containing your secret key (not to be confused with your public key).' | ||
)} | ||
</Typography> | ||
</ParagraphContainer> | ||
</ContentContainer> | ||
); | ||
} |
69 changes: 23 additions & 46 deletions
69
src/apps/import-account-with-file/pages/import-account-with-file-failure/index.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 |
---|---|---|
@@ -1,60 +1,37 @@ | ||
import React from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
|
||
import { | ||
RouterPath, | ||
useTypedLocation, | ||
useTypedNavigate | ||
} from '@import-account-with-file/router'; | ||
import { RouterPath, useTypedNavigate } from '@import-account-with-file/router'; | ||
|
||
import { closeCurrentWindow } from '@background/close-current-window'; | ||
|
||
import { | ||
ContentContainer, | ||
FooterButtonsAbsoluteContainer, | ||
IllustrationContainer, | ||
ParagraphContainer, | ||
SpacingSize | ||
FooterButtonsContainer, | ||
HeaderPopup, | ||
LayoutWindow | ||
} from '@libs/layout'; | ||
import { Button, SvgIcon, Typography } from '@libs/ui/components'; | ||
import { Button } from '@libs/ui/components'; | ||
|
||
import { ImportAccountWithFileFailureContentPage } from './content'; | ||
|
||
export function ImportAccountWithFileFailureContentPage() { | ||
export const ImportAccountWithFileFailurePage = () => { | ||
const { t } = useTranslation(); | ||
const navigate = useTypedNavigate(); | ||
const location = useTypedLocation(); | ||
const state = location.state; | ||
|
||
return ( | ||
<ContentContainer> | ||
<IllustrationContainer> | ||
<SvgIcon | ||
src="assets/illustrations/error.svg" | ||
width={200} | ||
height={120} | ||
/> | ||
</IllustrationContainer> | ||
<ParagraphContainer top={SpacingSize.XL}> | ||
<Typography type="header"> | ||
<Trans t={t}>Something went wrong</Trans> | ||
</Typography> | ||
</ParagraphContainer> | ||
<ParagraphContainer top={SpacingSize.Medium}> | ||
<Typography type="body" color="contentSecondary"> | ||
{state?.importAccountStatusMessage | ||
? state.importAccountStatusMessage | ||
: t( | ||
': We couldn’t import your account. Please confirm that you’re importing a file containing your secret key (not to be confused with your public key).' | ||
)} | ||
</Typography> | ||
</ParagraphContainer> | ||
<FooterButtonsAbsoluteContainer> | ||
<Button onClick={() => navigate(RouterPath.ImportAccountWithFile)}> | ||
<Trans t={t}>Try to import again</Trans> | ||
</Button> | ||
<Button color="secondaryBlue" onClick={() => closeCurrentWindow()}> | ||
<Trans t={t}>Maybe later</Trans> | ||
</Button> | ||
</FooterButtonsAbsoluteContainer> | ||
</ContentContainer> | ||
<LayoutWindow | ||
renderHeader={() => <HeaderPopup />} | ||
renderContent={() => <ImportAccountWithFileFailureContentPage />} | ||
renderFooter={() => ( | ||
<FooterButtonsContainer> | ||
<Button onClick={() => navigate(RouterPath.ImportAccountWithFile)}> | ||
<Trans t={t}>Try to import again</Trans> | ||
</Button> | ||
<Button color="secondaryBlue" onClick={() => closeCurrentWindow()}> | ||
<Trans t={t}>Maybe later</Trans> | ||
</Button> | ||
</FooterButtonsContainer> | ||
)} | ||
/> | ||
); | ||
} | ||
}; |
39 changes: 39 additions & 0 deletions
39
src/apps/import-account-with-file/pages/import-account-with-file-success/content.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,39 @@ | ||
import React from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
|
||
import { | ||
ContentContainer, | ||
IllustrationContainer, | ||
ParagraphContainer, | ||
SpacingSize | ||
} from '@libs/layout'; | ||
import { SvgIcon, Typography } from '@libs/ui/components'; | ||
|
||
export function ImportAccountWithFileSuccessContentPage() { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<ContentContainer> | ||
<IllustrationContainer> | ||
<SvgIcon | ||
src="assets/illustrations/account-imported.svg" | ||
width={200} | ||
height={120} | ||
/> | ||
</IllustrationContainer> | ||
<ParagraphContainer top={SpacingSize.XL}> | ||
<Typography type="header"> | ||
<Trans t={t}>Your account was successfully imported</Trans> | ||
</Typography> | ||
</ParagraphContainer> | ||
<ParagraphContainer top={SpacingSize.Medium}> | ||
<Typography type="body" color="contentSecondary"> | ||
<Trans t={t}> | ||
Imported accounts are distinguished by an ‘IMPORTED’ icon in the | ||
account lists. | ||
</Trans> | ||
</Typography> | ||
</ParagraphContainer> | ||
</ContentContainer> | ||
); | ||
} |
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.