diff --git a/apps/web/public/images/safenet/logo-safenet-dark-gradient.svg b/apps/web/public/images/safenet/logo-safenet-dark-gradient.svg new file mode 100644 index 0000000000..89ad5fbe66 --- /dev/null +++ b/apps/web/public/images/safenet/logo-safenet-dark-gradient.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/apps/web/public/images/safenet/logo-safenet-light-gradient.svg b/apps/web/public/images/safenet/logo-safenet-light-gradient.svg new file mode 100644 index 0000000000..843565b9f8 --- /dev/null +++ b/apps/web/public/images/safenet/logo-safenet-light-gradient.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/apps/web/public/images/safenet/safenet-icon.svg b/apps/web/public/images/safenet/safenet-icon.svg new file mode 100644 index 0000000000..5934d7a074 --- /dev/null +++ b/apps/web/public/images/safenet/safenet-icon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/apps/web/src/components/common/ChainIndicator/ChainIndicatorSafenet.tsx b/apps/web/src/components/common/ChainIndicator/ChainIndicatorSafenet.tsx deleted file mode 100644 index df1a72077e..0000000000 --- a/apps/web/src/components/common/ChainIndicator/ChainIndicatorSafenet.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import type { ReactElement } from 'react' -import classnames from 'classnames' -import { useAppSelector } from '@/store' -import { selectChainById, selectChains } from '@/store/chainsSlice' -import css from './styles.module.css' -import useChainId from '@/hooks/useChainId' -import { Skeleton, Typography } from '@mui/material' -import isEmpty from 'lodash/isEmpty' - -type ChainIndicatorProps = { - chainId?: string - inline?: boolean - className?: string - showUnknown?: boolean - showLogo?: boolean - onlyLogo?: boolean - responsive?: boolean - fiatValue?: string -} - -const fallbackChainConfig = { - chainName: 'Unknown chain', - chainId: '-1', - theme: { - backgroundColor: '#ddd', - textColor: '#000', - }, - chainLogoUri: null, -} - -const ChainIndicatorSafenet = ({ - chainId, - className, - inline = false, - showUnknown = true, - showLogo = true, - responsive = false, - onlyLogo = false, -}: ChainIndicatorProps): ReactElement | null => { - const currentChainId = useChainId() - const id = chainId || currentChainId - const chains = useAppSelector(selectChains) - const chainConfig = - useAppSelector((state) => selectChainById(state, id)) || (showUnknown ? fallbackChainConfig : null) - const noChains = isEmpty(chains.data) - - return noChains ? ( - - ) : chainConfig ? ( - - - {`${chainConfig.chainName} - {chainConfig.chainName} - - - Safenet - - - ) : null -} - -export default ChainIndicatorSafenet diff --git a/apps/web/src/components/sidebar/Sidebar/index.tsx b/apps/web/src/components/sidebar/Sidebar/index.tsx index 4997c27a77..58329a69c1 100644 --- a/apps/web/src/components/sidebar/Sidebar/index.tsx +++ b/apps/web/src/components/sidebar/Sidebar/index.tsx @@ -2,7 +2,6 @@ import ChevronRight from '@mui/icons-material/ChevronRight' import { Box, Divider, Drawer } from '@mui/material' import { useCallback, useState, type ReactElement } from 'react' -import ChainIndicatorSafenet from '@/components/common/ChainIndicator/ChainIndicatorSafenet' import IndexingStatus from '@/components/sidebar/IndexingStatus' import SidebarFooter from '@/components/sidebar/SidebarFooter' import SidebarHeader from '@/components/sidebar/SidebarHeader' @@ -12,8 +11,11 @@ import ChainIndicator from '@/components/common/ChainIndicator' import MyAccounts from '@/features/myAccounts' import useIsSafenetEnabled from '@/features/safenet/hooks/useIsSafenetEnabled' import { OVERVIEW_EVENTS, trackEvent } from '@/services/analytics' +import dynamic from 'next/dynamic' import css from './styles.module.css' +const SafenetSidebarHeader = dynamic(() => import('@/features/safenet/components/SafenetSidebarHeader')) + const Sidebar = (): ReactElement => { const isSafenetEnabled = useIsSafenetEnabled() const [isDrawerOpen, setIsDrawerOpen] = useState(false) @@ -31,7 +33,7 @@ const Sidebar = (): ReactElement => { return (
- {isSafenetEnabled ? : } + {isSafenetEnabled ? : } {/* Open the safes list */}