Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Extension UI Review #645

Merged
merged 22 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0cce310
feat: adding cheatsheet to Storybook and Panel component
pedrorezende Feb 5, 2024
f04cda8
feat: tweaking button sizes and spacements
pedrorezende Feb 5, 2024
2b356ee
feat: ui tweaks on setup Start page
pedrorezende Feb 5, 2024
afb5006
feat: adding div props to alert component
pedrorezende Feb 19, 2024
aa1b965
feat: reviewing warning panel and start page
pedrorezende Feb 6, 2024
d554701
feat: creating badge and feedback button components
pedrorezende Feb 7, 2024
fe828b3
feat: reducing sizes for seed phrase list
pedrorezende Feb 7, 2024
be87295
feat: finalizing seed creation review
pedrorezende Feb 7, 2024
a098363
feat: completing account creation flow review
pedrorezende Feb 21, 2024
b147135
feat: truncating addresses on confirmation
pedrorezende Feb 21, 2024
570ae78
feat: few components ui review
pedrorezende Feb 23, 2024
9a490d5
feat: rolling back bip39 password input
pedrorezende Feb 24, 2024
75f5a7a
feat: fixing ledger import
pedrorezende Feb 24, 2024
5c73c49
feat: fixing ledger forms alignment
pedrorezende Feb 24, 2024
5a1c940
feat: opening setup tab if no password is defined
pedrorezende Feb 24, 2024
bd528c4
feat: improving connected sites ui
pedrorezende Feb 25, 2024
43d136d
feat: improving approve connections ui
pedrorezende Feb 25, 2024
676c87c
feat: better alignment on signature popups
pedrorezende Feb 26, 2024
0561248
feat: few more ui tweaks on extension
pedrorezende Feb 26, 2024
61a779a
feat: refactoring the copyTextTo property to make it more generic
pedrorezende Feb 26, 2024
1e0f826
fix: removing package-lock.json
pedrorezende Feb 28, 2024
8337ebb
feat: renaming colour to color
pedrorezende Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions apps/extension/src/App/Accounts/DeleteAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Alert,
GapPatterns,
Input,
LinkButton,
Loading,
Stack,
} from "@namada/components";
Expand Down Expand Up @@ -84,21 +85,30 @@ export const DeleteAccount = (): JSX.Element => {

return (
<>
<PageHeader title="Delete Keys" />
<Stack
as="form"
onSubmit={handleSubmit}
gap={GapPatterns.TitleContent}
full
>
<Stack gap={GapPatterns.TitleContent} full>
<Stack className="flex-1 justify-center" gap={4} full>
<Stack as="header" gap={4}>
<PageHeader title="Delete Keys" />
<Alert type="warning" title="Alert!">
Make sure that you&apos;ve backed up your seed phrase and private
key.
<p className="mb-4">
Make sure that you&apos;ve backed up your seed phrase and
private key.
</p>
<LinkButton
color="primary"
className="font-bold mt-4 text-sm underline"
href={routes.viewAccountMnemonic(accountId)}
>
Back Up My Wallet
</LinkButton>
</Alert>
</Stack>
<p className="text-white leading-5 text-base font-medium">
<p className="text-white leading-5 text-sm px-2 font-medium mb-10">
After deletion, you will be required to import your seed phrase to
restore your access to it
</p>
Expand All @@ -111,7 +121,7 @@ export const DeleteAccount = (): JSX.Element => {
error={errorMessage}
/>
</Stack>
<ActionButton size="lg" disabled={shouldDisableSubmit}>
<ActionButton size="md" disabled={shouldDisableSubmit}>
Delete Account
</ActionButton>
</Stack>
Expand Down
13 changes: 5 additions & 8 deletions apps/extension/src/App/Accounts/ParentAccounts.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useContext } from "react";
import { useNavigate } from "react-router-dom";
import browser from "webextension-polyfill";

import {
ActionButton,
Expand All @@ -13,6 +12,7 @@ import { PageHeader } from "App/Common";
import routes from "App/routes";
import { ParentAccount } from "background/keyring";
import { AccountContext } from "context";
import { openSetupTab } from "utils";

/**
* Represents the extension's settings page.
Expand All @@ -23,9 +23,7 @@ export const ParentAccounts = (): JSX.Element => {
useContext(AccountContext);

const goToSetupPage = (): void => {
browser.tabs.create({
url: browser.runtime.getURL("setup.html"),
});
openSetupTab();
};

const goToViewAccount = (account: DerivedAccount): void => {
Expand All @@ -46,13 +44,12 @@ export const ParentAccounts = (): JSX.Element => {

return (
<Stack gap={GapPatterns.TitleContent}>
<PageHeader title="Keys Management" />

<PageHeader title="Select Account" />
<Stack gap={4}>
<nav className="grid items-end grid-cols-[auto_min-content]">
<p className="text-white font-medium text-base">Set default keys</p>
<p className="text-white font-medium text-xs">Set default keys</p>
<div className="w-24">
<ActionButton size="xs" onClick={goToSetupPage}>
<ActionButton borderRadius="md" size="xs" onClick={goToSetupPage}>
Add keys
</ActionButton>
</div>
Expand Down
8 changes: 6 additions & 2 deletions apps/extension/src/App/Accounts/RenameAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export const RenameAccount = (): JSX.Element => {
>
<PageHeader title="Rename Key" />
{account && (
<Stack full gap={GapPatterns.FormFields}>
<Stack
className="flex-1 justify-center"
full
gap={GapPatterns.FormFields}
>
<Input readOnly label="Current name" value={account.alias} />
<Input
autoFocus
Expand All @@ -67,7 +71,7 @@ export const RenameAccount = (): JSX.Element => {
/>
</Stack>
)}
{account && <ActionButton size="lg">Rename</ActionButton>}
{account && <ActionButton size="md">Rename</ActionButton>}
</Stack>
);
};
6 changes: 5 additions & 1 deletion apps/extension/src/App/Accounts/ViewAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export const ViewAccount = (): JSX.Element => {
shieldedAccountAddress={shieldedAddress}
/>
</Stack>
<ActionButton size="sm" onClick={() => navigate(-1)}>
<ActionButton
size="md"
borderRadius="md"
onClick={() => navigate(-1)}
>
Back
</ActionButton>
</>
Expand Down
12 changes: 7 additions & 5 deletions apps/extension/src/App/Accounts/ViewMnemonic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const ViewMnemonic = (): JSX.Element => {

{!passwordChecked && (
<>
<Stack full gap={GapPatterns.FormFields}>
<Stack className="mt-12" full gap={GapPatterns.FormFields}>
<Alert type="info">
Please provide your password in order to view your seed phrase
</Alert>
Expand All @@ -85,26 +85,28 @@ export const ViewMnemonic = (): JSX.Element => {
onChange={(e) => setPassword(e.target.value)}
/>
</Stack>
<ActionButton disabled={!password}>Proceed</ActionButton>
<ActionButton type="submit" size="md" disabled={!password}>
Proceed
</ActionButton>
</>
)}

{passwordChecked && (
<>
<Stack full gap={1}>
<Stack className="flex-1 justify-center" full gap={1}>
<div className="text-sm -mt-1.5">
<SeedPhraseInstructions />
</div>
<Input
variant="Textarea"
theme="secondary"
readOnly={true}
value={mnemonic}
sensitive
className="[&_textarea]:rounded-lg [&_textarea]:py-8 [&_textarea]:px-6"
rows={mnemonic.split(" ").length === 24 ? 5 : 3}
/>
</Stack>
<ActionButton size="sm" onClick={() => navigate(-1)}>
<ActionButton size="md" onClick={() => navigate(-1)}>
Back
</ActionButton>
</>
Expand Down
10 changes: 8 additions & 2 deletions apps/extension/src/App/AppContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
HasMaspParamsMsg,
} from "provider/messages";
import { Ports } from "router";
import { openSetupTab } from "utils";
import {
DeleteAccount,
RenameAccount,
Expand Down Expand Up @@ -92,9 +93,14 @@ export const AppContent = (): JSX.Element => {

useEffect(() => {
if (
!passwordInitialized ||
!passwordInitialized &&
accountLoadingStatus === LoadingStatus.Completed
) {
openSetupTab();
return;
}

if (accountLoadingStatus === LoadingStatus.Completed) {
navigate(getStartPage(accounts));
}
}, [accounts, passwordInitialized, accountLoadingStatus]);
Expand All @@ -110,7 +116,7 @@ export const AppContent = (): JSX.Element => {
}, []);

return (
<Stack full gap={6}>
<Stack className="py-5" full gap={6}>
{isDurable === false && (
<Alert type="warning">{STORE_DURABILITY_INFO}</Alert>
)}
Expand Down
54 changes: 22 additions & 32 deletions apps/extension/src/App/Common/AppHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Image } from "@namada/components";
import clsx from "clsx";
import { useVaultContext } from "context";
import { useState } from "react";
Expand Down Expand Up @@ -28,39 +27,30 @@ export const AppHeader = ({

return (
<>
<header>
{returnButton && (
<i
className={clsx(iconsClassList, "left-7")}
onClick={() => navigate(-1)}
>
<GoArrowLeft />
</i>
)}
{returnButton && (
<i
className={clsx(iconsClassList, "left-7")}
onClick={() => navigate(-1)}
>
<GoArrowLeft />
</i>
)}

{lockButton && (
<span
className={clsx(iconsClassList, "left-7")}
onClick={() => lock()}
>
<GoUnlock />
</span>
)}
{lockButton && (
<span className={clsx(iconsClassList, "left-7")} onClick={() => lock()}>
<GoUnlock />
</span>
)}

<div className="max-w-[168px] mx-auto">
<Image imageName="Logo" />
</div>

{settingsButton && (
<i
className={clsx(iconsClassList, "right-7")}
onClick={() => setOpen(true)}
>
<GoGear />
</i>
)}
<AppHeaderNavigation onClose={() => setOpen(false)} open={open} />
</header>
{settingsButton && (
<i
className={clsx(iconsClassList, "right-7")}
onClick={() => setOpen(true)}
>
<GoGear />
</i>
)}
<AppHeaderNavigation onClose={() => setOpen(false)} open={open} />
</>
);
};
6 changes: 1 addition & 5 deletions apps/extension/src/App/Common/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ type PageHeaderProps = {
};

export const PageHeader = ({ title }: PageHeaderProps): JSX.Element => {
return (
<Heading className="text-xl uppercase text-center text-white">
{title}
</Heading>
);
return <Heading className="text-xl text-center text-white">{title}</Heading>;
};
6 changes: 3 additions & 3 deletions apps/extension/src/App/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const Login = ({ onLogin }: LoginProps): JSX.Element => {
return (
<Stack
as="form"
className="py-6"
gap={GapPatterns.TitleContent}
onSubmit={handleSubmit}
full
Expand All @@ -57,16 +58,15 @@ export const Login = ({ onLogin }: LoginProps): JSX.Element => {
<Image
styleOverrides={{
flex: 1,
width: "100%",
maxWidth: "60%",
width: "220px",
margin: "0 auto",
}}
imageName="LogoMinimal"
/>
</div>
<Stack gap={2} full>
<Heading className="text-lg text-center text-white">
Enter your password to unlock
Enter your password
</Heading>
<Input
autoFocus={true}
Expand Down
8 changes: 3 additions & 5 deletions apps/extension/src/App/Settings/ChangePassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
ActionButton,
Alert,
GapPatterns,
Heading,
Input,
Stack,
} from "@namada/components";
import { PageHeader } from "App/Common";
import { ResetPasswordError } from "background/vault";
import { useVaultContext } from "context";

Expand Down Expand Up @@ -78,10 +78,8 @@ export const ChangePassword = ({
onSubmit={handleSubmit}
full
>
<Heading className="uppercase text-2xl text-center text-white">
Change Password
</Heading>
<Stack full gap={GapPatterns.FormFields}>
<PageHeader title="Change Password" />
<Stack className="justify-center" full gap={GapPatterns.FormFields}>
<Input
label="Current password"
variant="Password"
Expand Down
Loading
Loading