-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
578 additions
and
118 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
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
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
69 changes: 20 additions & 49 deletions
69
src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.jsx
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,58 +1,29 @@ | ||
import React from "react"; | ||
|
||
import { LinkCollectionModulePropTypes } from "./LinkCollectionModulePropTypes"; | ||
import Button from "../../Button"; | ||
import Constraint from "../../Constraint"; | ||
import LinkCollectionWithImage from "../../LinkCollectionWithImage"; | ||
import Section from "../../Section"; | ||
|
||
import "./LinkCollectionModule.css"; | ||
|
||
const LinkCollectionModule = ({ links, heading, image }) => { | ||
if (image) { | ||
return ( | ||
<Section className="BeVigilantSection"> | ||
<Constraint> | ||
<LinkCollectionWithImage image={image} title={heading}> | ||
{links.map(({ id, url, label }) => { | ||
if (!label || !url) { | ||
return null; | ||
} | ||
return ( | ||
<li key={id}> | ||
<Button endIcon={`arrow-blue`} to={url} color={`transparent`}> | ||
{label} | ||
</Button> | ||
</li> | ||
); | ||
})} | ||
</LinkCollectionWithImage> | ||
</Constraint> | ||
</Section> | ||
); | ||
import { | ||
LinkCollectionModuleDefaultProps, | ||
LinkCollectionModulePropTypes, | ||
} from "./LinkCollectionModulePropTypes"; | ||
import LcmWithImage from "./variants/LcmWithImage"; | ||
import LcmDefault from "./variants/LcmDefault"; | ||
import LcmLightBlocks from "./variants/LcmLightBlocks"; | ||
|
||
const LinkCollectionModule = (props) => { | ||
const { variant } = props; | ||
|
||
if (variant === `with-image`) { | ||
return <LcmWithImage {...props} />; | ||
} | ||
|
||
if (variant === `light-blocks`) { | ||
return <LcmLightBlocks {...props} />; | ||
} | ||
return ( | ||
<section className="LinkCollectionModule"> | ||
{!!heading && <h2 className="LinkCollectionModule__title">{heading}</h2>} | ||
<ul className="LinkCollectionModule__button-list"> | ||
{links.map((link) => { | ||
return ( | ||
<li key={link.id}> | ||
<Button endIcon={`arrow-white`} to={link.url} color={`primary`}> | ||
{link.label} | ||
</Button> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</section> | ||
); | ||
|
||
return <LcmDefault {...props} />; | ||
}; | ||
|
||
LinkCollectionModule.propTypes = LinkCollectionModulePropTypes; | ||
|
||
LinkCollectionModule.defaultProps = { | ||
title: ``, | ||
}; | ||
LinkCollectionModule.defaultProps = LinkCollectionModuleDefaultProps; | ||
|
||
export default LinkCollectionModule; |
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
11 changes: 9 additions & 2 deletions
11
src/components/ContentfulModule/LinkCollectionModule/index.js
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,4 +1,11 @@ | ||
import LinkCollectionModule from "./LinkCollectionModule"; | ||
import { LinkCollectionModulePropTypes } from "./LinkCollectionModulePropTypes"; | ||
import { | ||
LinkCollectionModulePropTypes, | ||
LinkCollectionModuleDefaultProps, | ||
} from "./LinkCollectionModulePropTypes"; | ||
|
||
export { LinkCollectionModule, LinkCollectionModulePropTypes }; | ||
export { | ||
LinkCollectionModule, | ||
LinkCollectionModulePropTypes, | ||
LinkCollectionModuleDefaultProps, | ||
}; |
2 changes: 1 addition & 1 deletion
2
...CollectionModule/LinkCollectionModule.css → ...kCollectionModule/variants/LcmDefault.css
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,4 +1,4 @@ | ||
.LinkCollectionModule { | ||
.LcmDefault { | ||
margin: var(--s__main-padding) 0; | ||
overflow: hidden; | ||
width: 100%; | ||
|
34 changes: 34 additions & 0 deletions
34
src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.jsx
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
|
||
import Button from "../../../Button"; | ||
import { | ||
LinkCollectionModuleDefaultProps, | ||
LinkCollectionModulePropTypes, | ||
} from "../LinkCollectionModulePropTypes"; | ||
|
||
import "./LcmDefault.css"; | ||
|
||
const LcmDefault = ({ heading, links }) => { | ||
return ( | ||
<section className="LcmDefault"> | ||
{!!heading && <h2 className="LcmDefault__title">{heading}</h2>} | ||
<ul className="LcmDefault__button-list"> | ||
{links.map((link) => { | ||
return ( | ||
<li key={link.id}> | ||
<Button endIcon={`arrow-white`} to={link.url} color={`primary`}> | ||
{link.label} | ||
</Button> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</section> | ||
); | ||
}; | ||
|
||
LcmDefault.propTypes = LinkCollectionModulePropTypes; | ||
|
||
LcmDefault.defaultProps = LinkCollectionModuleDefaultProps; | ||
|
||
export default LcmDefault; |
62 changes: 62 additions & 0 deletions
62
src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.css
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.LcmLightBlocks { | ||
margin: var(--s__main-padding) 0; | ||
overflow: hidden; | ||
width: 100%; | ||
|
||
&__heading { | ||
font-size: 1.8rem; | ||
margin: 0; | ||
} | ||
|
||
&__button-list { | ||
display: flex; | ||
flex-direction: column; | ||
font-size: var(--fs__h5); | ||
gap: calc(var(--s__unit) * 6); | ||
list-style: none; | ||
padding: 0; | ||
|
||
li { | ||
width: 100%; | ||
} | ||
|
||
.Button { | ||
border-radius: var(--s__alt-border-radius); | ||
box-sizing: border-box; | ||
height: 100%; | ||
justify-content: center; | ||
padding: calc(var(--s__unit) * 6); | ||
text-align: center; | ||
text-transform: none; | ||
width: 100%; | ||
|
||
&::after { | ||
display: none; | ||
} | ||
} | ||
} | ||
|
||
@media (min-width: 60rem) { | ||
&__heading { | ||
font-size: var(--fs__h3); | ||
} | ||
|
||
&__button-list { | ||
flex-direction: row; | ||
font-size: 1.5rem; | ||
justify-content: space-between; | ||
|
||
> * { | ||
flex: 1; | ||
} | ||
} | ||
|
||
.Button { | ||
box-shadow: none; | ||
|
||
.Icon { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.jsx
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
|
||
import Button from "../../../Button"; | ||
import Constraint from "../../../Constraint"; | ||
import Section from "../../../Section"; | ||
import { | ||
LinkCollectionModuleDefaultProps, | ||
LinkCollectionModulePropTypes, | ||
} from "../LinkCollectionModulePropTypes"; | ||
|
||
import "./LcmLightBlocks.css"; | ||
|
||
const LcmLightBlocks = ({ heading, subheading, links }) => { | ||
console.log({ links }); | ||
return ( | ||
<Section className="LcmLightBlocks"> | ||
<Constraint> | ||
{!!heading && <h2 className="LcmLightBlocks__heading">{heading}</h2>} | ||
{!!subheading && ( | ||
<p className="LcmLightBlocks__subheading">{subheading}</p> | ||
)} | ||
<ul className="LcmLightBlocks__button-list"> | ||
{links.map((link) => { | ||
return ( | ||
<li key={link.id}> | ||
<Button to={link.url} color={`tertiary`}> | ||
{link.label} | ||
</Button> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</Constraint> | ||
</Section> | ||
); | ||
}; | ||
|
||
LcmLightBlocks.propTypes = LinkCollectionModulePropTypes; | ||
|
||
LcmLightBlocks.defaultProps = LinkCollectionModuleDefaultProps; | ||
|
||
export default LcmLightBlocks; |
Oops, something went wrong.