Skip to content

Commit 1c57fd5

Browse files
hadzhehsenkioqq
authored andcommitted
fix(islamic-website): add & pass classname props to header
1 parent 02af546 commit 1c57fd5

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

apps/islamic-website/app/[locale]/layout.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CookieConsentModal } from '../../components/cookie-consent-modal/cookie
66
import { NextIntlClientProvider } from 'next-intl';
77
import { Container } from '@haqq/islamic-website-ui-kit';
88
import Script from 'next/script';
9-
import Header, { MobileHeader } from '../../components/header/header';
9+
import Header from '../../components/header/header';
1010
import { Footer } from '../../components/footer/footer';
1111
import { SOCIAL_LINKS } from '../../social-links';
1212
import { alexandriaFont, handjetFont, vcrFont } from '../../fonts';
@@ -80,12 +80,7 @@ export default async function LocaleLayout({
8080
<body className="bg-islamic-bg-black font-alexandria flex min-h-screen flex-col text-white antialiased">
8181
{isScamBannerShow && <ScamBanner />}
8282

83-
<div className="block lg:hidden">
84-
<MobileHeader locale={locale} isBannerVisible={isScamBannerShow} />
85-
</div>
86-
<div className="hidden lg:block">
87-
<Header locale={locale} isBannerVisible={isScamBannerShow} />
88-
</div>
83+
<Header locale={locale} isBannerVisible={isScamBannerShow} />
8984

9085
<main className="flex-1">{children}</main>
9186
<Footer socialLinks={SOCIAL_LINKS} />

apps/islamic-website/components/header/header.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,27 +156,39 @@ export function LanguageLink({
156156
export default function Header({
157157
isBannerVisible = false,
158158
locale,
159+
className,
159160
}: {
160161
isBannerVisible?: boolean;
161162
locale: LocaleType;
163+
className?: string;
162164
}) {
163165
const isTabletMedia = useMediaQuery({
164166
query: `(max-width: 1023px)`,
165167
});
166168

167169
return isTabletMedia ? (
168-
<MobileHeader locale={locale} isBannerVisible={isBannerVisible} />
170+
<MobileHeader
171+
className={className}
172+
locale={locale}
173+
isBannerVisible={isBannerVisible}
174+
/>
169175
) : (
170-
<DesktopHeader locale={locale} isBannerVisible={isBannerVisible} />
176+
<DesktopHeader
177+
className={className}
178+
locale={locale}
179+
isBannerVisible={isBannerVisible}
180+
/>
171181
);
172182
}
173183

174184
export function MobileHeader({
175185
isBannerVisible = false,
176186
locale,
187+
className,
177188
}: {
178189
isBannerVisible?: boolean;
179190
locale: LocaleType;
191+
className?: string;
180192
}) {
181193
const [isMobileMenuOpen, setIsMobileMenuOpened] = useState(false);
182194
const [isBlurred, setBlurred] = useState(false);
@@ -218,6 +230,7 @@ export function MobileHeader({
218230
isBannerVisible
219231
? 'h-[calc(72px+64px)] md:h-[calc(72px+40px)]'
220232
: 'h-[72px]',
233+
className,
221234
)}
222235
/>
223236
<header
@@ -287,9 +300,11 @@ export function MobileHeader({
287300
export function DesktopHeader({
288301
isBannerVisible = false,
289302
locale,
303+
className,
290304
}: {
291305
isBannerVisible?: boolean;
292306
locale: LocaleType;
307+
className?: string;
293308
}) {
294309
const [isBlurred, setBlurred] = useState(false);
295310

@@ -324,6 +339,7 @@ export function DesktopHeader({
324339
'transform-gpu transition-all duration-150 will-change-auto',
325340
isBlurred && 'translate-y-[-16px]',
326341
isBannerVisible ? 'top-[40px]' : 'top-[0px]',
342+
className,
327343
)}
328344
>
329345
<div className="pb-[10px] pt-[26px]">

0 commit comments

Comments
 (0)