Skip to content

Commit

Permalink
fix(ui): change locked screen ui to match the updated styles
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Nov 13, 2023
1 parent 831989d commit 35493d5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 41 deletions.
99 changes: 61 additions & 38 deletions src/app/components/request-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { LeatherButton } from '@app/components/button/button';

import { ErrorLabel } from './error-label';
import { buildEnterKeyEvent } from './link';
import { TwoColumnLayout } from './secret-key/two-column.layout';

const waitingMessages: WaitingMessages = {
'2': 'Verifying password…',
Expand Down Expand Up @@ -51,43 +52,65 @@ export function RequestPassword({ title, caption, onSuccess }: RequestPasswordPr
}, [analytics, startWaitingMessage, stopWaitingMessage, unlockWallet, password, onSuccess]);

return (
<Stack
pb={['space.05', 'unset']}
px={['space.05', 'space.04']}
gap="space.05"
textAlign={['center', 'center']}
margin="auto"
>
<styled.h1 textStyle={['heading.03', 'heading.02']}>{title}</styled.h1>
<styled.p textStyle="body.02">{(isRunning && waitingMessage) || caption}</styled.p>
<Stack gap="space.04">
<Input
autoFocus
_focus={{ border: `2px solid ${token('colors.accent.text-primary')}` }}
borderRadius="10px"
data-testid={SettingsSelectors.EnterPasswordInput}
height="64px"
isDisabled={isRunning}
onChange={(e: FormEvent<HTMLInputElement>) => {
setError('');
setPassword(e.currentTarget.value);
}}
onKeyUp={buildEnterKeyEvent(submit)}
placeholder="Enter your password"
type="password"
value={password}
width="100%"
/>
{error && <ErrorLabel>{error}</ErrorLabel>}
</Stack>
<LeatherButton
data-testid={SettingsSelectors.UnlockWalletBtn}
disabled={isRunning || !!error}
aria-busy={isRunning}
onClick={submit}
>
Continue
</LeatherButton>
</Stack>
<>
<TwoColumnLayout
leftColumn={
<>
<styled.h1
textStyle={['heading.03', 'heading.03', 'heading.03', 'display.02']}
mt="space.00"
mb="space.06"
>
{title}
</styled.h1>
<styled.p textStyle={['label.01', 'heading.05']} mb="space.06">
{(isRunning && waitingMessage) || caption}
</styled.p>
</>
}
rightColumn={
<>
<styled.h2
textStyle="heading.03"
mt="space.02"
mb="space.04"
hideBelow="sm"
textAlign="center"
>
Your password
</styled.h2>
<Stack gap="space.04" alignItems="center">
<Input
autoFocus
_focus={{ border: `2px solid ${token('colors.accent.text-primary')}` }}
borderRadius="10px"
data-testid={SettingsSelectors.EnterPasswordInput}
height="64px"
isDisabled={isRunning}
onChange={(e: FormEvent<HTMLInputElement>) => {
setError('');
setPassword(e.currentTarget.value);
}}
onKeyUp={buildEnterKeyEvent(submit)}
placeholder="Enter your password"
type="password"
value={password}
width="100%"
/>
{error && <ErrorLabel>{error}</ErrorLabel>}
</Stack>
<LeatherButton
data-testid={SettingsSelectors.UnlockWalletBtn}
disabled={isRunning || !!error}
aria-busy={isRunning}
onClick={submit}
mt="space.08"
>
Continue
</LeatherButton>
</>
}
/>
</>
);
}
5 changes: 2 additions & 3 deletions src/app/pages/unlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { closeWindow } from '@shared/utils';
import { useRouteHeader } from '@app/common/hooks/use-route-header';
import { isFullPageMode, isPopupMode } from '@app/common/utils';
import { openIndexPageInNewTab } from '@app/common/utils/open-in-new-tab';
import { CenteredPageContainer } from '@app/components/centered-page-container';
import { Header } from '@app/components/header';
import { RequestPassword } from '@app/components/request-password';
import { useNewBrandApprover } from '@app/store/settings/settings.selectors';
Expand All @@ -35,7 +34,7 @@ export function Unlock() {
const handleSuccess = () => navigate(RouteUrls.Home);

return (
<CenteredPageContainer>
<>
{/* Hide the logo when user hasn't consented yet */}
{!hasApprovedNewBrand && (
<Box position="fixed" w="200px" h="60px" background="brown.2" top={0} left={0} />
Expand All @@ -47,6 +46,6 @@ export function Unlock() {
onSuccess={handleSuccess}
/>
<Outlet />
</CenteredPageContainer>
</>
);
}

0 comments on commit 35493d5

Please sign in to comment.