File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type { FooterProps } from './footer';
44import { Footer } from './footer' ;
55import { SimpleFooter } from './footer/simple-footer' ;
66import { Header } from './header' ;
7+ import { TopBanner } from './top-banner' ;
78
89interface LayoutProps extends Pick < FooterProps , 'withoutNewsletter' > {
910 isNavigationEnabled ?: boolean ;
@@ -16,8 +17,16 @@ export const Layout = ({
1617 children,
1718 withoutNewsletter,
1819} : Component < LayoutProps > ) => {
20+ // Define banner content here - set to null to hide the banner
21+ const bannerContent = (
22+ < p >
23+ < strong > 50% off annual Pro accounts until Cyber Monday</ strong > , with coupon BLACKFRIDAY25
24+ </ p >
25+ ) ;
26+
1927 return (
2028 < >
29+ { bannerContent && < TopBanner > { bannerContent } </ TopBanner > }
2130 < Header isNavigationEnabled = { isNavigationEnabled } />
2231 < Suspense >
2332 < main id = "main-content" > { children } </ main >
Original file line number Diff line number Diff line change 1+ import { StyledTopBanner , StyledTopBannerContainer } from './top-banner.styles' ;
2+ import type { TopBannerProps } from './top-banner.types' ;
3+
4+ export const TopBanner = ( { children } : TopBannerProps ) => {
5+ return (
6+ < StyledTopBanner >
7+ < StyledTopBannerContainer > { children } </ StyledTopBannerContainer >
8+ </ StyledTopBanner >
9+ ) ;
10+ } ;
Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
3+ import { Container } from '@/components/elements/container' ;
4+ import { styled } from '@/styles' ;
5+
6+ export const StyledTopBanner = styled . div `
7+ background-color: #000;
8+ color: ${ ( { theme } ) => theme . colors . text . alwayWhite } ;
9+ width: 100%;
10+ ` ;
11+
12+ export const StyledTopBannerContainer = styled ( Container ) `
13+ &&& {
14+ display: flex;
15+ align-items: center;
16+ justify-content: center;
17+ padding-top: 12px;
18+ padding-bottom: 12px;
19+ text-align: center;
20+ }
21+ ` ;
Original file line number Diff line number Diff line change 1+ export interface TopBannerProps extends Component { }
You can’t perform that action at this time.
0 commit comments