Skip to content

Commit

Permalink
breaking(footer): use url parameter instead of link for footer actions
Browse files Browse the repository at this point in the history
- we are using site actions to give the site the ability to customize
  the footer and actions have the url field not the link field as such
  it's easier to simply use url parameter
  • Loading branch information
ichim-david committed Jun 8, 2023
1 parent 2fbb7df commit 5b9cc2c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
12 changes: 6 additions & 6 deletions src/ui/Footer/Contact.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const Contact = ({ children, contacts }) =>
<div className="contact-wrapper">
{contacts?.map((contact, index) => (
<div className="contact" key={index}>
{isInternalURL(contact.link) ? (
<Link to={contact.link} className="bold">
{isInternalURL(contact.url) ? (
<Link to={contact.url} className="bold">
{contact.text}
</Link>
) : (
<a
href={contact.link}
href={contact.url}
target={'_blank'}
rel="noopener noreferrer"
className={'bold'}
Expand All @@ -29,13 +29,13 @@ const Contact = ({ children, contacts }) =>
<div className="subcontact">
{contact.children.map((child, index) => (
<React.Fragment key={index}>
{isInternalURL(child.link) ? (
<Link to={child.link} key={index}>
{isInternalURL(child.url) ? (
<Link to={child.url} key={index}>
{child.text}
</Link>
) : (
<a
href={child.link}
href={child.url}
target={'_blank'}
rel="noopener noreferrer"
>
Expand Down
56 changes: 28 additions & 28 deletions src/ui/Footer/Footer.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,64 +33,64 @@ Default.args = {
header: 'Environmental information systems',
description: '',
actions: [
{ link: '/privacy', title: 'Privacy' },
{ link: '/sitemap', title: 'Sitemap' },
{ link: 'https://www.eea.europa.eu/en/login', title: 'CMS Login' },
{ url: '/privacy', title: 'Privacy' },
{ url: '/sitemap', title: 'Sitemap' },
{ url: 'https://www.eea.europa.eu/en/login', title: 'CMS Login' },
],
copyright: [
{ link: 'https://status.eea.europa.eu/', title: 'System status' },
{ url: 'https://status.eea.europa.eu/', title: 'System status' },
{
link: '/copyright',
url: '/copyright',
title: '© Copyright 2023 EEA',
},
],
sites: [
{ link: 'https://water.europa.eu/marine', src: Marine, alt: 'WISE marine' },
{ url: 'https://water.europa.eu/marine', src: Marine, alt: 'WISE marine' },
{
link: 'https://water.europa.eu/freshwater',
url: 'https://water.europa.eu/freshwater',
src: Freshwater,
alt: 'WISE freshwater',
},
{ link: 'https://biodiversity.europa.eu/', src: Bise, alt: 'Biodiversity' },
{ url: 'https://biodiversity.europa.eu/', src: Bise, alt: 'Biodiversity' },
{
link: 'https://forest.eea.europa.eu/',
url: 'https://forest.eea.europa.eu/',
src: Fise,
alt: 'Forest information system for europe',
},
{
link: 'https://climate-adapt.eea.europa.eu/observatory',
url: 'https://climate-adapt.eea.europa.eu/observatory',
src: ClimateHealth,
alt: 'Information platform for chemical monitoring',
},
{
link: 'https://climate-adapt.eea.europa.eu/',
url: 'https://climate-adapt.eea.europa.eu/',
src: Cca,
alt: 'Climate adapt',
},
{
link: 'https://industry.eea.europa.eu/',
url: 'https://industry.eea.europa.eu/',
src: Industry,
alt: 'European industrial emissions portal',
},
{
link: 'https://climate-energy.eea.europa.eu/',
url: 'https://climate-energy.eea.europa.eu/',
src: Energy,
alt: 'Climate and energy in the EU',
},
{
link: 'https://land.copernicus.eu/',
url: 'https://land.copernicus.eu/',
src: Copernicus,
alt: 'Copernicus land monitoring service',
},
{
link: 'https://insitu.copernicus.eu/',
url: 'https://insitu.copernicus.eu/',
src: Insitu,
alt: 'Copernicus in situ',
},
],
managedBy: [
{
link: 'https://www.eea.europa.eu/',
url: 'https://www.eea.europa.eu/',
src: EEA,
alt: 'EEA Logo',
className: 'site logo',
Expand All @@ -101,7 +101,7 @@ Default.args = {
},
},
{
link: 'https://www.eionet.europa.eu/',
url: 'https://www.eionet.europa.eu/',
src: Eionet,
alt: 'EIONET Logo',
className: 'eionet logo',
Expand All @@ -116,40 +116,40 @@ Default.args = {
{
name: 'twitter',
icon: 'ri-twitter-fill',
link: 'https://twitter.com/euenvironment',
url: 'https://twitter.com/euenvironment',
},
{
name: 'facebook',
icon: 'ri-facebook-box-fill',
link: 'https://www.facebook.com/European.Environment.Agency',
url: 'https://www.facebook.com/European.Environment.Agency',
},
{
name: 'linkedin',
icon: 'ri-linkedin-fill',
link: 'https://www.linkedin.com/company/european-environment-agency',
url: 'https://www.linkedin.com/company/european-environment-agency',
},
{
name: 'youtube',
icon: 'ri-youtube-fill',
link: 'https://www.youtube.com/user/EEAvideos',
url: 'https://www.youtube.com/user/EEAvideos',
},
{
name: 'instagram',
icon: 'ri-instagram-fill',
link: 'https://www.instagram.com/ourplanet_eu',
url: 'https://www.instagram.com/ourplanet_eu',
},
{ name: 'rss', icon: 'ri-rss-fill', link: '/subscription/news-feeds' },
{ name: 'rss', icon: 'ri-rss-fill', url: '/subscription/news-feeds' },
],
contacts: [
{
text: 'About us',
link: '/about',
url: '/about',
children: [
{ text: 'FAQs', link: 'http://external.site' },
{ text: 'Careers', link: '/careers' },
{ text: 'FAQs', url: 'http://external.site' },
{ text: 'Careers', url: '/careers' },
],
},
{ text: 'Contact us', link: '/contact-us' },
{ text: 'Sign up to our newsletter', link: '/newsletter' },
{ text: 'Contact us', url: '/contact-us' },
{ text: 'Sign up to our newsletter', url: '/newsletter' },
],
};
12 changes: 6 additions & 6 deletions src/ui/Footer/FooterActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const FooterActions = (props) => {
<div className="actions">
{props.actions &&
props.actions.map((action, index) =>
isInternalURL(action.link) ? (
<Link to={action.link} key={index}>
isInternalURL(action.url) ? (
<Link to={action.url} key={index}>
{action.title}
</Link>
) : (
<a
href={action.link}
href={action.url}
key={index}
target={'_blank'}
rel={'noreferrer'}
Expand All @@ -37,13 +37,13 @@ const FooterActions = (props) => {
<div className="copyright">
{props.copyright &&
props.copyright.map((copyright, index) =>
isInternalURL(copyright.link) ? (
<Link to={copyright.link} key={index}>
isInternalURL(copyright.url) ? (
<Link to={copyright.url} key={index}>
{copyright.title}
</Link>
) : (
<a
href={copyright.link}
href={copyright.url}
key={index}
target={'_blank'}
rel={'noreferrer'}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/Footer/FooterSites.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const Sites = (props) => {
const nextItem = logos[i + 1];
column.push(
<Grid.Column className="logo" key={i}>
<a className="logo" href={item.link}>
<a className="logo" href={item.url}>
<LazyLoadComponent>
<Image src={item.src} alt={item.alt}></Image>
</LazyLoadComponent>
</a>
<a className="logo" href={nextItem.link}>
<a className="logo" href={nextItem.url}>
<LazyLoadComponent>
<Image src={nextItem.src} alt={nextItem.alt}></Image>
</LazyLoadComponent>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/Footer/Social.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Social = (props) => {
<Grid.Row>
<div className="social">
{props.social?.map((item, index) => (
<a href={item.link} aria-label={`${item.name} link`} key={index}>
<a href={item.url} aria-label={`${item.name} link`} key={index}>
<Icon className={item.icon}></Icon>
</a>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/Footer/SubFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SubFooter = (props) => {
>
<div className="item">
<div className={manager.className}>
<a href={manager.link}>
<a href={manager.url}>
<LazyLoadComponent>
<Image src={manager.src} alt={manager.alt}></Image>
</LazyLoadComponent>
Expand Down Expand Up @@ -55,7 +55,7 @@ const SubFooter = (props) => {
>
<div className="item">
<div className={manager.className}>
<a href={manager.link}>
<a href={manager.url}>
<LazyLoadComponent>
<Image src={manager.src} alt={manager.alt}></Image>
</LazyLoadComponent>
Expand Down

0 comments on commit 5b9cc2c

Please sign in to comment.