From af0c0075c18c15a7d567bc4e2f7ce3c58cca4566 Mon Sep 17 00:00:00 2001 From: Brian Muenzenmeyer Date: Thu, 29 Feb 2024 10:31:24 -0600 Subject: [PATCH] Events tweaks (#6356) Co-authored-by: Claudio W --- ...pcomingEvents.tsx => UpcomingMeetings.tsx} | 8 ++-- components/MDX/Calendar/UpcomingSummits.tsx | 38 ------------------- next.mdx.use.mjs | 9 ++--- pages/en/about/get-involved/events.mdx | 18 +++------ 4 files changed, 12 insertions(+), 61 deletions(-) rename components/MDX/Calendar/{UpcomingEvents.tsx => UpcomingMeetings.tsx} (90%) delete mode 100644 components/MDX/Calendar/UpcomingSummits.tsx diff --git a/components/MDX/Calendar/UpcomingEvents.tsx b/components/MDX/Calendar/UpcomingMeetings.tsx similarity index 90% rename from components/MDX/Calendar/UpcomingEvents.tsx rename to components/MDX/Calendar/UpcomingMeetings.tsx index e6070814693ad..cac02b5d71fc8 100644 --- a/components/MDX/Calendar/UpcomingEvents.tsx +++ b/components/MDX/Calendar/UpcomingMeetings.tsx @@ -9,9 +9,9 @@ import type { CalendarEvent } from '@/types'; import styles from './calendar.module.css'; -type GrouppedEntries = Record>; +type GroupedEntries = Record>; -const UpcomingEvents: FC = async () => { +const UpcomingMeetings: FC = async () => { const events = await getCalendarEvents(CALENDAR_NODEJS_ID); const groupedEntries = events.filter(getZoomLink).reduce((acc, event) => { @@ -25,7 +25,7 @@ const UpcomingEvents: FC = async () => { acc[datePerDay].push(event); return acc; - }, {} as GrouppedEntries); + }, {} as GroupedEntries); const sortedGroupedEntries = Object.entries(groupedEntries).sort( ([dateA], [dateB]) => new Date(dateA).getTime() - new Date(dateB).getTime() @@ -51,4 +51,4 @@ const UpcomingEvents: FC = async () => { )); }; -export default UpcomingEvents; +export default UpcomingMeetings; diff --git a/components/MDX/Calendar/UpcomingSummits.tsx b/components/MDX/Calendar/UpcomingSummits.tsx deleted file mode 100644 index e42d411419cda..0000000000000 --- a/components/MDX/Calendar/UpcomingSummits.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { getTranslations } from 'next-intl/server'; -import type { FC } from 'react'; - -import BlogPostCard from '@/components/Common/BlogPostCard'; -import getBlogData from '@/next-data/blogData'; - -import styles from './calendar.module.css'; - -const UpcomingSummits: FC = async () => { - const t = await getTranslations(); - const { posts } = await getBlogData('events', 0); - - const currentDate = new Date(); - const filteredPosts = posts.filter(post => post.date >= currentDate); - - const fallbackPosts = Array(2).fill({ - title: t('components.mdx.upcomingEvents.defaultTitle'), - categories: ['events'], - }); - - const mappedPosts = fallbackPosts.map((post, key) => { - const actualPost = filteredPosts[key] || post; - - return ( - - ); - }); - - return
{mappedPosts}
; -}; - -export default UpcomingSummits; diff --git a/next.mdx.use.mjs b/next.mdx.use.mjs index 1b63905245d26..c3ab76c77df6c 100644 --- a/next.mdx.use.mjs +++ b/next.mdx.use.mjs @@ -20,8 +20,7 @@ import VerifyingBinariesLink from './components/Downloads/Release/VerifyingBinar import VersionDropdown from './components/Downloads/Release/VersionDropdown'; import HomeDownloadButton from './components/Home/HomeDownloadButton'; import Link from './components/Link'; -import UpcomingEvents from './components/MDX/Calendar/UpcomingEvents'; -import UpcomingSummits from './components/MDX/Calendar/UpcomingSummits'; +import UpcomingMeetings from './components/MDX/Calendar/UpcomingMeetings'; import MDXCodeBox from './components/MDX/CodeBox'; import MDXCodeTabs from './components/MDX/CodeTabs'; import SearchPage from './components/MDX/SearchPage'; @@ -56,10 +55,8 @@ export const mdxComponents = { Button: Button, // Renders a Search Page SearchPage: SearchPage, - // Renders an container for Upcoming Node.js Summits - UpcomingSummits: UpcomingSummits, - // Renders an container for Upcoming Node.js Events - UpcomingEvents: UpcomingEvents, + // Renders an container for Upcoming Node.js Meetings + UpcomingMeetings: UpcomingMeetings, // Links with External Arrow LinkWithArrow: LinkWithArrow, // Group of components that enable you to select versions for Node.js diff --git a/pages/en/about/get-involved/events.mdx b/pages/en/about/get-involved/events.mdx index 2b78e7f1928f6..141f7ccbc2c2b 100644 --- a/pages/en/about/get-involved/events.mdx +++ b/pages/en/about/get-involved/events.mdx @@ -3,22 +3,14 @@ title: Upcoming Events layout: about.hbs --- -## Upcoming Node.js® Summits +## Upcoming Events -Interested in joining a [Collaborator Summit](/about/get-involved/collab-summit) hosted by the Node.js project? -Check out the list below to find upcoming events. +Node.js events are open and available to the public. Anyone is welcome to join and participate. -Browse [previous Collaborator Summits & Events](/blog/events/) hosted by Node.js. - - - ---- - -## Upcoming Node.js® Events +### Upcoming Node.js® Meetings The Node.js project holds numerous meetings throughout the year to discuss and plan aspects of the project. -These meetings are open and available to the public. Anyone is welcome to join and participate. -The following Events are upcoming in the next 7 days. +The following meetings are upcoming in the next 7 days. - +