-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(storefront): add CSS tokens and clean code for layouts (#796)
- Loading branch information
Showing
18 changed files
with
220 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
storefront/layouts/FrontpageLayout/FrontpageLayout.module.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,11 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
Section, | ||
NavigationCard, | ||
Banner, | ||
ImageSection, | ||
} from '../../components'; | ||
import type { NavigationCardProps, ImageSectionProps } from '../../components'; | ||
|
||
interface FrontpageLayoutProps { | ||
Content: React.ReactNode; | ||
data: FrontpageData; | ||
} | ||
|
||
interface FrontpageData { | ||
title: string; | ||
description: string; | ||
navigationCards: { | ||
title: string; | ||
description: string; | ||
items: []; | ||
}; | ||
contributeSection: ImageSectionProps; | ||
} | ||
|
||
const FrontpageLayout = ({ Content, data }: FrontpageLayoutProps) => { | ||
return ( | ||
<main id='main'> | ||
{Content} | ||
<div className='max-width-container main'> | ||
<Banner | ||
title={data.title} | ||
desc={data.description} | ||
/> | ||
|
||
<Section title={data.navigationCards.title}> | ||
{data.navigationCards.items.map( | ||
(item: NavigationCardProps, index: number) => ( | ||
<NavigationCard | ||
key={index} | ||
url={item.url} | ||
title={item.title} | ||
color={item.color} | ||
icon={item.icon} | ||
description={item.description} | ||
/> | ||
), | ||
)} | ||
</Section> | ||
type FrontpageLayoutProps = { | ||
content: React.ReactNode; | ||
}; | ||
|
||
<ImageSection | ||
title={data.contributeSection.title} | ||
description={data.contributeSection.description} | ||
imgSrc={data.contributeSection.imgSrc} | ||
imgAlt={data.contributeSection.imgAlt} | ||
headingLevel={data.contributeSection.headingLevel} | ||
imgWidth={data.contributeSection.imgWidth} | ||
imgHeight={data.contributeSection.imgHeight} | ||
buttons={data.contributeSection.buttons} | ||
/> | ||
</div> | ||
</main> | ||
); | ||
const FrontpageLayout = ({ content }: FrontpageLayoutProps) => { | ||
return <main id='main'>{content}</main>; | ||
}; | ||
|
||
export { FrontpageLayout }; | ||
export type { FrontpageData }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.