generated from DTS-STN/next-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from DTS-STN/beta-banner
Beta banner
- Loading branch information
Showing
17 changed files
with
152 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ describe('404', () => { | |
keywords: '', | ||
}, | ||
}, | ||
hideBanner: true, | ||
}, | ||
}) | ||
}) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import clientQuery from '../client' | ||
|
||
export async function getBetaBannerContent() { | ||
const queryOptOut = require('../queries/beta-banner-opt-out.graphql') | ||
const resOptOut = await clientQuery(queryOptOut) | ||
|
||
const resOptOutContent = resOptOut.data.schContentv1ByPath.item || {} | ||
|
||
const mappedBanner = { | ||
en: { | ||
bannerBoldText: resOptOutContent.scContentEn.json[0].content[0].value, | ||
bannerText: resOptOutContent.scContentEn.json[0].content[1].value, | ||
bannerLink: resOptOutContent.scFragments[0].scLinkTextEn, | ||
bannerLinkHref: resOptOutContent.scFragments[0].scDestinationURLEn, | ||
bannerButtonText: resOptOutContent.scFragments[1].scLinkTextEn, | ||
bannerButtonLink: resOptOutContent.scFragments[1].scDestinationURLFr, | ||
icon: resOptOutContent.scFragments[0].scIconCSS, | ||
}, | ||
fr: { | ||
bannerBoldText: resOptOutContent.scContentFr.json[0].content[0].value, | ||
bannerText: resOptOutContent.scContentFr.json[0].content[1].value, | ||
bannerLink: resOptOutContent.scFragments[0].scLinkTextFr, | ||
bannerLinkHref: resOptOutContent.scFragments[0].scDestinationURLFr, | ||
bannerButtonText: resOptOutContent.scFragments[1].scLinkTextFr, | ||
bannerButtonLink: resOptOutContent.scFragments[1].scDestinationURLFr, | ||
icon: resOptOutContent.scFragments[0].scIconCSS, | ||
}, | ||
} | ||
return mappedBanner | ||
} |
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,28 @@ | ||
{ | ||
schContentv1ByPath( | ||
_path: "/content/dam/decd-endc/content-fragments/sch/content/beta-banner-opt-out" | ||
) { | ||
item { | ||
_path | ||
scId | ||
scContentEn { | ||
json | ||
} | ||
scContentFr { | ||
json | ||
} | ||
scFragments { | ||
... on SCHTaskv1Model { | ||
scId | ||
scDestinationURLEn | ||
scDestinationURLFr | ||
scIconCSS | ||
scLinkTextEn | ||
scLinkTextFr | ||
scLinkTextAssistiveEn | ||
scLinkTextAssistiveFr | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import '../styles/globals.css' | ||
import Layout from '../components/Layout' | ||
|
||
function MyApp({ Component, pageProps }) { | ||
export default function MyApp({ Component, pageProps }) { | ||
/* istanbul ignore next */ | ||
if (Component.getLayout) { | ||
return Component.getLayout(<Component {...pageProps} />) | ||
} | ||
|
||
const display = { hideBanner: pageProps.hideBanner } | ||
/* istanbul ignore next */ | ||
return ( | ||
<Layout | ||
locale={pageProps.locale} | ||
meta={pageProps.meta} | ||
langToggleLink={pageProps.langToggleLink} | ||
breadCrumbItems={pageProps.breadCrumbItems} | ||
bannerContent={pageProps.bannerContent} | ||
display={display} | ||
> | ||
<Component {...pageProps} /> | ||
</Layout> | ||
) | ||
} | ||
|
||
export default MyApp |
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
Oops, something went wrong.