diff --git a/src/components/AdditionalNavigation/AdditionalNavigation.js b/src/components/AdditionalNavigation/AdditionalNavigation.js index 11a6f8cb..bb286906 100644 --- a/src/components/AdditionalNavigation/AdditionalNavigation.js +++ b/src/components/AdditionalNavigation/AdditionalNavigation.js @@ -9,7 +9,11 @@ import "./AdditionalNavigation.css"; const AdditionalNavigation = () => { const { pathname } = useLocation(); - const additionalNavigationArray = ADDITIONAL_NAVIGATION[pathname]; + const pathnameWithoutTrailingSlash = pathname.endsWith(`/`) + ? pathname.slice(0, -1) + : pathname; + const additionalNavigationArray = + ADDITIONAL_NAVIGATION[pathnameWithoutTrailingSlash]; return ( <> diff --git a/src/components/Button/Button.css b/src/components/Button/Button.css index aea5302c..e9b3582e 100644 --- a/src/components/Button/Button.css +++ b/src/components/Button/Button.css @@ -90,6 +90,16 @@ } } + &--tertiary { + background: #eaf1ff; + + &:hover { + &::after { + display: none; + } + } + } + .Icon { --icon-size: 20px; diff --git a/src/components/ContentfulModule/ChipModule/ChipModule.jsx b/src/components/ContentfulModule/ChipModule/ChipModule.jsx index 0cd49644..6b1027b2 100644 --- a/src/components/ContentfulModule/ChipModule/ChipModule.jsx +++ b/src/components/ContentfulModule/ChipModule/ChipModule.jsx @@ -23,5 +23,6 @@ export const query = graphql` chips { ...ChipFragment } + fullWidth } `; diff --git a/src/components/ContentfulModule/ContentfulModule.jsx b/src/components/ContentfulModule/ContentfulModule.jsx index 74f9af9c..94829140 100644 --- a/src/components/ContentfulModule/ContentfulModule.jsx +++ b/src/components/ContentfulModule/ContentfulModule.jsx @@ -12,6 +12,7 @@ import { HelpSearch } from "../HelpSearch"; import { PartnersModule } from "./PartnersModule"; import { FaqCategoriesModule } from "./FaqCategoriesModule"; import { PromotionBannerModule } from "./PromotionBannerModule"; +import { StepsModule } from "./StepsModule"; const ContentfulModule = ({ module, pathname }) => { const type = module?.internal?.type || ``; @@ -60,6 +61,10 @@ const ContentfulModule = ({ module, pathname }) => { return ; } + if (type === `ContentfulStepsModule`) { + return ; + } + return null; }; diff --git a/src/components/ContentfulModule/ContentfulModulePropTypes.js b/src/components/ContentfulModule/ContentfulModulePropTypes.js index d556c091..ad34fd3a 100644 --- a/src/components/ContentfulModule/ContentfulModulePropTypes.js +++ b/src/components/ContentfulModule/ContentfulModulePropTypes.js @@ -12,6 +12,7 @@ import { HelpSearchPropTypes } from "../HelpSearch"; import { PartnersModulePropTypes } from "./PartnersModule"; import { FaqCategoriesModulePropTypes } from "./FaqCategoriesModule"; import { PromotionBannerModulePropTypes } from "./PromotionBannerModule"; +import { StepsModulePropTypes } from "./StepsModule"; const ContentfulModulePropTypes = PropTypes.oneOfType([ PropTypes.shape(EventsModulePropTypes), @@ -24,6 +25,7 @@ const ContentfulModulePropTypes = PropTypes.oneOfType([ PropTypes.shape(PartnersModulePropTypes), PropTypes.shape(FaqCategoriesModulePropTypes), PropTypes.shape(PromotionBannerModulePropTypes), + PropTypes.shape(StepsModulePropTypes), ]); export default ContentfulModulePropTypes; diff --git a/src/components/ContentfulModule/EventsModule/EventsModule.jsx b/src/components/ContentfulModule/EventsModule/EventsModule.jsx index 32c8556f..90c46377 100644 --- a/src/components/ContentfulModule/EventsModule/EventsModule.jsx +++ b/src/components/ContentfulModule/EventsModule/EventsModule.jsx @@ -1,12 +1,16 @@ import React from "react"; +import classNames from "classnames"; + import { EventsModulePropTypes } from "./EventsModulePropTypes"; import EventCardList from "./EventCardList"; import EventCard from "./EventCard"; import DetailsWrapper from "../../DetailsWrapper"; +import Constraint from "../../Constraint"; + import { getTranslatedText } from "../../../utils/getTranslatedText"; import { graphql } from "gatsby"; -const EventsModule = ({ events, locale }) => { +const EventsModule = ({ events, locale, fullWidth }) => { const currentDate = new Date(); const upcomingEvents = []; const previousEvents = []; @@ -36,38 +40,40 @@ const EventsModule = ({ events, locale }) => { starredEvents.forEach(categorizeEvent); return ( -
-

{getTranslatedText(`events.upcomingEvents`)}

- - {upcomingEvents.length ? ( - upcomingEvents.map((event, i) => { - return ; - }) - ) : ( -

{getTranslatedText(`events.noEvents`)}

- )} -
+ +
+

{getTranslatedText(`events.upcomingEvents`)}

+ + {upcomingEvents.length ? ( + upcomingEvents.map((event, i) => { + return ; + }) + ) : ( +

{getTranslatedText(`events.noEvents`)}

+ )} +
- {!!previousEvents.length && ( - - - {previousEvents.map((event, i) => { - return ( - - ); - })} - - - )} -
+ {!!previousEvents.length && ( + + + {previousEvents.map((event, i) => { + return ( + + ); + })} + + + )} +
+ ); }; @@ -80,5 +86,6 @@ export const query = graphql` events { ...EventItemFragment } + fullWidth } `; diff --git a/src/components/ContentfulModule/EventsModule/EventsModulePropTypes.js b/src/components/ContentfulModule/EventsModule/EventsModulePropTypes.js index f8e5d431..e7f170e1 100644 --- a/src/components/ContentfulModule/EventsModule/EventsModulePropTypes.js +++ b/src/components/ContentfulModule/EventsModule/EventsModulePropTypes.js @@ -20,6 +20,7 @@ const EventsModulePropTypes = { type: PropTypes.string.isRequired, }).isRequired, events: PropTypes.arrayOf(PropTypes.shape(EventItemPropTypes)), + fullWidth: PropTypes.bool, }; const EventsModuleDefaultProps = { @@ -36,6 +37,7 @@ const EventsModuleDefaultProps = { eventUrl: ``, }, ], + fullWidth: false, }; export { EventsModuleDefaultProps, EventsModulePropTypes, EventItemPropTypes }; diff --git a/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModule.jsx b/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModule.jsx index 5e1d0ca4..188c2b12 100644 --- a/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModule.jsx +++ b/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModule.jsx @@ -1,20 +1,34 @@ import React from "react"; +import classNames from "classnames"; import { FaqNav } from "../../Faq"; import Section from "../../Section"; import Constraint from "../../Constraint"; import Link from "../../Link"; -import { getTranslatedText } from "../../../utils/getTranslatedText"; import Icon from "../../Icon"; +import { getTranslatedText } from "../../../utils/getTranslatedText"; import "./FaqCategoriesModule.css"; -import { FaqCategoriesModulePropTypes } from "./FaqCategoriesModulePropTypes"; import { graphql } from "gatsby"; -const FaqCategoriesModule = ({ heading, seeAllLink, categories, pathname }) => { +import "./FaqCategoriesModule.css"; +import { + FaqCategoriesModuleDefaultProps, + FaqCategoriesModulePropTypes, +} from "./FaqCategoriesModulePropTypes"; + +const FaqCategoriesModule = ({ + heading, + seeAllLink, + categories, + pathname, + fullWidth, +}) => { return (
- + {heading &&

{heading}

} { FaqCategoriesModule.propTypes = FaqCategoriesModulePropTypes; +FaqCategoriesModule.defaultProps = FaqCategoriesModuleDefaultProps; + export default FaqCategoriesModule; export const query = graphql` @@ -49,5 +65,6 @@ export const query = graphql` pageHeading iconType } + fullWidth } `; diff --git a/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModulePropTypes.js b/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModulePropTypes.js index f61d5600..073eb496 100644 --- a/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModulePropTypes.js +++ b/src/components/ContentfulModule/FaqCategoriesModule/FaqCategoriesModulePropTypes.js @@ -6,6 +6,14 @@ const FaqCategoriesModulePropTypes = { seeAllLink: PropTypes.string, categories: FaqCategoriesPropType.isRequired, pathname: PropTypes.string, + fullWidth: PropTypes.bool, }; -export { FaqCategoriesModulePropTypes }; +const FaqCategoriesModuleDefaultProps = { + heading: ``, + seeAllLink: ``, + pathname: ``, + fullWidth: false, +}; + +export { FaqCategoriesModulePropTypes, FaqCategoriesModuleDefaultProps }; diff --git a/src/components/ContentfulModule/FaqCategoriesModule/index.js b/src/components/ContentfulModule/FaqCategoriesModule/index.js index 788cf6e7..895a9c5d 100644 --- a/src/components/ContentfulModule/FaqCategoriesModule/index.js +++ b/src/components/ContentfulModule/FaqCategoriesModule/index.js @@ -1,4 +1,11 @@ import FaqCategoriesModule from "./FaqCategoriesModule"; -import { FaqCategoriesModulePropTypes } from "./FaqCategoriesModulePropTypes"; +import { + FaqCategoriesModulePropTypes, + FaqCategoriesModuleDefaultProps, +} from "./FaqCategoriesModulePropTypes"; -export { FaqCategoriesModule, FaqCategoriesModulePropTypes }; +export { + FaqCategoriesModule, + FaqCategoriesModulePropTypes, + FaqCategoriesModuleDefaultProps, +}; diff --git a/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.jsx b/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.jsx index 84617c3d..74558ccc 100644 --- a/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.jsx +++ b/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.jsx @@ -1,60 +1,31 @@ import React from "react"; +import { graphql } from "gatsby"; -import { LinkCollectionModulePropTypes } from "./LinkCollectionModulePropTypes"; -import Button from "../../Button"; -import Constraint from "../../Constraint"; -import LinkCollectionWithImage from "../../LinkCollectionWithImage"; -import Section from "../../Section"; +import { + LinkCollectionModuleDefaultProps, + LinkCollectionModulePropTypes, +} from "./LinkCollectionModulePropTypes"; +import LcmWithImage from "./variants/LcmWithImage"; +import LcmDefault from "./variants/LcmDefault"; +import LcmLightBlocks from "./variants/LcmLightBlocks"; -import "./LinkCollectionModule.css"; -import { graphql } from "gatsby"; +const LinkCollectionModule = (props) => { + const { variant } = props; + + if (variant === `with-image`) { + return ; + } -const LinkCollectionModule = ({ links, heading, image }) => { - if (image) { - return ( -
- - - {links.map(({ id, url, label }) => { - if (!label || !url) { - return null; - } - return ( -
  • - -
  • - ); - })} -
    -
    -
    - ); + if (variant === `light-blocks`) { + return ; } - return ( -
    - {!!heading &&

    {heading}

    } -
      - {links.map((link) => { - return ( -
    • - -
    • - ); - })} -
    -
    - ); + + return ; }; LinkCollectionModule.propTypes = LinkCollectionModulePropTypes; -LinkCollectionModule.defaultProps = { - title: ``, -}; +LinkCollectionModule.defaultProps = LinkCollectionModuleDefaultProps; export default LinkCollectionModule; @@ -69,6 +40,8 @@ export const query = graphql` placeholder: BLURRED ) } + fullWidth + variant links { ...LinkFragment } diff --git a/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModulePropTypes.js b/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModulePropTypes.js index 5dd5a080..9cb93b41 100644 --- a/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModulePropTypes.js +++ b/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModulePropTypes.js @@ -1,7 +1,9 @@ import PropTypes from "prop-types"; const LinkCollectionModulePropTypes = { - title: PropTypes.string, + heading: PropTypes.string, + subheading: PropTypes.string, + variant: PropTypes.oneOf([`default`, `light-blocks`, `with-image`]), links: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.string.isRequired, @@ -9,6 +11,14 @@ const LinkCollectionModulePropTypes = { url: PropTypes.string.isRequired, }) ).isRequired, + fullWidth: PropTypes.bool, }; -export { LinkCollectionModulePropTypes }; +const LinkCollectionModuleDefaultProps = { + heading: ``, + subheading: ``, + variant: `default`, + fullWidth: false, +}; + +export { LinkCollectionModulePropTypes, LinkCollectionModuleDefaultProps }; diff --git a/src/components/ContentfulModule/LinkCollectionModule/index.js b/src/components/ContentfulModule/LinkCollectionModule/index.js index 675c65f8..b60271ee 100644 --- a/src/components/ContentfulModule/LinkCollectionModule/index.js +++ b/src/components/ContentfulModule/LinkCollectionModule/index.js @@ -1,4 +1,11 @@ import LinkCollectionModule from "./LinkCollectionModule"; -import { LinkCollectionModulePropTypes } from "./LinkCollectionModulePropTypes"; +import { + LinkCollectionModulePropTypes, + LinkCollectionModuleDefaultProps, +} from "./LinkCollectionModulePropTypes"; -export { LinkCollectionModule, LinkCollectionModulePropTypes }; +export { + LinkCollectionModule, + LinkCollectionModulePropTypes, + LinkCollectionModuleDefaultProps, +}; diff --git a/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.css b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.css similarity index 98% rename from src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.css rename to src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.css index d0eb5bdb..b8a31fae 100644 --- a/src/components/ContentfulModule/LinkCollectionModule/LinkCollectionModule.css +++ b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.css @@ -1,4 +1,4 @@ -.LinkCollectionModule { +.LcmDefault { margin: var(--s__main-padding) 0; overflow: hidden; width: 100%; diff --git a/src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.jsx b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.jsx new file mode 100644 index 00000000..859071f5 --- /dev/null +++ b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmDefault.jsx @@ -0,0 +1,38 @@ +import React from "react"; +import classNames from "classnames"; + +import Button from "../../../Button"; +import { + LinkCollectionModuleDefaultProps, + LinkCollectionModulePropTypes, +} from "../LinkCollectionModulePropTypes"; +import Constraint from "../../../Constraint"; + +import "./LcmDefault.css"; + +const LcmDefault = ({ heading, links, fullWidth }) => { + return ( + +
    + {!!heading &&

    {heading}

    } +
      + {links.map((link) => { + return ( +
    • + +
    • + ); + })} +
    +
    +
    + ); +}; + +LcmDefault.propTypes = LinkCollectionModulePropTypes; + +LcmDefault.defaultProps = LinkCollectionModuleDefaultProps; + +export default LcmDefault; diff --git a/src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.css b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.css new file mode 100644 index 00000000..e98ce70b --- /dev/null +++ b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.css @@ -0,0 +1,67 @@ +.LcmLightBlocks { + margin: var(--s__main-padding) 0; + overflow: hidden; + width: 100%; + + /* @todo: this is a temporary solution for quickly adding padding */ + &--with-padding { + padding: var(--s__alt-padding) 0; + } + + &__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; + } + } + } +} diff --git a/src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.jsx b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.jsx new file mode 100644 index 00000000..31c74a75 --- /dev/null +++ b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmLightBlocks.jsx @@ -0,0 +1,50 @@ +import classNames from "classnames"; +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, + className, + fullWidth, +}) => { + return ( +
    + + {!!heading &&

    {heading}

    } + {!!subheading && ( +

    {subheading}

    + )} +
      + {links.map((link) => { + return ( +
    • + +
    • + ); + })} +
    +
    +
    + ); +}; + +LcmLightBlocks.propTypes = LinkCollectionModulePropTypes; + +LcmLightBlocks.defaultProps = LinkCollectionModuleDefaultProps; + +export default LcmLightBlocks; diff --git a/src/components/ContentfulModule/LinkCollectionModule/variants/LcmWithImage.css b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmWithImage.css new file mode 100644 index 00000000..1fea6d81 --- /dev/null +++ b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmWithImage.css @@ -0,0 +1,116 @@ +.LcmWithImage { + background-color: #f6f6f6; + + &__text { + margin-bottom: calc(var(--s__unit) * 10); + padding-top: calc(var(--s__unit) * 10); + } + + &__title { + font-size: var(--fs__h4); + margin: 0; + margin-bottom: calc(var(--s__unit) * 10); + } + + &__button-list { + display: flex; + flex-direction: column; + font-size: 1.25rem; + list-style: none; + padding: 0; + + li { + padding: var(--s__main-padding) 0; + + &:first-of-type { + padding-top: 0; + } + + + li { + border-top: 1px solid #ececec; + } + } + } + + &__image { + .gatsby-image-wrapper { + height: 100%; + + /* Fuck this hack, but ok. */ + margin: 0 -16px; + width: 100%; + width: calc(100% + 32px); + } + } + + .Button { + border: none; + color: var(--c__main-color); + justify-content: space-between; + padding: 0; + text-transform: none; + + .Icon { + --icon-size: 32px; + + margin-left: var(--s__main-padding); + min-width: var(--icon-size); + } + + &:hover { + text-decoration: underline; + + &::after { + transform: none; + } + } + } + + @media (min-width: 40rem) { + &__section { + display: flex; + + > * { + flex: 1; + } + } + + &__text { + margin-bottom: 0; + padding-right: var(--s__main-padding); + padding-top: calc(var(--s__alt-padding) * 2); + } + + &__title { + font-size: var(--fs__h3); + margin-bottom: calc(var(--s__alt-padding) * 2); + } + + &__button-list { + font-size: 1.5rem; + + li { + padding: var(--s__alt-padding) 0; + + &:first-of-type { + padding-top: 0; + } + + + li { + border: none; + } + } + } + + &__image { + .gatsby-image-wrapper { + margin: unset; + width: 100%; + } + } + + .Button { + display: inline-flex; + } + } +} diff --git a/src/components/ContentfulModule/LinkCollectionModule/variants/LcmWithImage.jsx b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmWithImage.jsx new file mode 100644 index 00000000..10d73140 --- /dev/null +++ b/src/components/ContentfulModule/LinkCollectionModule/variants/LcmWithImage.jsx @@ -0,0 +1,56 @@ +import React from "react"; + +import Section from "../../../Section"; +import Constraint from "../../../Constraint"; +import Button from "../../../Button"; +import { GatsbyImage, getImage } from "gatsby-plugin-image"; +import { + LinkCollectionModuleDefaultProps, + LinkCollectionModulePropTypes, +} from "../LinkCollectionModulePropTypes"; + +import "./LcmWithImage.css"; + +const LcmWithImage = ({ heading, links, image }) => { + return ( +
    + +
    +
    + {!!heading &&

    {heading}

    } +
      + {links.map(({ id, url, label }) => { + if (!label || !url) { + return null; + } + return ( +
    • + +
    • + ); + })} +
    +
    + + {image && ( +
    + +
    + )} +
    +
    +
    + ); +}; + +LcmWithImage.propTypes = LinkCollectionModulePropTypes; + +LcmWithImage.defaultProps = LinkCollectionModuleDefaultProps; + +export default LcmWithImage; diff --git a/src/components/ContentfulModule/PartnersModule/PartnersModule.jsx b/src/components/ContentfulModule/PartnersModule/PartnersModule.jsx index 1f6f9cb8..c668daaa 100644 --- a/src/components/ContentfulModule/PartnersModule/PartnersModule.jsx +++ b/src/components/ContentfulModule/PartnersModule/PartnersModule.jsx @@ -1,4 +1,5 @@ import React from "react"; +import classNames from "classnames"; import PartnerList from "./PartnerList"; import Partner from "./Partner"; @@ -6,35 +7,38 @@ import { PartnersModuleDefaultProps, PartnersModulePropTypes, } from "./PartnersModulePropTypes"; +import Constraint from "../../Constraint"; import "./PartnersModule.css"; import { graphql } from "gatsby"; -const PartnersModule = ({ heading, partnerCollections }) => { +const PartnersModule = ({ heading, partnerCollections, fullWidth }) => { return ( -
    -

    {heading}

    + +
    +

    {heading}

    -
    - {partnerCollections.map((collection) => { - if (!collection?.partners?.at(0)) { - return null; - } - return ( -
    -

    - {collection.category} -

    - - {collection.partners.map((partner) => { - return ; - })} - -
    - ); - })} +
    + {partnerCollections.map((collection) => { + if (!collection?.partners?.at(0)) { + return null; + } + return ( +
    +

    + {collection.category} +

    + + {collection.partners.map((partner) => { + return ; + })} + +
    + ); + })} +
    -
    +
    ); }; @@ -63,5 +67,6 @@ export const query = graphql` } } } + fullWidth } `; diff --git a/src/components/ContentfulModule/PartnersModule/PartnersModulePropTypes.js b/src/components/ContentfulModule/PartnersModule/PartnersModulePropTypes.js index fe7b5d94..2af4bb90 100644 --- a/src/components/ContentfulModule/PartnersModule/PartnersModulePropTypes.js +++ b/src/components/ContentfulModule/PartnersModule/PartnersModulePropTypes.js @@ -15,10 +15,12 @@ const PartnersModulePropTypes = { partners: PropTypes.arrayOf(PropTypes.shape(PartnerPropTypes)), }) ), + fullWidth: PropTypes.bool, }; const PartnersModuleDefaultProps = { partnerCollections: [], + fullWidth: false, }; export { diff --git a/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModule.jsx b/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModule.jsx index d68f2763..3edadce4 100644 --- a/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModule.jsx +++ b/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModule.jsx @@ -11,6 +11,7 @@ import "./PromotionBannerModule.css"; import Thumbnail from "./Thumbnail"; import Organisation from "./ContentComponents/Organisation"; import EventItem from "./ContentComponents/EventItem"; +import classNames from "classnames"; import { graphql } from "gatsby"; const PromotionBannerModule = ({ @@ -18,10 +19,13 @@ const PromotionBannerModule = ({ thumbnail, thumbnailUrl, content, + fullWidth, }) => { return (
    - +
    @@ -75,5 +79,6 @@ export const query = graphql` ...OrganisationFragment } } + fullWidth } `; diff --git a/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModulePropTypes.js b/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModulePropTypes.js index 21cbdeb7..5fa34a8a 100644 --- a/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModulePropTypes.js +++ b/src/components/ContentfulModule/PromotionBannerModule/PromotionBannerModulePropTypes.js @@ -14,11 +14,13 @@ const PromotionBannerModulePropTypes = { PropTypes.shape(EventItemPropTypes), ]) ), + fullWidth: PropTypes.bool, }; const PromotionBannerModuleDefaultProps = { thumbnailUrl: ``, content: [], + fullWidth: false, }; export { PromotionBannerModuleDefaultProps, PromotionBannerModulePropTypes }; diff --git a/src/components/ContentfulModule/ResourceListModule/ResourceListModule.jsx b/src/components/ContentfulModule/ResourceListModule/ResourceListModule.jsx index 5104cf4d..b7d9d4f0 100644 --- a/src/components/ContentfulModule/ResourceListModule/ResourceListModule.jsx +++ b/src/components/ContentfulModule/ResourceListModule/ResourceListModule.jsx @@ -9,11 +9,11 @@ import { formatRichText } from "../../../helpers/formatting"; import ResourceItem from "./ResourceItem"; import { graphql } from "gatsby"; -const ResourceListModule = ({ heading, subheading, resources }) => { +const ResourceListModule = ({ heading, subheadingRich, resources }) => { return (
    {!!heading &&

    {heading}

    } - {subheading?.raw && formatRichText(subheading.raw)} + {subheadingRich?.raw && formatRichText(subheadingRich.raw)}
      {resources?.at(0) && resources.map((item) => { @@ -43,5 +43,6 @@ export const query = graphql` resources { ...ResourceItemFragment } + fullWidth } `; diff --git a/src/components/ContentfulModule/ResourceListModule/ResourceListModulePropTypes.js b/src/components/ContentfulModule/ResourceListModule/ResourceListModulePropTypes.js index 1d5eb814..dae0803b 100644 --- a/src/components/ContentfulModule/ResourceListModule/ResourceListModulePropTypes.js +++ b/src/components/ContentfulModule/ResourceListModule/ResourceListModulePropTypes.js @@ -10,7 +10,7 @@ const ResourceItemPropTypes = { const ResourceListModulePropTypes = { id: PropTypes.string.isRequired, heading: PropTypes.string, - subheading: PropTypes.shape({ + subheadingRich: PropTypes.shape({ raw: PropTypes.string, }), resources: PropTypes.arrayOf(PropTypes.shape(ResourceItemPropTypes)), @@ -18,7 +18,7 @@ const ResourceListModulePropTypes = { const ResourceListModuleDefaultProps = { heading: ``, - subheading: { + subheadingRich: { raw: ``, }, }; diff --git a/src/components/ContentfulModule/SlidingNavBlock/SlidingNavBlock.jsx b/src/components/ContentfulModule/SlidingNavBlock/SlidingNavBlock.jsx index f02cb978..09a13b6e 100644 --- a/src/components/ContentfulModule/SlidingNavBlock/SlidingNavBlock.jsx +++ b/src/components/ContentfulModule/SlidingNavBlock/SlidingNavBlock.jsx @@ -4,6 +4,7 @@ import "./SlidingNavBlock.css"; import Icon from "../../Icon"; import { ChipModule } from "../ChipModule"; import { SlidingNavBlockPropTypes } from "./SlidingNavBlockPropTypes"; +import Constraint from "../../Constraint"; import { graphql } from "gatsby"; const SlidingNavBlock = ({ id = ``, children, title, icon, data }) => { @@ -17,20 +18,22 @@ const SlidingNavBlock = ({ id = ``, children, title, icon, data }) => { }; return ( -
      -
      - {title && ( -

      - {!!icon && } - {title} -

      + +
      +
      + {title && ( +

      + {!!icon && } + {title} +

      + )} +
      + {children &&
      {children}
      } + {!children && data && ( +
      {getModule(data)}
      )}
      - {children &&
      {children}
      } - {!children && data && ( -
      {getModule(data)}
      - )} -
      + ); }; diff --git a/src/components/ContentfulModule/StepsModule/StepsModule.css b/src/components/ContentfulModule/StepsModule/StepsModule.css new file mode 100644 index 00000000..7148664e --- /dev/null +++ b/src/components/ContentfulModule/StepsModule/StepsModule.css @@ -0,0 +1,135 @@ +.StepsModule { + display: flex; + flex-direction: column; + gap: calc(var(--s__unit) * 6); + padding: var(--s__main-padding) 0; + + details { + border: 1px solid #ececec; + border-radius: var(--s__main-border-radius); + padding: var(--s__main-padding); + + &[open] summary::after { + transform: rotate(135deg); + } + } + + summary { + align-items: center; + color: var(--c__primary); + cursor: pointer; + display: flex; + justify-content: space-between; + + &::-webkit-details-marker { + display: none; + } + + &, + h3 { + font-size: 1.5rem; + } + + h3 { + font-weight: var(--fw__small); + margin: 0; + } + + &::after { + border-color: var(--c__primary); + border-style: solid; + border-width: 0.15em 0.15em 0 0; + content: ""; + display: inline-block; + height: 0.45em; + left: -0.5em; + margin-left: 2rem; + position: relative; + transform: rotate(45deg) translateY(50%); + transform-origin: center; + transition: transform 0.2s ease; + vertical-align: middle; + width: 0.45em; + } + } + + &__content { + border-top: 1px solid #ececec; + margin-top: var(--s__main-padding); + } + + &__actions { + align-items: center; + color: var(--c__primary); + display: flex; + justify-content: space-between; + margin: calc(var(--s__unit) * 4) 0; + position: relative; + + .copy { + font-size: 0.9rem; + + &::after { + background-color: var(--c__primary); + content: ""; + display: inline-block; + height: 20px; + margin-left: 10px; + mask-image: url("../../../images/icons/copy.svg"); + mask-position: center; + mask-repeat: no-repeat; + mask-size: contain; + position: relative; + vertical-align: middle; + width: 20px; + } + + &:hover { + color: var(--c__primary); + cursor: pointer; + + &::after { + background-color: var(--c__primary); + content: ""; + display: inline-block; + height: 20px; + margin-left: 10px; + mask-image: url("../../../images/icons/copy.svg"); + mask-position: center; + mask-repeat: no-repeat; + mask-size: contain; + position: relative; + vertical-align: middle; + width: 20px; + } + + &:hover { + color: var(--c__primary); + cursor: pointer; + + &::before { + background-color: var(--c__primary); + } + } + } + } + + .copy-popup { + opacity: 0; + position: absolute; + right: 30px; /* icon width + margin */ + text-transform: uppercase; + top: 0; + transition: transform 0.2s ease-in, opacity 0.5s; + + &--active { + opacity: 1; + transform: translateY(-2em); + } + } + } + + &__copy-action { + margin-left: auto; + } +} diff --git a/src/components/ContentfulModule/StepsModule/StepsModule.jsx b/src/components/ContentfulModule/StepsModule/StepsModule.jsx new file mode 100644 index 00000000..ca52c4de --- /dev/null +++ b/src/components/ContentfulModule/StepsModule/StepsModule.jsx @@ -0,0 +1,97 @@ +import React from "react"; +import { formatRichText } from "../../../helpers/formatting"; +import { + StepsModulePropTypes, + StepsModuleDefaultProps, +} from "./StepsModulePropTypes"; +import { getTranslatedText } from "../../../utils/getTranslatedText"; +import { handleAnchorClick } from "../../Faq"; + +import "./StepsModule.css"; +import { useEffect } from "react"; +import { openDetailsByHash } from "../../../helpers/handlers"; +import Button from "../../Button"; +import Constraint from "../../Constraint"; +import classNames from "classnames"; +import { graphql } from "gatsby"; + +const StepsModule = ({ steps, fullWidth }) => { + useEffect(() => { + window.addEventListener(`hashchange`, openDetailsByHash); + openDetailsByHash(); + + return () => { + window.removeEventListener(`hashchange`, openDetailsByHash); + }; + }, []); + + return ( + +
      + {steps.map((step, index) => { + const tabId = `tab-${index + 1}`; + return ( +
      + +

      + + {getTranslatedText(`labels.step`)} {index + 1}. + + {` `} + {step.question} +

      +
      +
      + {formatRichText(step.answer.raw)} +
      + {step?.additionalLink && ( + + )} + +
      +
      +
      + ); + })} +
      +
      + ); +}; + +StepsModule.propTypes = StepsModulePropTypes; + +StepsModule.defaultProps = StepsModuleDefaultProps; + +export default StepsModule; + +export const query = graphql` + fragment StepsModuleFragment on ContentfulStepsModule { + steps { + ... on Node { + id + internal { + type + } + ...FaqItemFragment + } + } + } +`; diff --git a/src/components/ContentfulModule/StepsModule/StepsModulePropTypes.js b/src/components/ContentfulModule/StepsModule/StepsModulePropTypes.js new file mode 100644 index 00000000..2bc9df30 --- /dev/null +++ b/src/components/ContentfulModule/StepsModule/StepsModulePropTypes.js @@ -0,0 +1,16 @@ +import PropTypes from "prop-types"; +import { FaqItemPropTypes } from "../../Faq/FaqModule/FaqItem/FaqItemPropTypes"; + +const StepsModulePropTypes = { + steps: PropTypes.arrayOf( + PropTypes.oneOfType([PropTypes.shape(FaqItemPropTypes)]) + ), + fullWidth: PropTypes.bool, +}; + +const StepsModuleDefaultProps = { + steps: [], + fullWidth: false, +}; + +export { StepsModuleDefaultProps, StepsModulePropTypes }; diff --git a/src/components/ContentfulModule/StepsModule/index.js b/src/components/ContentfulModule/StepsModule/index.js new file mode 100644 index 00000000..d22db113 --- /dev/null +++ b/src/components/ContentfulModule/StepsModule/index.js @@ -0,0 +1,7 @@ +import StepsModule from "./StepsModule"; +import { + StepsModulePropTypes, + StepsModuleDefaultProps, +} from "./StepsModulePropTypes"; + +export { StepsModule, StepsModuleDefaultProps, StepsModulePropTypes }; diff --git a/src/components/Faq/Faq.js b/src/components/Faq/Faq.js index 697a6cd3..dde0cb65 100644 --- a/src/components/Faq/Faq.js +++ b/src/components/Faq/Faq.js @@ -14,23 +14,7 @@ import { ResourceListModulePropTypes } from "../ContentfulModule/ResourceListMod import { formatRichText } from "../../helpers/formatting"; import "./Faq.css"; - -// Used stackoverflow as reference -// Not a 1:1 copy -// https://stackoverflow.com/a/37033774 -const openTarget = () => { - const hash = location.hash.substring(1); - if (hash) { - const details = Array.from(document.getElementById(hash).children).find( - (element) => { - return element.tagName === `DETAILS`; - } - ); - if (details) { - details.open = true; - } - } -}; +import { openDetailsByHash } from "../../helpers/handlers"; const Faq = ({ title, @@ -42,11 +26,11 @@ const Faq = ({ crumbs, }) => { useEffect(() => { - window.addEventListener(`hashchange`, openTarget); - openTarget(); + window.addEventListener(`hashchange`, openDetailsByHash); + openDetailsByHash(); return () => { - window.removeEventListener(`hashchange`, openTarget); + window.removeEventListener(`hashchange`, openDetailsByHash); }; }, []); diff --git a/src/components/Faq/FaqModule/FaqItem/FaqItemPropTypes.js b/src/components/Faq/FaqModule/FaqItem/FaqItemPropTypes.js index 75b1a1b2..2601f1c6 100644 --- a/src/components/Faq/FaqModule/FaqItem/FaqItemPropTypes.js +++ b/src/components/Faq/FaqModule/FaqItem/FaqItemPropTypes.js @@ -1,4 +1,5 @@ import PropTypes from "prop-types"; +import { linkPropTypes } from "../../../../helpers/genericPropTypes"; const FaqItemPropTypes = { id: PropTypes.string.isRequired, @@ -8,6 +9,7 @@ const FaqItemPropTypes = { references: PropTypes.array, }).isRequired, index: PropTypes.number.isRequired, + additionalLink: linkPropTypes, }; export { FaqItemPropTypes }; diff --git a/src/components/Faq/index.js b/src/components/Faq/index.js index c13ec88e..7c83a459 100644 --- a/src/components/Faq/index.js +++ b/src/components/Faq/index.js @@ -2,5 +2,12 @@ import Faq from "./Faq"; import { FaqNavDataPropTypes } from "./Faq"; import { FaqNav } from "./FaqNav"; import { FaqModulePropTypes } from "./FaqModule/FaqModulePropTypes"; +import { handleAnchorClick } from "./FaqModule/FaqItem/faqItemUtils"; -export { Faq, FaqNavDataPropTypes, FaqNav, FaqModulePropTypes }; +export { + Faq, + FaqNavDataPropTypes, + FaqNav, + FaqModulePropTypes, + handleAnchorClick, +}; diff --git a/src/components/LinkCollectionWithImage/LinkCollectionWithImage.js b/src/components/LinkCollectionWithImage/LinkCollectionWithImage.js deleted file mode 100644 index 3bd32c7f..00000000 --- a/src/components/LinkCollectionWithImage/LinkCollectionWithImage.js +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from "react"; -import PropTypes from "prop-types"; -import { GatsbyImage, getImage } from "gatsby-plugin-image"; - -// Style. -import "./LinkCollectionWithImage.css"; -import { gatsbyImagePropType } from "../../helpers/genericPropTypes"; - -const LinkCollectionWithImage = ({ title, children, image }) => { - return ( -
      -
      - {!!title &&

      {title}

      } -
        {children}
      -
      - - {image && ( -
      - -
      - )} -
      - ); -}; - -LinkCollectionWithImage.propTypes = { - title: PropTypes.string, - children: PropTypes.node, - image: gatsbyImagePropType, -}; - -export default LinkCollectionWithImage; diff --git a/src/components/LinkCollectionWithImage/index.js b/src/components/LinkCollectionWithImage/index.js deleted file mode 100644 index 5c2b5544..00000000 --- a/src/components/LinkCollectionWithImage/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./LinkCollectionWithImage"; diff --git a/src/components/Section/Section.css b/src/components/Section/Section.css index 39601c13..1ebd95b6 100644 --- a/src/components/Section/Section.css +++ b/src/components/Section/Section.css @@ -28,10 +28,6 @@ &.ProtestFormsSection { margin-bottom: calc(var(--s__unit) * 10); } - - &.BeVigilantSection { - background-color: #f6f6f6; - } } .HeroSection { diff --git a/src/constants/AdditionalNavigation.js b/src/constants/AdditionalNavigation.js index d0abb509..5e6708cd 100644 --- a/src/constants/AdditionalNavigation.js +++ b/src/constants/AdditionalNavigation.js @@ -1,38 +1,136 @@ export const ADDITIONAL_NAVIGATION = { "/pagalba-ukrainai/savanoryste": [ { - pathname: `/pagalba-ukrainai/aukojimas`, + pathname: `/pagalba-ukrainai/aukojimas/`, title: `Aukojimas`, }, ], "/pagalba-ukrainai/aukojimas": [ { - pathname: `/pagalba-ukrainai/savanoryste`, + pathname: `/pagalba-ukrainai/savanoryste/`, title: `Savanorystė`, }, ], "/ua/dopomoha/pozhertvy": [ { - pathname: `/ua/dopomoha/volonterstvo`, + pathname: `/ua/dopomoha/volonterstvo/`, title: `Волонтерство`, }, ], "/ua/dopomoha/volonterstvo": [ { - pathname: `/ua/dopomoha/pozhertvy`, + pathname: `/ua/dopomoha/pozhertvy/`, title: `Пожертви`, }, ], "/en/support-ukraine/donation": [ { - pathname: `/en/support-ukraine/volunteering`, + pathname: `/en/support-ukraine/volunteering/`, title: `Volunteering`, }, ], "/en/support-ukraine/volunteering": [ { - pathname: `/en/support-ukraine/donation`, + pathname: `/en/support-ukraine/donation/`, title: `Donation`, }, ], + + // @todo: fix these links once we have all the slugs for personalized guide pages + /* Personalized guides */ + /* Guide for new arrivals */ + "/guide-for-new-arrivals": [ + { + pathname: `/guide-for-persons-with-children/`, + title: `Guide for persons with children`, + }, + { + pathname: `/guide-for-persons-with-disabilities/`, + title: `Guide for persons with disabilities`, + }, + ], + "/en/guide-for-new-arrivals": [ + { + pathname: `/en/guide-for-persons-with-children/`, + title: `Guide for persons with children`, + }, + { + pathname: `/en/guide-for-persons-with-disabilities/`, + title: `Guide for persons with disabilities`, + }, + ], + "/ua/guide-for-new-arrivals": [ + { + pathname: `/ua/guide-for-persons-with-children/`, + title: `Guide for persons with children`, + }, + { + pathname: `/ua/guide-for-persons-with-disabilities/`, + title: `Guide for persons with disabilities`, + }, + ], + + /* Guide for persons with children */ + "/guide-for-persons-with-children": [ + { + pathname: `/guide-for-persons-with-disabilities/`, + title: `Guide for persons with disabilities`, + }, + { + pathname: `/guide-for-new-arrivals/`, + title: `Guide for new arrivals`, + }, + ], + "/en/guide-for-persons-with-children": [ + { + pathname: `/en/guide-for-persons-with-disabilities/`, + title: `Guide for persons with disabilities`, + }, + { + pathname: `/en/guide-for-new-arrivals/`, + title: `Guide for new arrivals`, + }, + ], + "/ua/guide-for-persons-with-children": [ + { + pathname: `/ua/guide-for-persons-with-disabilities/`, + title: `Guide for persons with disabilities`, + }, + { + pathname: `/ua/guide-for-new-arrivals/`, + title: `Guide for new arrivals`, + }, + ], + + /* Guide for persons with disabilities */ + "/guide-for-persons-with-disabilities": [ + { + pathname: `/guide-for-new-arrivals/`, + title: `Guide for new arrivals`, + }, + { + pathname: `/guide-for-persons-with-children/`, + title: `Guide for persons with children`, + }, + ], + "/en/guide-for-persons-with-disabilities": [ + { + pathname: `/en/guide-for-new-arrivals/`, + title: `Guide for new arrivals`, + }, + { + pathname: `/en/guide-for-persons-with-children/`, + title: `Guide for persons with children`, + }, + ], + "/ua/guide-for-persons-with-disabilities": [ + { + pathname: `/ua/guide-for-new-arrivals/`, + title: `Guide for new arrivals`, + }, + { + pathname: `/ua/guide-for-persons-with-children/`, + title: `Guide for persons with children`, + }, + ], }; diff --git a/src/constants/contentfulIds.js b/src/constants/contentfulIds.js index 56657565..c30a7324 100644 --- a/src/constants/contentfulIds.js +++ b/src/constants/contentfulIds.js @@ -1,7 +1,11 @@ const NAVIGATION_ID = `1yKThqiNevVEU4BCn7zZ9y`; +// This is the PRODUCTION homepage const HOMEPAGE_ID = `VoE6QU1LhN2Y5h6Tja3fq`; +// This is the DUMMY homepage +// const HOMEPAGE_ID = `2hHrtVu5fUseOPMTxz82fV`; + const PROMOLINE_ID = `1zlccw24eib2cd3wTXRHfk`; module.exports = { diff --git a/src/helpers/genericPropTypes.js b/src/helpers/genericPropTypes.js index 4df031ac..93b64696 100644 --- a/src/helpers/genericPropTypes.js +++ b/src/helpers/genericPropTypes.js @@ -40,18 +40,18 @@ const navigationPropTypes = PropTypes.shape({ node_locale: localePropType.isRequired, }); +const linkPropTypes = PropTypes.shape({ + id: PropTypes.string, + label: PropTypes.string, + url: PropTypes.string, + sublabel: PropTypes.string, +}); + const promoLinePropTypes = PropTypes.shape({ heading: PropTypes.string.isRequired, headingLink: PropTypes.string, subheading: PropTypes.string, - linkButton: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string, - label: PropTypes.string, - url: PropTypes.string, - sublabel: PropTypes.string, - }) - ), + linkButton: PropTypes.arrayOf(linkPropTypes), }); const nodeSlugsPropTypes = PropTypes.shape({ @@ -70,6 +70,7 @@ export { localePropType, gatsbyImagePropType, navigationPropTypes, + linkPropTypes, promoLinePropTypes, nodeSlugsPropTypes, nodeSlugsDefaultProps, diff --git a/src/helpers/handlers.js b/src/helpers/handlers.js index a1348954..9ba52cbc 100644 --- a/src/helpers/handlers.js +++ b/src/helpers/handlers.js @@ -26,4 +26,31 @@ const getRichTextModuleData = (node, refs) => { return moduleData || null; }; -export { isUkrainianPage, getLocaleFromPath, getRichTextModuleData }; +// Used stackoverflow as reference +// Not a 1:1 copy +// https://stackoverflow.com/a/37033774 +const openDetailsByHash = () => { + const hash = location.hash.substring(1); + if (hash) { + const hashElement = document.getElementById(hash); + if (hashElement.tagName === `DETAILS`) { + hashElement.open = true; + return; + } + + const details = Array.from(hashElement.children).find( + ({ tagName }) => tagName === `DETAILS` + ); + + if (details) { + details.open = true; + } + } +}; + +export { + isUkrainianPage, + getLocaleFromPath, + getRichTextModuleData, + openDetailsByHash, +}; diff --git a/src/locales/en/index.json b/src/locales/en/index.json index 7d7d597a..8a9f5b90 100644 --- a/src/locales/en/index.json +++ b/src/locales/en/index.json @@ -22,7 +22,8 @@ "email": "E-mail", "message": "Message", "source": "Source", - "links": "Links" + "links": "Links", + "step": "Step" }, "organisation": { "about": "About", diff --git a/src/locales/lt/index.json b/src/locales/lt/index.json index 75f90592..e892ac64 100644 --- a/src/locales/lt/index.json +++ b/src/locales/lt/index.json @@ -22,7 +22,8 @@ "email": "El. paštas", "message": "Žinutė", "source": "Šaltinis", - "links": "Nuorodos" + "links": "Nuorodos", + "step": "Žingsnis" }, "organisation": { "about": "Apie", diff --git a/src/locales/ua/index.json b/src/locales/ua/index.json index 36fd2632..edcfc7dc 100644 --- a/src/locales/ua/index.json +++ b/src/locales/ua/index.json @@ -22,7 +22,8 @@ "email": "Е. пошта", "message": "Повідомлення", "source": "Джерело", - "links": "Посилання" + "links": "Посилання", + "step": "Крок" }, "organisation": { "about": "Про", diff --git a/src/templates/faqIndexPage.jsx b/src/templates/faqIndexPage.jsx index f91377ac..042fd11f 100644 --- a/src/templates/faqIndexPage.jsx +++ b/src/templates/faqIndexPage.jsx @@ -15,6 +15,11 @@ import { promoLinePropTypes, } from "../helpers/genericPropTypes"; import { FaqCategoriesPropType } from "../components/Faq/FaqPropTypes"; +import { + LinkCollectionModule, + LinkCollectionModulePropTypes, + LinkCollectionModuleDefaultProps, +} from "../components/ContentfulModule/LinkCollectionModule"; import { graphql } from "gatsby"; const FaqIndexPage = ({ data, path, pageContext }) => { @@ -26,6 +31,7 @@ const FaqIndexPage = ({ data, path, pageContext }) => { const { contentfulNavigation: navigation, contentfulPromoLineModule: promoLine, + contentfulLinkCollectionModule: personalizedGuidesLinks, contentfulFaqPage: { metaTitle, metaDescription, @@ -58,6 +64,13 @@ const FaqIndexPage = ({ data, path, pageContext }) => { )} + + {personalizedGuidesLinks && ( + + )} ); }; @@ -89,6 +102,9 @@ FaqIndexPage.propTypes = { }), categories: FaqCategoriesPropType, }), + contentfulLinkCollectionModule: PropTypes.shape( + LinkCollectionModulePropTypes + ), }), }; @@ -99,6 +115,7 @@ FaqIndexPage.defaultProps = { }, organisations: [], navData: [], + contentfulLinkCollectionModule: LinkCollectionModuleDefaultProps, }; export default FaqIndexPage; @@ -127,6 +144,13 @@ export const faqIndexPageQuery = graphql` ...PromoLineFragment } + contentfulLinkCollectionModule( + contentful_id: { eq: "1JYPNg9dcfazxccUEpijxk" } + ) { + id + ...LinkCollectionModuleFragment + } + # Faq Page (all categories for faq nav) contentfulFaqPage( contentful_id: { eq: $id } diff --git a/src/templates/modularPage.jsx b/src/templates/modularPage.jsx index a813f2f5..3adc5c54 100644 --- a/src/templates/modularPage.jsx +++ b/src/templates/modularPage.jsx @@ -1,6 +1,5 @@ import React from "react"; import PropTypes from "prop-types"; -import classNames from "classnames"; import Layout from "../components/Layout"; import Constraint from "../components/Constraint"; @@ -40,7 +39,6 @@ const ModularPage = ({ data, path, pageContext }) => { pageDescription, modules, includeContactForm, - fullWidthModules, showBreadcrumbs, stickyHeader, }, @@ -88,23 +86,21 @@ const ModularPage = ({ data, path, pageContext }) => { {pageDescription?.raw && formatRichText(pageDescription.raw)} - + + + )} + {!!modules?.at(0) && + modules.map((module) => { + return ( + + ); })} - > - {slidingNavData && } - {!!modules?.at(0) && - modules.map((module) => { - return ( - - ); - })} - ); }; @@ -215,6 +211,7 @@ export const modularPageQuery = graphql` ...ResourceListModuleFragment ...LinkCollectionModuleFragment ...HelpSearchFragment + ...StepsModuleFragment } } includeContactForm