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'
@@ -5,10 +5,15 @@ import { Link } from '@mui/material'
import {
import {
responsibleOrganization,
responsibleOrganization,
responsibleOrganizationLink,
responsibleOrganizationLink,
 
responsibleOrganizationLinkEn,
itRulesLink,
itRulesLink,
 
itRulesLinkEn,
privacyPolicyLink,
privacyPolicyLink,
 
privacyPolicyLinkEn,
technicalSupportLink,
technicalSupportLink,
 
technicalSupportLinkEn,
documentationLink,
documentationLink,
 
documentationLinkEn,
} from 'appConfig'
} from 'appConfig'
import { getFooterLogo } from './logos'
import { getFooterLogo } from './logos'
@@ -70,7 +75,26 @@ StyledLink.defaultProps = {
@@ -70,7 +75,26 @@ StyledLink.defaultProps = {
const LogoContainer = styled('div')({})
const LogoContainer = styled('div')({})
function Footer() {
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 (
return (
<FooterWrapper>
<FooterWrapper>
<InfoSection>
<InfoSection>
@@ -79,20 +103,20 @@ function Footer() {
@@ -79,20 +103,20 @@ function Footer() {
<LinkContainer>
<LinkContainer>
<LinkSection>
<LinkSection>
<LinkHeader>{t('footer:link.terms.header')}</LinkHeader>
<LinkHeader>{t('footer:link.terms.header')}</LinkHeader>
<StyledLink href={itRulesLink}>
<StyledLink href={getItRulesLink()}>
{t('footer:link.terms.ITRules')}
{t('footer:link.terms.ITRules')}
</StyledLink>
</StyledLink>
<StyledLink href={privacyPolicyLink}>
<StyledLink href={getPrivacyPolicyLink()}>
{t('footer:link.terms.privacy')}
{t('footer:link.terms.privacy')}
</StyledLink>
</StyledLink>
</LinkSection>
</LinkSection>
<LinkSection>
<LinkSection>
<LinkHeader>{t('footer:link.help.header')}</LinkHeader>
<LinkHeader>{t('footer:link.help.header')}</LinkHeader>
<StyledLink href={technicalSupportLink}>
<StyledLink href={getTechnicalSupportLink()}>
{t('footer:link.help.contact')}
{t('footer:link.help.contact')}
</StyledLink>
</StyledLink>
<StyledLink href={documentationLink}>
<StyledLink href={getDocumentationLink()}>
{t('footer:link.help.doc')}
{t('footer:link.help.doc')}
</StyledLink>
</StyledLink>
</LinkSection>
</LinkSection>
@@ -101,7 +125,7 @@ function Footer() {
@@ -101,7 +125,7 @@ function Footer() {
<LinkHeader>
<LinkHeader>
{t('footer:link.responsibleOrganization.header')}
{t('footer:link.responsibleOrganization.header')}
</LinkHeader>
</LinkHeader>
<StyledLink href={responsibleOrganizationLink}>
<StyledLink href={getResponsibleOrganizationLink()}>
{responsibleOrganization}
{responsibleOrganization}
</StyledLink>
</StyledLink>
</LinkSection>
</LinkSection>
Loading