Skip to content

Commit dfb792f

Browse files
committed
style: adjust currency dialog
1 parent 3dad7ca commit dfb792f

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

packages/extension-polkagate/src/fullscreen/homeFullScreen/partials/Currency.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ export interface CurrencyItemType {
1919
}
2020

2121
interface Props {
22-
fontSize?: string;
2322
color?: string;
24-
bgcolor?: string;
23+
dialogLeft?: number;
24+
fontSize?: string;
2525
height?: string;
2626
minWidth?: string;
27-
noBorder?: boolean;
2827
}
2928

30-
export default function Currency ({ bgcolor, color, fontSize = '22px', height, minWidth, noBorder }: Props): React.ReactElement {
29+
export default function Currency ({ color, fontSize = '22px', height, minWidth, dialogLeft=260 }: Props): React.ReactElement {
30+
// export default function Currency ({ color, fontSize = '22px' }: Props): React.ReactElement {
3131
const theme = useTheme();
3232

3333
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
@@ -55,7 +55,15 @@ export default function Currency ({ bgcolor, color, fontSize = '22px', height, m
5555

5656
return (
5757
<>
58-
<Grid alignItems='center' component='button' container direction='column' item justifyContent='center' onClick={onCurrencyClick} sx={{ ...HEADER_COMPONENT_STYLE, zIndex: anchorEl && theme.zIndex.modal + 1 }}>
58+
<Grid
59+
alignItems='center' component='button' container direction='column' item justifyContent='center' onClick={onCurrencyClick}
60+
sx={{
61+
...HEADER_COMPONENT_STYLE,
62+
height: height || HEADER_COMPONENT_STYLE?.height,
63+
minWidth: minWidth || HEADER_COMPONENT_STYLE?.minWidth,
64+
zIndex: anchorEl && theme.zIndex.modal + 1
65+
}}
66+
>
5967
<Infotip2 text={currencyToShow?.currency}>
6068
<Typography color={textColor} fontSize={ fontSize } fontWeight={500}>
6169
{currencyToShow?.sign || '$'}
@@ -71,7 +79,7 @@ export default function Currency ({ bgcolor, color, fontSize = '22px', height, m
7179
boxShadow: theme.palette.mode === 'dark'
7280
? '0px 4px 4px rgba(255, 255, 255, 0.25)'
7381
: '0px 0px 25px 0px rgba(0, 0, 0, 0.50)',
74-
left: anchorEl?.getBoundingClientRect().right - 260,
82+
left: anchorEl?.getBoundingClientRect().right - dialogLeft,
7583
position: 'absolute',
7684
top: anchorEl?.getBoundingClientRect().bottom - 30
7785
}

packages/extension-polkagate/src/popup/home/ProfileTab.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ function ProfileTab ({ index, isContainerHovered, isSelected, orderedAccounts, t
9696
}}
9797
>
9898
<Grid alignItems='center' container item justifyContent='center' sx={{ display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', minWidth: '40px', px: '8px', width: 'fit-content' }}>
99-
<Typography color='text.primary' fontSize='14px' fontWeight={400} sx={{ lineHeight: 'normal', maxWidth: '100px', overflowX: 'hidden', textOverflow: 'ellipsis', transition: 'visibility 0.1s ease', userSelect: 'none', visibility: visibleContent ? 'visible' : 'hidden', whiteSpace: 'nowrap', width: 'fit-content' }} textAlign='center'>
99+
<Typography color='text.primary' fontSize='14px' sx={{ lineHeight: 'normal', maxWidth: '100px', overflowX: 'hidden', textOverflow: 'ellipsis', transition: 'visibility 0.1s ease', userSelect: 'none', visibility: visibleContent ? 'visible' : 'hidden', whiteSpace: 'nowrap', width: 'fit-content' }} textAlign='center'>
100100
{t(text)}
101101
</Typography>
102102
{areAllHidden && isSelected &&
103-
<VaadinIcon icon='vaadin:eye-slash' style={{ display: 'block', height: '13px', marginLeft: '5px', width: '15px' }} />}
103+
<VaadinIcon icon='vaadin:eye-slash' style={{ display: 'block', height: '13px', marginLeft: '5px', width: '15px' }} />
104+
}
104105
</Grid>
105106
</Collapse>
106107
</Grid>

packages/extension-polkagate/src/popup/home/YouHave.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function YouHave (): React.ReactElement {
5555
<Grid alignItems='flex-start' container sx={{ bgcolor: 'background.paper', borderRadius: '10px', minHeight: '125px', m: '20px 10px 10px', width: '100%', boxShadow: isDark ? '3px 2px 15px rgba(255, 255, 255, 0.25)' : '2px 3px 4px 2px rgba(0, 0, 0, 0.10)' }}>
5656
<Grid container sx={{ position: 'relative', px: '10px', py: '5px' }}>
5757
<Grid container item sx={{ textAlign: 'left' }}>
58-
<Typography sx={{ fontSize: '16px', fontVariant: 'small-caps', mt: '10px' }}>
58+
<Typography sx={{ fontSize: '16px', fontVariant: 'small-caps', fontWeight: 400, mt: '10px' }}>
5959
{t('My Portfolio')}
6060
</Typography>
6161
</Grid>
@@ -70,12 +70,11 @@ export default function YouHave (): React.ReactElement {
7070
<Stack alignItems='center' direction='row' justifyContent='space-between' sx={{ flexWrap: 'wrap', mr: '15px', textAlign: 'start', width: '100%' }}>
7171
<Stack alignItems='flex-start' direction='row' sx= {{ ml: '-5px' }}>
7272
<Currency
73-
bgcolor='background.paper'
7473
color='secondary.light'
75-
fontSize='28px'
76-
height='30px'
74+
dialogLeft ={64}
75+
fontSize='25px'
76+
height='27px'
7777
minWidth='27px'
78-
noBorder
7978
/>
8079
<FormatPrice
8180
fontSize='28px'
@@ -117,12 +116,12 @@ export default function YouHave (): React.ReactElement {
117116
}
118117
<IconButton
119118
onClick={onMenuClick}
120-
sx={{ p: 0, position: 'absolute', pt: '3px', right: '3px', top: '11px' }}
119+
sx={{ p: 0, position: 'absolute', pt: '3px', right: '3px', top: '8px' }}
121120
>
122121
<MoreVertIcon sx={{ color: 'secondary.light', fontSize: '33px' }} />
123122
</IconButton>
124123
</Grid>
125-
<Grid item sx={{ position: 'absolute', right: '30px', top: '8px' }}>
124+
<Grid item sx={{ position: 'absolute', right: '30px', top: '5px' }}>
126125
<HideBalance
127126
darkColor={theme.palette.secondary.light}
128127
hide={isHideNumbers}
@@ -135,7 +134,7 @@ export default function YouHave (): React.ReactElement {
135134
<Box
136135
component='img'
137136
src={theme.palette.mode === 'dark' ? logoBlack as string : logoWhite as string}
138-
sx={{ filter: 'drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5))', height: 40, left: 'calc(50% - 26px)', position: 'absolute', top: '5px', width: 40 }}
137+
sx={{ filter: 'drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5))', height: 40, left: 'calc(50% - 20px)', position: 'absolute', top: '5px', width: 40 }}
139138
/>
140139
{isMenuOpen &&
141140
<Menu

packages/extension/public/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,5 +1462,6 @@
14621462
"Unable to fetch NFT/Unique items!": "",
14631463
"Referenda Id": "",
14641464
"Track Id": "",
1465-
"Select the currency for your balance": ""
1465+
"Select the currency for your balance": "",
1466+
"available": ""
14661467
}

0 commit comments

Comments
 (0)