Skip to content

Commit 0c23779

Browse files
committed
Merge branch 'main' into pr/1394
2 parents 230133e + ba0074f commit 0c23779

File tree

25 files changed

+481
-406
lines changed

25 files changed

+481
-406
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@polkadot/types-support": "^11.2.1",
6565
"@polkadot/util": "^12.6.2",
6666
"@polkadot/util-crypto": "^12.6.2",
67-
"@polkagate/apps-config": "^0.133.87",
67+
"@polkagate/apps-config": "^0.140.2",
6868
"@substrate/connect": "^0.7.32",
6969
"@vaadin/icons": "^23.2.3",
7070
"babel-plugin-transform-import-meta": "^2.1.1",

packages/extension-polkagate/src/components/MenuItem.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface Props {
2424
withHoverEffect?: boolean;
2525
}
2626

27-
export default function MenuItem({ children, disabled = false, fontSize, icon, iconComponent, onClick, pl = '0', py = '8px',showChevron, showSubMenu = false, text, withHoverEffect }: Props): React.ReactElement<Props> {
27+
export default function MenuItem({ children, disabled = false, fontSize, icon, iconComponent, onClick, pl = '0', py = '8px', showChevron, showSubMenu = false, text, withHoverEffect }: Props): React.ReactElement<Props> {
2828
const hoverEffectStyles: SxProps<Theme> = {
2929
'&:hover': { bgcolor: disabled ? 'none' : 'divider' },
3030
borderRadius: '5px',
@@ -34,7 +34,7 @@ export default function MenuItem({ children, disabled = false, fontSize, icon, i
3434
return (
3535
<>
3636
<Grid alignItems='center' color={disabled ? '#4B4B4B' : 'inherit'} container item justifyContent='space-between' my='4px' onClick={disabled ? noop : onClick} pl={pl} py={py} sx={{ cursor: disabled ? '' : 'pointer', ...(withHoverEffect ? hoverEffectStyles : {}) }} textAlign='left' xs={12}>
37-
<Grid alignItems='center' container item xs>
37+
<Grid alignItems='center' container item xs sx={{ flexWrap: 'nowrap' }}>
3838
<Grid alignItems='center' container item xs={1}>
3939
{iconComponent ??
4040
<Box
@@ -46,12 +46,13 @@ export default function MenuItem({ children, disabled = false, fontSize, icon, i
4646
/>
4747
}
4848
</Grid>
49-
<Grid item pl='10px'>
49+
<Grid item pl='10px' xs>
5050
<Typography
5151
color={disabled ? 'text.disabled' : 'inherit'}
5252
fontSize={fontSize || '18px'}
5353
fontWeight={300}
5454
lineHeight='20px'
55+
whiteSpace='nowrap'
5556
>
5657
{text}
5758
</Typography>

packages/extension-polkagate/src/fullscreen/accountDetails/components/AccountInformationForDetails.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const SelectedAssetBox = ({ balanceToShow, genesisHash, isBalanceOutdated, isPri
120120
interface AddressDetailsProps {
121121
accountAssets: FetchedBalance[] | null | undefined;
122122
address: string | undefined;
123-
label?: string | undefined;
123+
label?: React.ReactElement | undefined;
124124
price: number | undefined;
125125
pricesInCurrency: Prices | null | undefined;
126126
selectedAsset: FetchedBalance | undefined;
@@ -197,9 +197,7 @@ export default function AccountInformationForDetails({ accountAssets, address, l
197197

198198
return (
199199
<Grid alignItems='center' container item sx={{ bgcolor: 'background.paper', border: '0px solid', borderBottomWidth: '8px', borderBottomColor: theme.palette.mode === 'light' ? 'black' : 'secondary.light', borderRadius: '5px', boxShadow: '2px 3px 4px 0px rgba(0, 0, 0, 0.1)', mb: '15px', p: `20px 20px ${showAOC ? '5px' : '20px'} 20px`, position: 'relative' }}>
200-
<Grid item sx={{ bgcolor: theme.palette.nay.main, color: 'white', fontSize: '10px', left: 0, ml: 4, position: 'absolute', px: 1, top: 0, width: 'fit-content' }}>
201-
{label}
202-
</Grid>
200+
{label}
203201
<Grid container item>
204202
<Grid container item sx={{ borderRight: '1px solid', borderRightColor: 'divider', pr: '8px', width: 'fit-content' }}>
205203
<Grid container item pr='7px' sx={{ '> div': { height: 'fit-content' }, m: 'auto', width: 'fit-content' }}>

packages/extension-polkagate/src/fullscreen/accountDetails/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import type { FetchedBalance } from '../../hooks/useAssetsBalances';
1717
import ExportAccountModal from '../../popup/export/ExportAccountModal';
1818
import ForgetAccountModal from '../../popup/forgetAccount/ForgetAccountModal';
1919
import HistoryModal from '../../popup/history/modal/HistoryModal';
20-
import { label } from '../../popup/home/AccountsTree';
2120
import DeriveAccountModal from '../../popup/newAccount/deriveAccount/modal/DeriveAccountModal';
2221
import ReceiveModal from '../../popup/receive/ReceiveModal';
2322
import RenameModal from '../../popup/rename/RenameModal';
@@ -31,6 +30,7 @@ import { openOrFocusTab } from './components/CommonTasks';
3130
import ReservedDisplayBalance from './components/ReservedDisplayBalance';
3231
import LockedInReferenda from './unlock/Review';
3332
import { AccountInformationForDetails, AccountSetting, AssetSelect, CommonTasks, DisplayBalance, ExternalLinks, LockedBalanceDisplay, TotalChart } from './components';
33+
import { AccountLabel } from '../../popup/home/AccountLabel';
3434

3535
export enum popupNumbers {
3636
LOCKED_IN_REFERENDA,
@@ -180,7 +180,13 @@ export default function AccountDetails(): React.ReactElement {
180180
<AccountInformationForDetails
181181
accountAssets={accountAssets}
182182
address={address}
183-
label={label(account, hasParent?.name || '', t)}
183+
label={
184+
<AccountLabel
185+
account={account}
186+
parentName={hasParent?.name || ''}
187+
ml='0px'
188+
/>
189+
}
184190
price={currentPrice}
185191
pricesInCurrency={pricesInCurrency}
186192
selectedAsset={balancesToShow as any}

packages/extension-polkagate/src/fullscreen/homeFullScreen/index.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,39 @@ export default function HomePageFullScreen(): React.ReactElement {
5454
noChainSwitch
5555
/>
5656
<Grid container item sx={{ bgcolor: 'backgroundFL.secondary', maxWidth: '1282px' }}>
57-
<Grid container item justifyContent='space-around' sx={{ bgcolor: 'backgroundFL.secondary', height: 'calc(100vh - 70px)', maxWidth: '1282px', overflow: 'scroll', pb: '40px' }}>
57+
<Grid container item display='block' sx={{ bgcolor: 'backgroundFL.secondary', height: 'calc(100vh - 70px)', maxWidth: '1282px', overflow: 'scroll', pb: '40px' }}>
5858
<ProfileTabs
5959
orderedAccounts={initialAccountList}
6060
/>
61-
<Grid container direction='column' item rowGap='20px' width='760px'>
62-
{profileAccounts &&
63-
<DraggableAccountsList
64-
hideNumbers={hideNumbers}
65-
initialAccountList={profileAccounts}
66-
/>
67-
}
68-
{initialAccountList && initialAccountList?.length <= 2 &&
69-
<AddNewAccountButton />
70-
}
71-
</Grid>
72-
<Grid container direction='column' item rowGap='20px' width='fit-content'>
73-
<Grid container item width='fit-content'>
74-
<TotalBalancePieChart
75-
hideNumbers={hideNumbers}
76-
setGroupedAssets={setGroupedAssets}
77-
/>
61+
<Grid container justifyContent='space-around'>
62+
<Grid container direction='column' item rowGap='20px' width='760px'>
63+
{profileAccounts &&
64+
<DraggableAccountsList
65+
hideNumbers={hideNumbers}
66+
initialAccountList={profileAccounts}
67+
/>
68+
}
69+
{initialAccountList && initialAccountList?.length <= 2 &&
70+
<AddNewAccountButton />
71+
}
7872
</Grid>
79-
{groupedAssets && groupedAssets?.length > 0 &&
73+
<Grid container direction='column' item rowGap='20px' width='fit-content'>
8074
<Grid container item width='fit-content'>
81-
<WatchList
82-
groupedAssets={groupedAssets}
75+
<TotalBalancePieChart
76+
hideNumbers={hideNumbers}
77+
setGroupedAssets={setGroupedAssets}
8378
/>
8479
</Grid>
85-
}
86-
<Grid container item width='fit-content'>
87-
<HomeMenu />
80+
{groupedAssets && groupedAssets?.length > 0 &&
81+
<Grid container item width='fit-content'>
82+
<WatchList
83+
groupedAssets={groupedAssets}
84+
/>
85+
</Grid>
86+
}
87+
<Grid container item width='fit-content'>
88+
<HomeMenu />
89+
</Grid>
8890
</Grid>
8991
</Grid>
9092
</Grid>

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
3-
// @ts-nocheck
43

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

@@ -10,14 +9,14 @@ import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
109
import { Backdrop, Grid, useTheme } from '@mui/material';
1110
import React, { useContext, useMemo, useState } from 'react';
1211

13-
import { AccountWithChildren } from '@polkadot/extension-base/background/types';
12+
import type { AccountWithChildren } from '@polkadot/extension-base/background/types';
1413

1514
import { AccountContext } from '../../../components';
16-
import { useAccountAssets, useChain, useTranslation } from '../../../hooks';
17-
import { FetchedBalance } from '../../../hooks/useAssetsBalances';
15+
import { useAccountAssets, useChain } from '../../../hooks';
16+
import type { FetchedBalance } from '../../../hooks/useAssetsBalances';
1817
import QuickActionFullScreen from '../../../partials/QuickActionFullScreen';
19-
import { label } from '../../../popup/home/AccountsTree';
2018
import AccountInformationForHome from './AccountInformationForHome';
19+
import { AccountLabel } from '../../../popup/home/AccountLabel';
2120

2221
interface Props {
2322
account: AccountWithChildren;
@@ -28,7 +27,6 @@ interface Props {
2827
}
2928

3029
function AccountItem({ account, hideNumbers, id, quickActionOpen, setQuickActionOpen }: Props): React.ReactElement {
31-
const { t } = useTranslation();
3230
const theme = useTheme();
3331
const chain = useChain(account.address);
3432
const accountAssets = useAccountAssets(account.address);
@@ -54,9 +52,11 @@ function AccountItem({ account, hideNumbers, id, quickActionOpen, setQuickAction
5452
<div ref={id ? setNodeRef : null} style={{ transform: CSS.Transform.toString(transform), transition }}>
5553
<Grid container {...attributes} item ref={containerRef} sx={{ borderRadius: '5px', boxShadow: '2px 3px 4px 0px rgba(0, 0, 0, 0.1)', overflow: 'hidden', position: 'relative' }} width='760px'>
5654
<DragIndicatorIcon {...listeners} sx={{ ':active': { cursor: 'grabbing' }, color: 'secondary.contrastText', cursor: 'grab', fontSize: '25px', position: 'absolute', right: '5px', top: '5px' }} />
57-
<Grid item sx={{ bgcolor: theme.palette.nay.main, color: 'white', fontSize: '10px', ml: 5, position: 'absolute', px: 1, width: 'fit-content' }}>
58-
{label(account, hasParent?.name ?? '', t)}
59-
</Grid>
55+
<AccountLabel
56+
account={account}
57+
parentName={hasParent?.name ?? ''}
58+
ml='30px'
59+
/>
6060
<AccountInformationForHome
6161
accountAssets={accountAssets}
6262
address={account.address}

0 commit comments

Comments
 (0)