Skip to content

Commit

Permalink
Add zIndex home page map
Browse files Browse the repository at this point in the history
  • Loading branch information
lubej committed Mar 3, 2023
1 parent 75ec499 commit 8022fce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/app/pages/HomePage/GraphTooltip/GraphTooltipMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ import { useNavigate } from 'react-router-dom'
import { RouteUtils } from '../../../utils/route-utils'
import { ParaTime } from '../../../../config'
import * as React from 'react'
import { zIndexHomePage } from '../index'

export const MobileBackdrop = styled(Box)(() => ({
position: 'fixed',
inset: 0,
backgroundColor: COLORS.black,
opacity: 0.3,
zIndex: 4,
zIndex: zIndexHomePage.mobileTooltip,
}))

export const MobileGraphTooltip = styled(Box)(({ theme }) => ({
Expand All @@ -28,7 +29,7 @@ export const MobileGraphTooltip = styled(Box)(({ theme }) => ({
left: 0,
right: 0,
height: 120,
zIndex: 4,
zIndex: zIndexHomePage.mobileTooltip,
'> button': {
position: 'fixed',
right: theme.spacing(2),
Expand Down
13 changes: 10 additions & 3 deletions src/app/pages/HomePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ import { ParaTimeSelectorStep } from './ParaTimeSelector/types'
import { MobileTooltipProvider, useMobileTooltip } from './providers/MobileTooltipProvider'
import { GraphTooltipMobile } from './GraphTooltip/GraphTooltipMobile'

export const zIndexHomePage = {
paraTimeSelector: 1,
searchInput: 2,
logo: 3,
mobileTooltip: 4,
}

const HomepageLayout = styled(Box)(({ theme }) => ({
position: 'relative',
display: 'flex',
Expand Down Expand Up @@ -51,7 +58,7 @@ const Content = styled(Box)(({ theme }) => ({
}))

const LogotypeBox = styled(Box)(({ theme }) => ({
zIndex: 3,
zIndex: zIndexHomePage.logo,
marginBottom: 40,
textAlign: 'center',
marginTop: 60,
Expand All @@ -62,7 +69,7 @@ const LogotypeBox = styled(Box)(({ theme }) => ({
}))

const SearchInputContainer = styled(Box)(({ theme }) => ({
zIndex: 2,
zIndex: zIndexHomePage.searchInput,
width: '100%',
[theme.breakpoints.up('md')]: {
width: 'auto',
Expand Down Expand Up @@ -133,7 +140,7 @@ const HomePageCmp: FC = () => {
</Box>
)}
</SearchInputContainer>
<Box sx={{ zIndex: 1 }}>
<Box sx={{ zIndex: zIndexHomePage.paraTimeSelector }}>
<ParaTimeSelector step={step} setStep={setStep} disabled={searchHasFocus} />
</Box>
</Content>
Expand Down

0 comments on commit 8022fce

Please sign in to comment.