Skip to content

Commit

Permalink
Merge pull request #731 from cowprotocol/release/1.16-fix
Browse files Browse the repository at this point in the history
[RELEASE 1.16.0] FIX
  • Loading branch information
fairlighteth authored Jun 22, 2022
2 parents 5f583d0 + 0b84541 commit d2fc26a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/custom/components/Header/MobileMenuIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ interface IconProps {
width?: number
height?: number
lineSize?: number
onTouchStart?: () => void
onClick?: () => void
}

Expand Down
11 changes: 1 addition & 10 deletions src/custom/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export default function Header() {
const isUpToSmall = useMediaQuery(upToSmall)
const isLargeAndUp = useMediaQuery(LargeAndUp)

const [isTouch, setIsTouch] = useState<boolean>(false)
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
const handleMobileMenuOnClick = useCallback(() => {
isUpToLarge && setIsMobileMenuOpen(!isMobileMenuOpen)
Expand All @@ -94,8 +93,6 @@ export default function Header() {
// This removes the inner scrollbar on the page body, to prevent showing double scrollbars.
useEffect(() => {
isMobileMenuOpen ? addBodyClass('noScroll') : removeBodyClass('noScroll')
// Set if device has touch capabilities
setIsTouch('ontouchstart' in document.documentElement)
}, [isOrdersPanelOpen, isMobileMenuOpen, isUpToLarge, isUpToMedium, isUpToSmall, isLargeAndUp])

return (
Expand Down Expand Up @@ -137,13 +134,7 @@ export default function Header() {
</HeaderElement>
</HeaderControls>

{isUpToLarge && (
<MobileMenuIcon
isMobileMenuOpen={isMobileMenuOpen}
onTouchStart={handleMobileMenuOnClick}
onClick={isTouch ? undefined : handleMobileMenuOnClick} // Disable onClick on touch devices and use onTouchStart
/>
)}
{isUpToLarge && <MobileMenuIcon isMobileMenuOpen={isMobileMenuOpen} onClick={handleMobileMenuOnClick} />}
{isOrdersPanelOpen && <OrdersPanel handleCloseOrdersPanel={handleCloseOrdersPanel} />}
</HeaderModWrapper>
</Wrapper>
Expand Down
4 changes: 4 additions & 0 deletions src/custom/theme/baseTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ export const ThemedGlobalStyle = createGlobalStyle`
right: initial!important;
position: fixed!important;
}
body.noScroll div[id^='appzi-wfo-'] {
display: none!important;
}
`}
// START - Modal overrides
Expand Down

0 comments on commit d2fc26a

Please sign in to comment.