Skip to content
Snippets Groups Projects

Add english links to frontend

Merged Andreas Ellewsen requested to merge GREG-200-english-links into master
3 files
+ 47
9
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -5,10 +5,15 @@ import { Link } from '@mui/material'
import {
responsibleOrganization,
responsibleOrganizationLink,
responsibleOrganizationLinkEn,
itRulesLink,
itRulesLinkEn,
privacyPolicyLink,
privacyPolicyLinkEn,
technicalSupportLink,
technicalSupportLinkEn,
documentationLink,
documentationLinkEn,
} from 'appConfig'
import { getFooterLogo } from './logos'
@@ -70,7 +75,26 @@ StyledLink.defaultProps = {
const LogoContainer = styled('div')({})
function Footer() {
const { t } = useTranslation(['common', 'footer'])
const { t, i18n } = useTranslation(['common', 'footer'])
const getLink = (enLink: string | null, noLink: string | null) => {
let link
if (i18n.language === 'en') {
link = enLink || noLink
} else {
link = noLink || enLink
}
return link || ''
}
const getItRulesLink = () => getLink(itRulesLinkEn, itRulesLink)
const getTechnicalSupportLink = () =>
getLink(technicalSupportLinkEn, technicalSupportLink)
const getPrivacyPolicyLink = () =>
getLink(privacyPolicyLinkEn, privacyPolicyLink)
const getDocumentationLink = () =>
getLink(documentationLinkEn, documentationLink)
const getResponsibleOrganizationLink = () =>
getLink(responsibleOrganizationLinkEn, responsibleOrganizationLink)
return (
<FooterWrapper>
<InfoSection>
@@ -79,20 +103,20 @@ function Footer() {
<LinkContainer>
<LinkSection>
<LinkHeader>{t('footer:link.terms.header')}</LinkHeader>
<StyledLink href={itRulesLink}>
<StyledLink href={getItRulesLink()}>
{t('footer:link.terms.ITRules')}
</StyledLink>
<StyledLink href={privacyPolicyLink}>
<StyledLink href={getPrivacyPolicyLink()}>
{t('footer:link.terms.privacy')}
</StyledLink>
</LinkSection>
<LinkSection>
<LinkHeader>{t('footer:link.help.header')}</LinkHeader>
<StyledLink href={technicalSupportLink}>
<StyledLink href={getTechnicalSupportLink()}>
{t('footer:link.help.contact')}
</StyledLink>
<StyledLink href={documentationLink}>
<StyledLink href={getDocumentationLink()}>
{t('footer:link.help.doc')}
</StyledLink>
</LinkSection>
@@ -101,7 +125,7 @@ function Footer() {
<LinkHeader>
{t('footer:link.responsibleOrganization.header')}
</LinkHeader>
<StyledLink href={responsibleOrganizationLink}>
<StyledLink href={getResponsibleOrganizationLink()}>
{responsibleOrganization}
</StyledLink>
</LinkSection>
Loading