@@ -8,17 +8,18 @@ import type { HexString } from '@polkadot/util/types';
8
8
import type { FetchedBalance } from '../../../hooks/useAssetsBalances' ;
9
9
import type { BalancesInfo , Prices } from '../../../util/types' ;
10
10
11
- import { Divider , Grid , IconButton , Skeleton , Typography , useTheme } from '@mui/material' ;
11
+ import { Divider , Grid , Skeleton , Typography , useTheme } from '@mui/material' ;
12
12
import React , { useCallback , useEffect , useMemo } from 'react' ;
13
13
14
- import { AssetLogo , FormatBalance2 , FormatPrice , Identicon , Identity , Infotip , Infotip2 , OptionalCopyButton , ShortAddress2 , VaadinIcon } from '../../../components' ;
15
- import { useIdentity , useInfo , useTranslation } from '../../../hooks' ;
16
- import { showAccount , tieAccount } from '../../../messaging' ;
14
+ import { AssetLogo , FormatBalance2 , FormatPrice , Infotip , Infotip2 } from '../../../components' ;
15
+ import { useInfo , useTranslation } from '../../../hooks' ;
16
+ import { tieAccount } from '../../../messaging' ;
17
17
import { getValue } from '../../../popup/account/util' ;
18
18
import { BALANCES_VALIDITY_PERIOD } from '../../../util/constants' ;
19
19
import getLogo2 from '../../../util/getLogo2' ;
20
20
import { amountToHuman } from '../../../util/utils' ;
21
- import AccountIconsFs from './AccountIconsFs' ;
21
+ import AccountBodyFs from '../../homeFullScreen/partials/AccountBodyFs' ;
22
+ import AccountIdenticonIconsFS from '../../homeFullScreen/partials/AccountIdenticonIconsFS' ;
22
23
import AOC from './AOC' ;
23
24
24
25
interface PriceJSXType {
@@ -147,24 +148,10 @@ interface AddressDetailsProps {
147
148
setAssetIdOnAssetHub : React . Dispatch < React . SetStateAction < number | string | undefined > > ;
148
149
}
149
150
150
- export const EyeIconFullScreen = ( { isHidden, onClick } : { isHidden : boolean | undefined , onClick ?: React . MouseEventHandler < HTMLButtonElement > | undefined } ) => {
151
- const { t } = useTranslation ( ) ;
152
- const theme = useTheme ( ) ;
153
-
154
- return (
155
- < Infotip text = { isHidden ? t ( 'This account is hidden from websites' ) : t ( 'This account is visible to websites' ) } >
156
- < IconButton onClick = { onClick } sx = { { height : '20px' , ml : '7px' , mt : '13px' , p : 0 , width : '28px' } } >
157
- < VaadinIcon icon = { isHidden ? 'vaadin:eye-slash' : 'vaadin:eye' } style = { { color : `${ theme . palette . secondary . light } ` , height : '20px' } } />
158
- </ IconButton >
159
- </ Infotip >
160
- ) ;
161
- } ;
162
-
163
151
function AccountInformationForDetails ( { accountAssets, address, label, price, pricesInCurrency, selectedAsset, setAssetIdOnAssetHub, setSelectedAsset } : AddressDetailsProps ) : React . ReactElement {
164
152
const theme = useTheme ( ) ;
165
- const { account, api , chain, formatted , genesisHash, token } = useInfo ( address ) ;
153
+ const { account, chain, genesisHash, token } = useInfo ( address ) ;
166
154
167
- const accountInfo = useIdentity ( genesisHash , formatted ) ;
168
155
169
156
const calculatePrice = useCallback ( ( amount : BN , decimal : number , _price : number ) => {
170
157
return parseFloat ( amountToHuman ( amount , decimal ) ) * _price ;
@@ -210,56 +197,17 @@ function AccountInformationForDetails ({ accountAssets, address, label, price, p
210
197
} ) . catch ( console . error ) ;
211
198
} , [ address , setSelectedAsset , setAssetIdOnAssetHub ] ) ;
212
199
213
- const toggleVisibility = useCallback ( ( ) : void => {
214
- address && showAccount ( address , account ?. isHidden || false ) . catch ( console . error ) ;
215
- } , [ account ?. isHidden , address ] ) ;
216
-
217
200
return (
218
201
< 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' } } >
219
202
{ label }
220
203
< Grid container item >
221
- < Grid container item sx = { { borderRight : '1px solid' , borderRightColor : 'divider' , pr : '8px' , width : 'fit-content' } } >
222
- < Grid container item pr = '7px' sx = { { '> div' : { height : 'fit-content' } , m : 'auto' , width : 'fit-content' } } >
223
- < Identicon
224
- iconTheme = { chain ?. icon ?? 'polkadot' }
225
- prefix = { chain ?. ss58Format ?? 42 }
226
- size = { 70 }
227
- value = { formatted || address }
228
- />
229
- </ Grid >
230
- < AccountIconsFs
231
- accountInfo = { accountInfo }
204
+ < AccountIdenticonIconsFS
205
+ address = { address }
206
+ />
207
+ < Grid container item sx = { { display : 'grid' , gridTemplateColumns : 'minmax(150px, 60%) max-content' } } xs >
208
+ < AccountBodyFs
232
209
address = { address }
233
210
/>
234
- </ Grid >
235
- < Grid container item sx = { { display : 'grid' , gridTemplateColumns : 'minmax(150px, 60%) max-content' } } xs >
236
- < Grid container direction = 'column' item sx = { { borderRight : '1px solid' , borderRightColor : 'divider' , px : '7px' } } >
237
- < Grid container item justifyContent = 'space-between' >
238
- < Identity
239
- accountInfo = { accountInfo }
240
- address = { address }
241
- api = { api }
242
- chain = { chain }
243
- noIdenticon
244
- style = { { width : 'calc(100% - 40px)' } }
245
- // subIdOnly
246
- />
247
- < Grid item width = '40px' >
248
- < EyeIconFullScreen
249
- isHidden = { account ?. isHidden }
250
- onClick = { toggleVisibility }
251
- />
252
- </ Grid >
253
- </ Grid >
254
- < Grid alignItems = 'center' container item >
255
- < Grid container item sx = { { '> div div:last-child' : { width : 'auto' } } } xs >
256
- < ShortAddress2 address = { formatted || address } clipped style = { { fontSize : '10px' , fontWeight : 300 } } />
257
- </ Grid >
258
- < Grid container item width = 'fit-content' >
259
- < OptionalCopyButton address = { address } />
260
- </ Grid >
261
- </ Grid >
262
- </ Grid >
263
211
< SelectedAssetBox
264
212
balanceToShow = { selectedAsset as unknown as BalancesInfo }
265
213
genesisHash = { chain === null ? null : genesisHash }
0 commit comments