diff --git a/src/components/Card/index.js b/src/components/Card/index.js index 1c202b1feb976..3c44f69c2433c 100644 --- a/src/components/Card/index.js +++ b/src/components/Card/index.js @@ -13,7 +13,6 @@ const Card = ({ fetchpriority = "auto", }) => { const { isDark } = useStyledDarkMode(); - return (
@@ -53,21 +52,30 @@ const Card = ({
{fields && fields.slug && frontmatter.eurl && ( <> - + see more )} {fields && fields.slug && !frontmatter.eurl && ( - + see more )} @@ -76,7 +84,8 @@ const Card = ({ className="external-link-btn" href={frontmatter.eurl} target="_blank" - rel="noreferrer" + rel="noreferrer noopener" + aria-label={`Visit external link for ${frontmatter.title}`} > @@ -88,4 +97,4 @@ const Card = ({ ); }; -export default Card; +export default Card; \ No newline at end of file diff --git a/src/components/UpcomingEventCard/index.js b/src/components/UpcomingEventCard/index.js index 6761d5a72d69d..cc757eb509329 100644 --- a/src/components/UpcomingEventCard/index.js +++ b/src/components/UpcomingEventCard/index.js @@ -8,43 +8,60 @@ import "swiper/css/bundle"; import Button from "../../reusecore/Button"; import slugify from "../../utils/slugify"; - const UpcomingEvents = ({ data }) => { return (
-
- - {data.nodes.map(item => { + {data.nodes.map((item) => { return (
- - {item.frontmatter.title} + + {item.frontmatter.title}
-

{item.frontmatter.title}

-

{item.frontmatter.date}

-

{item.frontmatter.abstract}

-
); })}
-
diff --git a/src/sections/Events/index.js b/src/sections/Events/index.js index 9963db08c1fa1..14d28f5ce8907 100644 --- a/src/sections/Events/index.js +++ b/src/sections/Events/index.js @@ -10,59 +10,104 @@ import RssFeedIcon from "../../assets/images/socialIcons/rss-sign.svg"; const Meetups = ({ data, pageContext }) => { const [active, setActive] = useState("all"); + const sortEvents = (nodes) => { - return nodes.slice().sort((first, second) => new Date(second.frontmatter.date.replace(/(st|nd|rd|th),/g, "")) - new Date(first.frontmatter.date.replace(/(st|nd|rd|th),/g, ""))); + return nodes + .slice() + .sort( + (first, second) => + new Date(second.frontmatter.date.replace(/(st|nd|rd|th),/g, "")) - + new Date(first.frontmatter.date.replace(/(st|nd|rd|th),/g, "")), + ); }; return ( - -

Join Layer5 at these events

- - -
-
-
- + +

Join Layer5 at these events

+ + +
- {active == "all" ? sortEvents(data.allCategories.nodes).map(category => { - return ( - - - - ); - }) : <>} - {active == "events" ? sortEvents(data.allEvents.nodes).map(event => { - return ( - - - - ); - }) : <>} - {active == "workshops" ? sortEvents(data.allWorkshops.nodes).map(workshop => { - return ( - - - - ); - }) : <>} - {active == "meetups" ? sortEvents(data.allMeetups.nodes).map(meetup => { - return ( - - - - ); - }) : <>} - -
- {active == "all" ? : <>} -
+
+
+ + {active === "all" && + sortEvents(data.allCategories.nodes).map((category) => ( + + + + ))} + {active === "events" && + sortEvents(data.allEvents.nodes).map((event) => ( + + + + ))} + {active === "workshops" && + sortEvents(data.allWorkshops.nodes).map((workshop) => ( + + + + ))} + {active === "meetups" && + sortEvents(data.allMeetups.nodes).map((meetup) => ( + + + + ))} + +
+ {active === "all" && ( + + )} +
+
); };