Skip to content

Commit

Permalink
No sticky filter form on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Jan 9, 2025
1 parent ffddc21 commit a4638c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions components/SharedStyledComponents.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { twMerge } from 'tailwind-merge'

export const StyledSticky = ({ ...props }) => (
<div
className="sticky top-0 bg-white z-[99] border-b border-gray-300"
Expand All @@ -9,9 +11,12 @@ export const StyledStickyNavBar = ({ ...props }) => (
<div className="sticky top-0 z-[100]" {...props} />
)

export const StyledStickySubMenu = ({ topClass, ...props }) => (
export const StyledStickySubMenu = ({ className, ...props }) => (
<div
className={`${topClass ? topClass : 'top-[62px]'} sticky bg-white z-[99] border-b border-gray-300 md:mt-8 mb-2 pb-2 md:pb-0`}
className={twMerge(
'top-[62px] sticky bg-white z-[99] border-b border-gray-300 md:mt-8 mb-2 pb-2 md:pb-0',
className,
)}
{...props}
/>
)
Expand All @@ -34,7 +39,7 @@ export const StickySubMenuUpdated = ({ title, menu, topClass, ...props }) => {

export const StickySubMenu = ({ title, children, topClass }) => {
return (
<StyledStickySubMenu topClass={topClass}>
<StyledStickySubMenu className={topClass}>
<div className="flex justify-between items-start md:items-center flex-col md:flex-row">
<h1 className="mt-1">{title}</h1>
{children}
Expand Down
2 changes: 1 addition & 1 deletion components/ThematicPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const ThematicPage = ({
<AnchorLink id="reports" />
<ReportsSection title={reportsTitle} reports={reports} theme={theme} />

<StyledStickySubMenu topClass="top-[193px]">
<StyledStickySubMenu className="top-[193px] max-sm:static">
<div className="pb-4 pt-2">
<Form
countries={countries}
Expand Down

0 comments on commit a4638c0

Please sign in to comment.