import { Box, Flex } from '@chakra-ui/react'; import dynamic from 'next/dynamic'; import React from 'react'; import config from 'configs/app'; import { useIsSticky } from 'toolkit/hooks/useIsSticky'; import RewardsButton from 'ui/rewards/RewardsButton'; import NetworkIcon from 'ui/snippets/networkLogo/NetworkIcon'; import UserProfileAuth0 from 'ui/snippets/user/profile/auth0/UserProfileMobile'; import UserWalletMobile from 'ui/snippets/user/wallet/UserWalletMobile'; import RollupStageBadge from '../navigation/RollupStageBadge'; import TestnetBadge from '../navigation/TestnetBadge'; import SearchBarMobile from '../searchBar/SearchBarMobile'; import Burger from './Burger'; const UserProfileDynamic = dynamic(() => import('ui/snippets/user/profile/dynamic/UserProfile'), { ssr: false }); type Props = { hideSearchButton?: boolean; onGoToSearchResults?: (searchTerm: string) => void; }; const HeaderMobile = ({ hideSearchButton, onGoToSearchResults }: Props) => { const ref = React.useRef(null); const isSticky = useIsSticky(ref, 5); const userProfile = (() => { const accountFeature = config.features.account; if (accountFeature.isEnabled) { switch (accountFeature.authProvider) { case 'auth0': return ; case 'dynamic': return ; default: return null; } } if (config.features.blockchainInteraction.isEnabled) { return ; } })(); return ( { !hideSearchButton && } { config.features.rewards.isEnabled && } { userProfile } ); }; export default React.memo(HeaderMobile);