Skip to content

Commit 83b21db

Browse files
committed
Add Safenet tag to SingleAccountItem
1 parent 858a3bd commit 83b21db

File tree

1 file changed

+34
-25
lines changed

1 file changed

+34
-25
lines changed

apps/web/src/features/myAccounts/components/AccountItems/SingleAccountItem.tsx

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,53 @@
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'
111
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'
155
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'
2110
import type { SafeItem } from '@/features/myAccounts/hooks/useAllSafes'
2211
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'
2416
import useWallet from '@/hooks/wallets/useWallet'
25-
import { hasMultiChainAddNetworkFeature } from '@/features/multichain/utils/utils'
2617
import BookmarkIcon from '@/public/images/apps/bookmark.svg'
2718
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'
2821
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'
3224
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'
3434
import { AccountInfoChips } from '../AccountInfoChips'
35+
import css from './styles.module.css'
3536

3637
type AccountItemProps = {
3738
safeItem: SafeItem
3839
safeOverview?: SafeOverview
3940
onLinkClick?: () => void
4041
isMultiChainItem?: boolean
42+
isSafenetItem?: boolean
4143
}
4244

43-
const SingleAccountItem = ({ onLinkClick, safeItem, isMultiChainItem = false }: AccountItemProps) => {
45+
const SingleAccountItem = ({
46+
onLinkClick,
47+
safeItem,
48+
isMultiChainItem = false,
49+
isSafenetItem = false,
50+
}: AccountItemProps) => {
4451
const { chainId, address, isReadOnly, isPinned } = safeItem
4552
const chain = useAppSelector((state) => selectChainById(state, chainId))
4653
const undeployedSafe = useAppSelector((state) => selectUndeployedSafe(state, chainId, address))
@@ -208,6 +215,8 @@ const SingleAccountItem = ({ onLinkClick, safeItem, isMultiChainItem = false }:
208215

209216
{!isMultiChainItem && <ChainIndicator chainId={chainId} responsive onlyLogo className={css.chainIndicator} />}
210217

218+
{isSafenetItem && <SafenetTag />}
219+
211220
<Typography variant="body2" sx={{ fontWeight: 'bold', textAlign: 'right', pl: 2 }}>
212221
{undeployedSafe ? null : safeOverview ? (
213222
<FiatValue value={safeOverview.fiatTotal} />

0 commit comments

Comments
 (0)