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

fix: overflow X scroll issue #1693

Merged
merged 58 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4d9e51c
feat: add handWave.gif
AMIRKHANEF Dec 25, 2024
f4b797f
feat: add logoTransparent and Item1
AMIRKHANEF Dec 25, 2024
8e18963
feat: create ActionButton
AMIRKHANEF Dec 25, 2024
e2e99f7
feat: create Carousel
AMIRKHANEF Dec 25, 2024
85738a5
feat: create GradientBox
AMIRKHANEF Dec 25, 2024
eab01d8
feat: create GradientButton
AMIRKHANEF Dec 25, 2024
7cce3dd
feat: create GradientDivider
AMIRKHANEF Dec 25, 2024
3a4b732
refactor: add created components
AMIRKHANEF Dec 25, 2024
a714021
feat: create GradientBox
AMIRKHANEF Dec 25, 2024
be70457
feat: add new font OdibeeSans-Regular
AMIRKHANEF Dec 25, 2024
83b1dcd
feat: increase extension width to 375px
AMIRKHANEF Dec 25, 2024
f0540a5
feat: create WelcomeHeader
AMIRKHANEF Dec 25, 2024
5309390
refactor: add created components
AMIRKHANEF Dec 25, 2024
364e616
feat: create new component LogoDropAnimation
AMIRKHANEF Dec 28, 2024
00bd2fd
style: add gradient
AMIRKHANEF Dec 29, 2024
ee582f4
feat: create ExtensionPopup.tsx
AMIRKHANEF Dec 29, 2024
bf8bdae
refactor: add new components and a new directory
AMIRKHANEF Dec 29, 2024
6e668de
refactor: update components index file
AMIRKHANEF Dec 29, 2024
02bc455
feat: create PrivacyPolicy.tsx
AMIRKHANEF Dec 29, 2024
1320605
feat: create PrivacyPolicy.tsx
AMIRKHANEF Dec 29, 2024
c1953d4
feat: create SelectLanguage.tsx
AMIRKHANEF Dec 29, 2024
42cea26
refactor: update WelcomeHeader.tsx and welcome page
AMIRKHANEF Dec 29, 2024
dec2870
feat: add new package iconsax-react
AMIRKHANEF Dec 29, 2024
fefae2a
style: add check gradient circle
AMIRKHANEF Dec 30, 2024
65082a5
style: polished
AMIRKHANEF Dec 30, 2024
7d00b54
style: add disabled state to gradient button
AMIRKHANEF Dec 30, 2024
7bc2018
refactor: move SelectLanguage and PrivacyPolicy to WelcomeHeader
AMIRKHANEF Dec 30, 2024
c641176
fix: ci issue
AMIRKHANEF Dec 30, 2024
5d8e9d6
fix: closeSquare icon color issue
Nick-1979 Dec 30, 2024
db6a590
fix: inter font issue
Nick-1979 Dec 30, 2024
3131120
style: update ActionButton style
AMIRKHANEF Dec 31, 2024
3c09469
refactor: update GradientButton style
AMIRKHANEF Dec 31, 2024
ba73c7c
refactor: update path
AMIRKHANEF Dec 31, 2024
ff0e03f
style: add hover effect
AMIRKHANEF Dec 31, 2024
8d7aba3
fix: style and disabled issue
AMIRKHANEF Dec 31, 2024
9c03acf
fix: some easing issue
AMIRKHANEF Dec 31, 2024
386a7d6
feat: create Tooltip
AMIRKHANEF Jan 1, 2025
ea9aaaf
refactor: add tooltip to PrivacyPolicy
AMIRKHANEF Jan 1, 2025
0826431
chore: update Copyright 2019-2025
AMIRKHANEF Jan 1, 2025
4abd8ca
feat: add Box.svg
AMIRKHANEF Jan 5, 2025
a19d4ff
refactor: update ActionButton.tsx and GradientBorder.tsx
AMIRKHANEF Jan 5, 2025
575c7f9
style: make LogoMotionDark.gif bg transparent
AMIRKHANEF Jan 5, 2025
7355ada
refactor: add new feat to GradientBox.tsx
AMIRKHANEF Jan 5, 2025
c25f64b
style: update GradientButton.tsx
AMIRKHANEF Jan 5, 2025
3a6707f
feat: create PasswordInput.tsx
AMIRKHANEF Jan 5, 2025
6619983
feat: create Header.tsx
AMIRKHANEF Jan 5, 2025
e06faaa
feat: new login page
AMIRKHANEF Jan 5, 2025
c7ad90d
refactor: add new login page to Loading.tsx
AMIRKHANEF Jan 5, 2025
4efbcf2
fix: some minor issues
AMIRKHANEF Jan 5, 2025
2697f94
chore: update copy right
AMIRKHANEF Jan 5, 2025
4cf61af
style: some small designing adjustment
AMIRKHANEF Jan 5, 2025
c94868f
Merge branch 'new-design' into newDesign
AMIRKHANEF Jan 5, 2025
c16ea68
feat: create NeonButton.tsx
AMIRKHANEF Jan 5, 2025
d5fcd54
feat: create Version.tsx
AMIRKHANEF Jan 5, 2025
878cbc4
style: redesign AskToSetPassword.tsx
AMIRKHANEF Jan 5, 2025
952f1dc
refactor: use Version.tsx component in Login.tsx
AMIRKHANEF Jan 5, 2025
2db5d98
Merge branch 'new-design' into AskToSetPassword
AMIRKHANEF Jan 5, 2025
d8ef304
fix: overflow X scroll problem
AMIRKHANEF Jan 6, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function ExtensionPopup ({ TitleIcon, children, handleClose, openMenu, title }:
<Grid alignItems='center' container item justifyContent='center' sx={{ pb: '12px', pt: '18px' }}>
<CustomCloseSquare color='#AA83DC' onClick={handleClose} size='48' style={{ cursor: 'pointer' }}/>
</Grid>
<Grid alignItems='center' container item justifyContent='center' sx={{ bgcolor: '#1B133C', border: '2px solid', borderColor: '#FFFFFF0D', borderTopLeftRadius: '32px', borderTopRightRadius: '32px', display: 'block', height: 'calc(100% - 78px)', overflow: 'scroll', p: '10px', pb: '10px', position: 'relative' }}>
<Grid alignItems='center' container item justifyContent='center' sx={{ bgcolor: '#1B133C', border: '2px solid', borderColor: '#FFFFFF0D', borderTopLeftRadius: '32px', borderTopRightRadius: '32px', display: 'block', height: 'calc(100% - 78px)', overflow: 'hidden', overflowY: 'scroll', p: '10px', pb: '10px', position: 'relative', width: '100%' }}>
<Grid alignItems='center' columnGap='10px' container item justifyContent='center' p='10px'>
{TitleIcon
? <TitleIcon color='#AA83DC' size={28} variant='Bold' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function GradientBox ({ children, noGradient = false, style }: Props) {

return (
<Container disableGutters sx={ContainerStyle}>
<GradientBorder style={{ top: '-2px'}} />
<GradientBorder style={{ top: '-2px' }} />
<ContentWrapper>
{!noGradient && <RedGradient style={{ top: '-100px' }} />}
<Box position='relative' zIndex={1}>
Expand Down
102 changes: 102 additions & 0 deletions packages/extension-polkagate/src/components/NeonButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Copyright 2019-2025 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0

/* eslint-disable react/jsx-max-props-per-line */

import type { Icon } from 'iconsax-react';

import { Button, useTheme } from '@mui/material';
import React, { useCallback, useMemo, useState } from 'react';

interface Props {
disabled?: boolean;
isBusy?: boolean;
onClick: React.MouseEventHandler<HTMLButtonElement>;
StartIcon?: Icon;
EndIcon?: Icon;
contentPlacement?: 'start' | 'center' | 'end';
text: string | { firstPart?: string; secondPart?: string; };
variant?: 'text' | 'contained' | 'outlined';
style?: React.CSSProperties;
}

export default function NeonButton ({ EndIcon, StartIcon, contentPlacement = 'start', disabled, isBusy, onClick, style, text, variant }: Props): React.ReactElement<Props> {
const theme = useTheme();

const [hovered, setHovered] = useState(false);

const toggleHover = useCallback(() => setHovered((isHovered) => !isHovered), []);

const ButtonFontStyle = useMemo(() => ({
color: hovered ? '#FF4FB9' : '#BEAAD8',
fontFamily: 'Inter',
fontSize: '14px',
fontWeight: 600,
justifyContent: { center: 'center', end: 'flex-end', start: 'flex-start' }[contentPlacement],
textTransform: 'none'
} as React.CSSProperties), [contentPlacement, hovered]);

const GeneralButtonStyle = {
background: 'transparent',
border: '1px solid',
borderColor: hovered ? '#FF4FB9' : '#2D1E4A',
borderRadius: `${style?.borderRadius ?? '12px'}`,
boxShadow: 'unset',
padding: '6px 24px',
transition: 'all 250ms ease-out',
...ButtonFontStyle
};

const StartIconStyle = {
'& .MuiButton-startIcon': {
marginLeft: 0,
marginRight: '10px'
},
'& .MuiButton-startIcon svg': {
color: hovered ? '#FF4FB9' : '#BEAAD8',
transition: 'all 250ms ease-out'
}
};

const EndIconStyle = {
'& .MuiButton-endIcon': {
marginLeft: '5px',
marginRight: 0
},
'& .MuiButton-endIcon svg': {
color: hovered ? '#FF4FB9' : '#BEAAD8',
transition: 'all 250ms ease-out'
}
};

const renderText = useMemo(() => {
if (typeof text === 'string') {
return <span style={{ color: theme.palette.text.primary, ...ButtonFontStyle }}>{text}</span>;
} else {
return (
<>
<span style={{ color: theme.palette.text.secondary, ...ButtonFontStyle }}>{text.firstPart}</span>&nbsp;<span style={{ color: theme.palette.text.primary, ...ButtonFontStyle }}>{text.secondPart}</span>
</>
);
}
}, [ButtonFontStyle, text, theme.palette.text.primary, theme.palette.text.secondary]);

return (
<Button
disabled={disabled || isBusy}
endIcon={EndIcon
? <EndIcon size={20} variant={hovered ? 'Bold' : 'Bulk'} />
: undefined}
onClick={onClick}
onMouseEnter={toggleHover}
onMouseLeave={toggleHover}
startIcon={StartIcon
? <StartIcon size={20} variant={hovered ? 'Bold' : 'Bulk'} />
: undefined}
sx={{ ...GeneralButtonStyle, ...StartIconStyle, ...EndIconStyle, ...style }}
variant={variant}
>
{renderText}
</Button>
);
}
1 change: 1 addition & 0 deletions packages/extension-polkagate/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export { default as Main } from './Main';
export { default as MenuItem } from './MenuItem';
export { default as MnemonicSeed } from './MnemonicSeed';
export { default as Motion } from './Motion';
export { default as NeonButton } from './NeonButton';
export { default as NewAddress } from './NewAddress';
export { default as OnActionToolTip } from './OnActionToolTip';
export { default as OptionalCopyButton } from './OptionalCopyButton';
Expand Down
21 changes: 21 additions & 0 deletions packages/extension-polkagate/src/partials/Version.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2019-2025 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0

/* eslint-disable react/jsx-max-props-per-line */

import { Grid, Typography } from '@mui/material';
import React from 'react';

import { useManifest } from '../hooks';

export default function Version (): React.ReactElement {
const version = useManifest()?.version;

return (
<Grid alignItems='center' container item justifyContent='center'>
<Typography color='#674394' fontFamily='Inter' fontSize='13px' fontWeight={500} lineHeight='18.2px' pt='8px' textAlign='center'>
{'v.'}{version}
</Typography>
</Grid>
);
}
1 change: 1 addition & 0 deletions packages/extension-polkagate/src/partials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export { default as Passwords } from './Passwords';
export { default as RemoteNodeSelectorWithSignals } from './RemoteNodeSelectorWithSignals';
export { default as SubTitle } from './SubTitle';
export { default as ThroughProxy } from './ThroughProxy';
export { default as Version } from './Version';
export { default as WaitScreen } from './WaitScreen';
export { default as WelcomeHeader } from './WelcomeHeader';
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@

/* eslint-disable react/jsx-max-props-per-line */

import { Grid, Typography } from '@mui/material';
import { Box, Container, Grid, Typography } from '@mui/material';
import React, { useCallback } from 'react';

import { PButton } from '../../components';
import { Box as BoxIcon } from '../../assets/icons';
import { ActionButton, GradientBox, GradientButton, NeonButton } from '../../components';
import { setStorage } from '../../components/Loading';
import { useExtensionLockContext } from '../../context/ExtensionLockContext';
import { useTranslation } from '../../hooks';
import { Version } from '../../partials';
import { RedGradient } from '../../style';
import { STEPS } from './constants';
import Header from './Header';

interface Props {
setStep: (value: React.SetStateAction<number | undefined>) => void;
Expand All @@ -36,31 +40,55 @@ function AskToSetPassword ({ setStep }: Props): React.ReactElement {
}, [setStep]);

return (
<Grid alignItems='center' container direction='column' justifyContent='center'>
<Typography fontSize={16} pb='25px'>
{t('Would you like to set a login password?')}
</Typography>
<PButton
_ml={0}
_mt='10px'
_onClick={onYesToSetPassword}
text={t('Yes')}
/>
<PButton
_ml={0}
_mt='10px'
_onClick={onMayBeLater}
_variant='outlined'
text={t('Later')}
/>
<PButton
_ml={0}
_mt='10px'
_onClick={onNoPassword}
_variant='text'
text={t('No')}
/>
</Grid>
<Container disableGutters sx={{ position: 'relative' }}>
<Header />
<GradientBox noGradient style={{ m: 'auto', mt: '8px', width: '359px' }}>
<RedGradient style={{ right: '-8%', top: '20px' }} />
<Grid container item justifyContent='center' sx={{ p: '18px 32px 32px' }}>
<Box
component='img'
src={BoxIcon as string}
sx={{ height: '145px', mt: '20px', width: '140px' }}
/>
<Typography fontFamily='OdibeeSans' fontSize='29px' fontWeight={400} sx={{ mb: '6px', mt: '25px', width: '100%' }} textAlign='center' textTransform='uppercase'>
{t('welcome')}!
</Typography>
<Typography fontFamily='Inter' fontSize='13px' fontWeight={500} sx={{ color: 'text.secondary', width: '100%' }} textAlign='center'>
{t('Would you like to set a login password?')}
</Typography>
<GradientButton
onClick={onYesToSetPassword}
style={{
height: '48px',
marginTop: '24px',
width: '325px'
}}
text={t('Yes')}
/>
<ActionButton
contentPlacement='center'
onClick={onMayBeLater}
style={{
height: '46px',
marginTop: '15px',
width: '325px'
}}
text={{ firstPart: t('Later') }}
/>
<NeonButton
contentPlacement='center'
onClick={onNoPassword}
style={{
height: '44px',
marginTop: '15px',
width: '325px'
}}
text={t('No')}
/>
</Grid>
</GradientBox>
<Version />
</Container>
);
}

Expand Down
94 changes: 45 additions & 49 deletions packages/extension-polkagate/src/popup/passwordManagement/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { ActionButton, GradientBox, GradientButton, PasswordInput } from '../../
import { updateStorage } from '../../components/Loading';
import { useExtensionLockContext } from '../../context/ExtensionLockContext';
import { openOrFocusTab } from '../../fullscreen/accountDetails/components/CommonTasks';
import { useIsExtensionPopup, useManifest, useTranslation } from '../../hooks';
import { useIsExtensionPopup, useTranslation } from '../../hooks';
import { Version } from '../../partials';
import { RedGradient } from '../../style';
import { STEPS } from './constants';
import Header from './Header';
Expand All @@ -26,7 +27,6 @@ interface Props {

function Login ({ setStep }: Props): React.ReactElement {
const { t } = useTranslation();
const version = useManifest()?.version;
const isPopup = useIsExtensionPopup();
// const { isHideNumbers, toggleHideNumbers } = useIsHideNumbers();
const { setExtensionLock } = useExtensionLockContext();
Expand Down Expand Up @@ -69,53 +69,49 @@ function Login ({ setStep }: Props): React.ReactElement {
}, [isPopup, setStep]);

return (
<>
<Container disableGutters sx={{ position: 'relative' }}>
<Header />
<GradientBox noGradient style={{ m: 'auto', mt: '8px', width: '359px' }}>
<RedGradient style={{ right: '-8%', top: '20px' }} />
<Grid container item justifyContent='center' sx={{ p: '18px 32px 32px' }}>
<Box
component='img'
src={BoxIcon as string}
sx={{ height: '145px', mt: '20px', width: '140px' }}
/>
<Typography fontFamily='OdibeeSans' fontSize='29px' fontWeight={400} sx={{ mb: '15px', mt: '25px', width: '100%' }} textAlign='center' textTransform='uppercase'>
{t('login')}
</Typography>
<PasswordInput
onEnterPress={onUnlock}
onPassChange={onPassChange}
title={t('Please enter your password to proceed')}
/>
<GradientButton
contentPlacement='center'
disabled={!hashedPassword}
onClick={onUnlock}
style={{
height: '44px',
marginTop: '24px',
width: '325px'
}}
text={t('Unlock')}
/>
<ActionButton
contentPlacement='center'
onClick={onForgotPassword}
style={{
height: '44px',
marginTop: '18px',
width: '325px'
}}
text={{ firstPart: t('Forgot password') }}
/>
</Grid>
</GradientBox>
<Typography color='#674394' fontFamily='Inter' fontSize='13px' fontWeight={500} lineHeight='18.2px' pt='8px' textAlign='center'>
{'v.'}{version}
</Typography>
</Container>
</>
<Container disableGutters sx={{ position: 'relative' }}>
<Header />
<GradientBox noGradient style={{ m: 'auto', mt: '8px', width: '359px' }}>
<RedGradient style={{ right: '-8%', top: '20px' }} />
<Grid container item justifyContent='center' sx={{ p: '18px 32px 32px' }}>
<Box
component='img'
src={BoxIcon as string}
sx={{ height: '145px', mt: '20px', width: '140px' }}
/>
<Typography fontFamily='OdibeeSans' fontSize='29px' fontWeight={400} sx={{ mb: '15px', mt: '25px', width: '100%' }} textAlign='center' textTransform='uppercase'>
{t('login')}
</Typography>
<PasswordInput
onEnterPress={onUnlock}
onPassChange={onPassChange}
title={t('Please enter your password to proceed')}
/>
<GradientButton
contentPlacement='center'
disabled={!hashedPassword}
onClick={onUnlock}
style={{
height: '44px',
marginTop: '24px',
width: '325px'
}}
text={t('Unlock')}
/>
<ActionButton
contentPlacement='center'
onClick={onForgotPassword}
style={{
height: '44px',
marginTop: '18px',
width: '325px'
}}
text={{ firstPart: t('Forgot password') }}
/>
</Grid>
</GradientBox>
<Version />
</Container>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function AddAccount ({ openMenu, setPopup }: Props): React.ReactElement {
<Grid alignItems='center' container item justifyContent='center' sx={{ pb: '12px', pt: '18px' }}>
<CustomCloseSquare color='#AA83DC' onClick={handleClose} size='48' style={{ cursor: 'pointer' }} />
</Grid>
<Grid alignItems='center' container item justifyContent='center' sx={{ bgcolor: '#120D27', border: '2px solid', borderColor: '#FFFFFF0D', borderTopLeftRadius: '32px', borderTopRightRadius: '32px', display: 'block', height: 'calc(100% - 78px)', overflow: 'scroll', p: '10px', position: 'relative' }}>
<Grid alignItems='center' container item justifyContent='center' sx={{ bgcolor: '#120D27', border: '2px solid', borderColor: '#FFFFFF0D', borderTopLeftRadius: '32px', borderTopRightRadius: '32px', display: 'block', height: 'calc(100% - 78px)', overflow: 'hidden', overflowY: 'scroll', p: '10px', position: 'relative' }}>
<GradientBorder />
<Grid alignItems='center' columnGap='10px' container item justifyContent='center' p='10px'>
<Typography color='#fff' fontFamily='OdibeeSans' fontSize='29px' fontWeight={400} textTransform='uppercase'>
Expand Down
Loading