|
1 |
| -import { selectUndeployedSafe } from '@/features/counterfactual/store/undeployedSafesSlice' |
2 |
| -import { type SafeOverview } from '@safe-global/safe-gateway-typescript-sdk' |
3 |
| -import { useMemo, useRef } from 'react' |
4 |
| -import { ListItemButton, Box, Typography, IconButton, SvgIcon, Skeleton, useTheme, useMediaQuery } from '@mui/material' |
5 |
| -import Link from 'next/link' |
6 |
| -import Track from '@/components/common/Track' |
7 |
| -import { OVERVIEW_EVENTS, OVERVIEW_LABELS, PIN_SAFE_LABELS, trackEvent } from '@/services/analytics' |
8 |
| -import { AppRoutes } from '@/config/routes' |
9 |
| -import { useAppDispatch, useAppSelector } from '@/store' |
10 |
| -import { selectChainById } from '@/store/chainsSlice' |
11 | 1 | import ChainIndicator from '@/components/common/ChainIndicator'
|
12 |
| -import css from './styles.module.css' |
13 |
| -import { selectAllAddressBooks } from '@/store/addressBookSlice' |
14 |
| -import { shortenAddress } from '@/utils/formatters' |
| 2 | +import FiatValue from '@/components/common/FiatValue' |
| 3 | +import SafeIcon from '@/components/common/SafeIcon' |
| 4 | +import Track from '@/components/common/Track' |
15 | 5 | import SafeListContextMenu from '@/components/sidebar/SafeListContextMenu'
|
16 |
| -import useSafeAddress from '@/hooks/useSafeAddress' |
17 |
| -import useChainId from '@/hooks/useChainId' |
18 |
| -import { sameAddress } from '@/utils/addresses' |
19 |
| -import classnames from 'classnames' |
20 |
| -import { useRouter } from 'next/router' |
| 6 | +import { AppRoutes } from '@/config/routes' |
| 7 | +import { selectUndeployedSafe } from '@/features/counterfactual/store/undeployedSafesSlice' |
| 8 | +import { extractCounterfactualSafeSetup, isPredictedSafeProps } from '@/features/counterfactual/utils' |
| 9 | +import { hasMultiChainAddNetworkFeature } from '@/features/multichain/utils/utils' |
21 | 10 | import type { SafeItem } from '@/features/myAccounts/hooks/useAllSafes'
|
22 | 11 | import { useGetHref } from '@/features/myAccounts/hooks/useGetHref'
|
23 |
| -import { extractCounterfactualSafeSetup, isPredictedSafeProps } from '@/features/counterfactual/utils' |
| 12 | +import SafenetTag from '@/features/safenet/components/SafenetTag' |
| 13 | +import useChainId from '@/hooks/useChainId' |
| 14 | +import useOnceVisible from '@/hooks/useOnceVisible' |
| 15 | +import useSafeAddress from '@/hooks/useSafeAddress' |
24 | 16 | import useWallet from '@/hooks/wallets/useWallet'
|
25 |
| -import { hasMultiChainAddNetworkFeature } from '@/features/multichain/utils/utils' |
26 | 17 | import BookmarkIcon from '@/public/images/apps/bookmark.svg'
|
27 | 18 | import BookmarkedIcon from '@/public/images/apps/bookmarked.svg'
|
| 19 | +import { OVERVIEW_EVENTS, OVERVIEW_LABELS, PIN_SAFE_LABELS, trackEvent } from '@/services/analytics' |
| 20 | +import { useAppDispatch, useAppSelector } from '@/store' |
28 | 21 | import { addOrUpdateSafe, unpinSafe } from '@/store/addedSafesSlice'
|
29 |
| -import SafeIcon from '@/components/common/SafeIcon' |
30 |
| -import useOnceVisible from '@/hooks/useOnceVisible' |
31 |
| -import { skipToken } from '@reduxjs/toolkit/query' |
| 22 | +import { selectAllAddressBooks } from '@/store/addressBookSlice' |
| 23 | +import { selectChainById } from '@/store/chainsSlice' |
32 | 24 | import { defaultSafeInfo, showNotification, useGetSafeOverviewQuery } from '@/store/slices'
|
33 |
| -import FiatValue from '@/components/common/FiatValue' |
| 25 | +import { sameAddress } from '@/utils/addresses' |
| 26 | +import { shortenAddress } from '@/utils/formatters' |
| 27 | +import { Box, IconButton, ListItemButton, Skeleton, SvgIcon, Typography, useMediaQuery, useTheme } from '@mui/material' |
| 28 | +import { skipToken } from '@reduxjs/toolkit/query' |
| 29 | +import { type SafeOverview } from '@safe-global/safe-gateway-typescript-sdk' |
| 30 | +import classnames from 'classnames' |
| 31 | +import Link from 'next/link' |
| 32 | +import { useRouter } from 'next/router' |
| 33 | +import { useMemo, useRef } from 'react' |
34 | 34 | import { AccountInfoChips } from '../AccountInfoChips'
|
| 35 | +import css from './styles.module.css' |
35 | 36 |
|
36 | 37 | type AccountItemProps = {
|
37 | 38 | safeItem: SafeItem
|
38 | 39 | safeOverview?: SafeOverview
|
39 | 40 | onLinkClick?: () => void
|
40 | 41 | isMultiChainItem?: boolean
|
| 42 | + isSafenetItem?: boolean |
41 | 43 | }
|
42 | 44 |
|
43 |
| -const SingleAccountItem = ({ onLinkClick, safeItem, isMultiChainItem = false }: AccountItemProps) => { |
| 45 | +const SingleAccountItem = ({ |
| 46 | + onLinkClick, |
| 47 | + safeItem, |
| 48 | + isMultiChainItem = false, |
| 49 | + isSafenetItem = false, |
| 50 | +}: AccountItemProps) => { |
44 | 51 | const { chainId, address, isReadOnly, isPinned } = safeItem
|
45 | 52 | const chain = useAppSelector((state) => selectChainById(state, chainId))
|
46 | 53 | const undeployedSafe = useAppSelector((state) => selectUndeployedSafe(state, chainId, address))
|
@@ -208,6 +215,8 @@ const SingleAccountItem = ({ onLinkClick, safeItem, isMultiChainItem = false }:
|
208 | 215 |
|
209 | 216 | {!isMultiChainItem && <ChainIndicator chainId={chainId} responsive onlyLogo className={css.chainIndicator} />}
|
210 | 217 |
|
| 218 | + {isSafenetItem && <SafenetTag />} |
| 219 | + |
211 | 220 | <Typography variant="body2" sx={{ fontWeight: 'bold', textAlign: 'right', pl: 2 }}>
|
212 | 221 | {undeployedSafe ? null : safeOverview ? (
|
213 | 222 | <FiatValue value={safeOverview.fiatTotal} />
|
|
0 commit comments