fix: jumpy nav on safari mweb (#5668)
* test * swap page nav bar on mobile looks weird without this change * fixes
This commit is contained in:
parent
aa03f97890
commit
082591d5dd
@ -16,23 +16,6 @@ import { MenuDropdown } from './MenuDropdown'
|
|||||||
import { SearchBar } from './SearchBar'
|
import { SearchBar } from './SearchBar'
|
||||||
import * as styles from './style.css'
|
import * as styles from './style.css'
|
||||||
|
|
||||||
const MobileBottomBar = styled.div`
|
|
||||||
position: fixed;
|
|
||||||
display: flex;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 4px 8px;
|
|
||||||
height: ${({ theme }) => theme.mobileBottomBarHeight}px;
|
|
||||||
background: ${({ theme }) => theme.backgroundSurface};
|
|
||||||
border-top: 1px solid ${({ theme }) => theme.backgroundOutline};
|
|
||||||
|
|
||||||
@media screen and (min-width: ${({ theme }) => theme.breakpoint.md}px) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
const Nav = styled.nav`
|
const Nav = styled.nav`
|
||||||
padding: 20px 12px;
|
padding: 20px 12px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -62,7 +45,7 @@ const MenuItem = ({ href, dataTestId, id, isActive, children }: MenuItemProps) =
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const PageTabs = () => {
|
export const PageTabs = () => {
|
||||||
const { pathname } = useLocation()
|
const { pathname } = useLocation()
|
||||||
const { chainId: connectedChainId } = useWeb3React()
|
const { chainId: connectedChainId } = useWeb3React()
|
||||||
const chainName = chainIdToBackendName(connectedChainId)
|
const chainName = chainIdToBackendName(connectedChainId)
|
||||||
@ -145,12 +128,6 @@ const Navbar = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Nav>
|
</Nav>
|
||||||
<MobileBottomBar>
|
|
||||||
<PageTabs />
|
|
||||||
<Box marginY="4">
|
|
||||||
<MenuDropdown />
|
|
||||||
</Box>
|
|
||||||
</MobileBottomBar>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ export const PageWrapper = styled.div`
|
|||||||
padding: 68px 8px 0px;
|
padding: 68px 8px 0px;
|
||||||
max-width: 480px;
|
max-width: 480px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
@media only screen and (max-width: ${({ theme }) => `${theme.breakpoint.md}px`}) {
|
@media only screen and (max-width: ${({ theme }) => `${theme.breakpoint.md}px`}) {
|
||||||
padding-top: 48px;
|
padding-top: 48px;
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { initializeAnalytics, OriginApplication, sendAnalyticsEvent, Trace, user } from '@uniswap/analytics'
|
import { initializeAnalytics, OriginApplication, sendAnalyticsEvent, Trace, user } from '@uniswap/analytics'
|
||||||
import { CustomUserProperties, EventName, getBrowser, PageName } from '@uniswap/analytics-events'
|
import { CustomUserProperties, EventName, getBrowser, PageName } from '@uniswap/analytics-events'
|
||||||
import Loader from 'components/Loader'
|
import Loader from 'components/Loader'
|
||||||
|
import { MenuDropdown } from 'components/NavBar/MenuDropdown'
|
||||||
import TopLevelModals from 'components/TopLevelModals'
|
import TopLevelModals from 'components/TopLevelModals'
|
||||||
import { useFeatureFlagsIsLoaded } from 'featureFlags'
|
import { useFeatureFlagsIsLoaded } from 'featureFlags'
|
||||||
import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage'
|
import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage'
|
||||||
import ApeModeQueryParamReader from 'hooks/useApeModeQueryParamReader'
|
import ApeModeQueryParamReader from 'hooks/useApeModeQueryParamReader'
|
||||||
|
import { Box } from 'nft/components/Box'
|
||||||
import { CollectionPageSkeleton } from 'nft/components/collection/CollectionPageSkeleton'
|
import { CollectionPageSkeleton } from 'nft/components/collection/CollectionPageSkeleton'
|
||||||
import { AssetDetailsLoading } from 'nft/components/details/AssetDetailsLoading'
|
import { AssetDetailsLoading } from 'nft/components/details/AssetDetailsLoading'
|
||||||
import { ProfilePageLoadingSkeleton } from 'nft/components/profile/view/ProfilePageLoadingSkeleton'
|
import { ProfilePageLoadingSkeleton } from 'nft/components/profile/view/ProfilePageLoadingSkeleton'
|
||||||
@ -21,6 +23,7 @@ import { getCLS, getFCP, getFID, getLCP, Metric } from 'web-vitals'
|
|||||||
|
|
||||||
import { useAnalyticsReporter } from '../components/analytics'
|
import { useAnalyticsReporter } from '../components/analytics'
|
||||||
import ErrorBoundary from '../components/ErrorBoundary'
|
import ErrorBoundary from '../components/ErrorBoundary'
|
||||||
|
import { PageTabs } from '../components/NavBar'
|
||||||
import NavBar from '../components/NavBar'
|
import NavBar from '../components/NavBar'
|
||||||
import Polling from '../components/Polling'
|
import Polling from '../components/Polling'
|
||||||
import Popups from '../components/Popups'
|
import Popups from '../components/Popups'
|
||||||
@ -83,6 +86,25 @@ const BodyWrapper = styled.div`
|
|||||||
`};
|
`};
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const MobileBottomBar = styled.div`
|
||||||
|
z-index: ${Z_INDEX.sticky};
|
||||||
|
position: sticky;
|
||||||
|
display: flex;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100vw;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 4px 8px;
|
||||||
|
height: ${({ theme }) => theme.mobileBottomBarHeight}px;
|
||||||
|
background: ${({ theme }) => theme.backgroundSurface};
|
||||||
|
border-top: 1px solid ${({ theme }) => theme.backgroundOutline};
|
||||||
|
|
||||||
|
@media screen and (min-width: ${({ theme }) => theme.breakpoint.md}px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
const HeaderWrapper = styled.div<{ transparent?: boolean }>`
|
const HeaderWrapper = styled.div<{ transparent?: boolean }>`
|
||||||
${flexRowNoWrap};
|
${flexRowNoWrap};
|
||||||
background-color: ${({ theme, transparent }) => !transparent && theme.backgroundSurface};
|
background-color: ${({ theme, transparent }) => !transparent && theme.backgroundSurface};
|
||||||
@ -303,6 +325,12 @@ export default function App() {
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
<Marginer />
|
<Marginer />
|
||||||
</BodyWrapper>
|
</BodyWrapper>
|
||||||
|
<MobileBottomBar>
|
||||||
|
<PageTabs />
|
||||||
|
<Box marginY="4">
|
||||||
|
<MenuDropdown />
|
||||||
|
</Box>
|
||||||
|
</MobileBottomBar>
|
||||||
</Trace>
|
</Trace>
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
@ -165,7 +165,7 @@ function WrongNetworkCard() {
|
|||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div style={{ height: '100vh' }}>
|
||||||
<PageWrapper>
|
<PageWrapper>
|
||||||
<AutoColumn gap="lg" justify="center">
|
<AutoColumn gap="lg" justify="center">
|
||||||
<AutoColumn gap="lg" style={{ width: '100%' }}>
|
<AutoColumn gap="lg" style={{ width: '100%' }}>
|
||||||
@ -189,7 +189,7 @@ function WrongNetworkCard() {
|
|||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
<SwitchLocaleLink />
|
<SwitchLocaleLink />
|
||||||
</>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ export default function Pool() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Trace page={PageName.POOL_PAGE} shouldLogImpression>
|
<Trace page={PageName.POOL_PAGE} shouldLogImpression>
|
||||||
<>
|
<div style={{ height: '100vh' }}>
|
||||||
<PageWrapper>
|
<PageWrapper>
|
||||||
<AutoColumn gap="lg" justify="center">
|
<AutoColumn gap="lg" justify="center">
|
||||||
<AutoColumn gap="lg" style={{ width: '100%' }}>
|
<AutoColumn gap="lg" style={{ width: '100%' }}>
|
||||||
@ -342,7 +342,7 @@ export default function Pool() {
|
|||||||
</AutoColumn>
|
</AutoColumn>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
<SwitchLocaleLink />
|
<SwitchLocaleLink />
|
||||||
</>
|
</div>
|
||||||
</Trace>
|
</Trace>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user