Skip to content

Commit

Permalink
Update footer ternary to use publicRuntimeConfig value (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
krischarbonneau committed Jul 15, 2024
1 parent 573d932 commit 60f725c
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 43 deletions.
66 changes: 25 additions & 41 deletions components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useRouter } from 'next/router'
import throttle from 'lodash.throttle'
import IdleTimeout from './IdleTimeout'
import { signOut } from 'next-auth/react'
import getConfig from 'next/config'

export default function Layout(props) {
const t = props.locale === 'en' ? en : fr
Expand Down Expand Up @@ -144,48 +145,31 @@ export default function Layout(props) {
<main id="mainContent" className="sch-container grid gap-[30px]">
{props.children}
</main>

<IdleTimeout locale={props.locale} refPageAA={props.refPageAA} />

{process.env.ENVIRONMENT === 'production' ? (
<Footer
lang={!props.locale ? 'en' : props.locale}
brandLinks={[
{
href: t.footerTermsAndConditionURL,
id: 'linkTC',
text: t.footerTermsAndCondition,
},
{
href: t.footerPrivacyURL,
id: 'linkPR',
text: t.footerPrivacy,
},
]}
contactLink={contactLink}
btnLink="#top"
id="page-footer"
/>
) : (
<Footer
lang={!props.locale ? 'en' : props.locale}
brandLinks={[
{
href: t.footerTermsAndConditionDevURL,
id: 'linkTC',
text: t.footerTermsAndCondition,
},
{
href: t.footerPrivacyDevURL,
id: 'linkPR',
text: t.footerPrivacy,
},
]}
contactLink={contactLink}
btnLink="#top"
id="page-footer"
/>
)}
<Footer
lang={!props.locale ? 'en' : props.locale}
brandLinks={[
{
href:
getConfig()?.publicRuntimeConfig.ENVIRONMENT === 'production'
? t.footerTermsAndConditionURL
: t.footerTermsAndConditionDevURL,
id: 'linkTC',
text: t.footerTermsAndCondition,
},
{
href:
getConfig()?.publicRuntimeConfig.ENVIRONMENT === 'production'
? t.footerPrivacyURL
: t.footerPrivacyDevURL,
id: 'linkPR',
text: t.footerPrivacy,
},
]}
contactLink={contactLink}
btnLink="#top"
id="page-footer"
/>
</>
)
}
Expand Down
195 changes: 193 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/exporter-jaeger": "^1.25.1",
"@opentelemetry/exporter-metrics-otlp-proto": "^0.51.1",
"@opentelemetry/sdk-node": "^0.51.1",
"@typescript-eslint/eslint-plugin": "^7.12.0",
Expand Down

0 comments on commit 60f725c

Please sign in to comment.