diff --git a/src/components/CTA.astro b/src/components/CTA.astro index c43574a7..b5a75f53 100644 --- a/src/components/CTA.astro +++ b/src/components/CTA.astro @@ -41,7 +41,7 @@ if (pathname.startsWith("/ecosystem/providers")) { mt-10 flex flex-col items-center justify-around bg-white border-y px-[30px] py-[80px] text-center dark:bg-background2 md:mt-16 lg:py-[160px]`} >

{title}

diff --git a/src/components/community-pages/nav-config.ts b/src/components/community-pages/nav-config.ts index 52e6f75f..0c5273e9 100644 --- a/src/components/community-pages/nav-config.ts +++ b/src/components/community-pages/nav-config.ts @@ -6,7 +6,7 @@ export const nav: any = [ }, { label: "Events", - link: "/community/events/upcoming", + link: "/community/events/", enabled: true, }, diff --git a/src/components/footer/footer.astro b/src/components/footer/footer.astro index 27ec4db5..2675771b 100644 --- a/src/components/footer/footer.astro +++ b/src/components/footer/footer.astro @@ -118,7 +118,7 @@ const links = [ { title: "Events", - link: "/community/events/upcoming", + link: "/community/events", }, ], }, diff --git a/src/components/header/popovers/links.tsx b/src/components/header/popovers/links.tsx index 8ab23cae..483224b5 100644 --- a/src/components/header/popovers/links.tsx +++ b/src/components/header/popovers/links.tsx @@ -13,7 +13,7 @@ export const communityItems = [ icon: CalendarHeart, title: "Events", - link: "/community/events/upcoming/", + link: "/community/events/", }, { icon: BadgeCheck, diff --git a/src/content/Community_Page/events/archived.mdx b/src/content/Community_Page/events/archived.mdx new file mode 100644 index 00000000..565b6095 --- /dev/null +++ b/src/content/Community_Page/events/archived.mdx @@ -0,0 +1,9 @@ +--- +title: Akash Events (Archive) +description: Here is the list of archived events + +pubDate: "2024-10-14" +disableTableOfContents: true +--- + + diff --git a/src/content/Community_Page/events/index.mdx b/src/content/Community_Page/events/index.mdx index f7bb1e0b..b27601e4 100644 --- a/src/content/Community_Page/events/index.mdx +++ b/src/content/Community_Page/events/index.mdx @@ -1,6 +1,6 @@ --- title: Akash Events -description: Akash is coming to town! Check out all the upcoming events where you can connect with members of the Akash community IRL. +description: Explore the list of upcoming events pubDate: "2020-01-19" disableTableOfContents: true diff --git a/src/pages/community/events/archived.astro b/src/pages/community/events/archived.astro new file mode 100644 index 00000000..8be9895b --- /dev/null +++ b/src/pages/community/events/archived.astro @@ -0,0 +1,79 @@ +--- +import Layout from "@/layouts/layout.astro"; +import { getCollection, getEntry } from "astro:content"; +import ButtonLink from "../../../components/ui/button-link.astro"; + +import EventCard from "@/components/community-pages/event-card.astro"; +import TopMargin from "@/components/ui/top-margin.astro"; + +const cards = await getCollection("Community_Akash_Events_Page"); +const { data } = await getEntry("Community_Page", "events/archived"); + +const allCards = cards.map((card) => card.data); + +const eventDurationInMilliSeconds = 864000000; +const archivePeriodInMilliSeconds = 31449600000; +const currentOffsetDateTime = new Date( + new Date()?.getTime() - eventDurationInMilliSeconds, +).getTime(); +const cutoffOffsetDateTime = new Date( + new Date()?.getTime() - archivePeriodInMilliSeconds, +).getTime(); + +const archivedCards = allCards.filter((curr: any) => { + if (curr.tbd) { + return false; + } + const eventDate = new Date(curr.eventDate).getTime(); + + if (eventDate < cutoffOffsetDateTime) { + return false; + } + + return eventDate < currentOffsetDateTime; +}); + +const sortedCards = archivedCards.sort((a, b) => { + return new Date(a.eventDate).getTime() - new Date(b.eventDate).getTime(); +}); +--- + + + +
+
+
+

+ {data?.title} +

+

+ {data?.description} +

+
+
+ +
+ { + ( +
+ {sortedCards.map((card: any) => ( + + ))} +
+ ) + } +
+ + See current and upcoming events + +
+
+
+
+
+
diff --git a/src/pages/community/events/index.astro b/src/pages/community/events/index.astro index 121f850a..8ca1a2db 100644 --- a/src/pages/community/events/index.astro +++ b/src/pages/community/events/index.astro @@ -1,59 +1,38 @@ --- -import Tag from "@/components/ui/tag2.astro"; import Layout from "@/layouts/layout.astro"; import { getCollection, getEntry } from "astro:content"; +import ButtonLink from "../../../components/ui/button-link.astro"; import EventCard from "@/components/community-pages/event-card.astro"; import TopMargin from "@/components/ui/top-margin.astro"; const cards = await getCollection("Community_Akash_Events_Page"); const { data } = await getEntry("Community_Page", "events"); - const allCards = cards.map((card) => card.data); +const eventDurationInMilliSeconds = 864000000; +const currentOffsetDateTime = new Date( + new Date().getTime() - eventDurationInMilliSeconds, +).getTime(); -const astroUrl = Astro.url; - -const monthwise = allCards.reduce((acc: any, curr: any) => { +const relevantCards = allCards.filter((curr: any) => { if (curr.tbd) { - if (!acc["TBD"]) { - acc["TBD"] = []; - } - acc["TBD"].push(curr); - return acc; + return true; } - const month = new Date(curr.eventDate).toLocaleString("default", { - month: "long", - }); - if (!acc[month]) { - acc[month] = []; - } - acc[month].push(curr); + const eventDate = new Date(curr.eventDate).getTime(); - return acc; -}, {}); - -const monthwiseArray = Object.keys(monthwise).map((month) => { - return { - month, - events: monthwise?.[month]?.sort((a: any, b: any) => { - return new Date(a.eventDate).getTime() - new Date(b.eventDate).getTime(); - }), - }; + return eventDate > currentOffsetDateTime; }); -const sortedMonthwiseArray = monthwiseArray.sort((a, b) => { - if (a.month === "TBD") { +const sortedCards = relevantCards.sort((a, b) => { + if (a.tbd) { return 1; } - if (b.month === "TBD") { + if (b.tbd) { return -1; } - return ( - new Date(a.events[0].eventDate).getTime() - - new Date(b.events[0].eventDate).getTime() - ); + return new Date(a.eventDate).getTime() - new Date(b.eventDate).getTime(); }); --- @@ -66,45 +45,33 @@ const sortedMonthwiseArray = monthwiseArray.sort((a, b) => {
-
+

{data?.title}

{data?.description}

- -
-
- -
- - All - - - Upcoming
{ - sortedMonthwiseArray?.map((item: any) => ( -
-

- {item.month} -

-
- {item.events.map((card: any) => ( - - ))} -
+ ( +
+ {sortedCards.map((card: any) => ( + + ))}
- )) + ) } +
+ + See past events in the archive + +
+
diff --git a/src/pages/community/events/upcoming.astro b/src/pages/community/events/upcoming.astro deleted file mode 100644 index ce18baba..00000000 --- a/src/pages/community/events/upcoming.astro +++ /dev/null @@ -1,116 +0,0 @@ ---- -import Tag from "@/components/ui/tag2.astro"; -import Layout from "@/layouts/layout.astro"; -import { getCollection } from "astro:content"; - -import EventCard from "@/components/community-pages/event-card.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; - -const cards = await getCollection("Community_Akash_Events_Page"); - -const allCards = cards.map((card) => card.data); - -const monthwise = allCards.reduce((acc: any, curr: any) => { - if (curr.tbd) { - if (!acc["TBD"]) { - acc["TBD"] = []; - } - acc["TBD"].push(curr); - return acc; - } - - const month = new Date(curr.eventDate).toLocaleString("default", { - month: "long", - }); - if (!acc[month]) { - acc[month] = []; - } - acc[month].push(curr); - - return acc; -}, {}); - -const monthwiseArray = Object.keys(monthwise).map((month) => { - return { - month, - events: monthwise?.[month]?.sort((a: any, b: any) => { - return new Date(a.eventDate).getTime() - new Date(b.eventDate).getTime(); - }), - }; -}); - -const sortedMonthwiseArray = monthwiseArray.sort((a, b) => { - if (a.month === "TBD") { - return 1; - } - if (b.month === "TBD") { - return -1; - } - - return ( - new Date(a.events[0].eventDate).getTime() - - new Date(b.events[0].eventDate).getTime() - ); -}); - -const currentDate = new Date(); - -const filteredMonthwiseArray = sortedMonthwiseArray.map((item: any) => { - return { - month: item.month, - events: item.events.filter((event: any) => { - return new Date(event.eventDate).getTime() > currentDate.getTime(); - }), - }; -}); - -const filteredMonthwiseArray2 = filteredMonthwiseArray.filter((item: any) => { - return item.events.length > 0; -}); ---- - - - -
-
-
-

- Akash Events -

-

- Here is the list of upcoming events -

- -
-
- -
- All - - Upcoming -
-
- -
- { - filteredMonthwiseArray2?.map((item: any) => ( -
-

- {item.month} -

-
- {item.events.map((card: any) => ( - - ))} -
-
- )) - } -
-
-
-
diff --git a/src/pages/deploy.astro b/src/pages/deploy.astro index e31e665a..a4ec87e1 100644 --- a/src/pages/deploy.astro +++ b/src/pages/deploy.astro @@ -1,15 +1,14 @@ --- -import Layout from "@/layouts/layout.astro"; -import { getEntryBySlug } from "astro:content"; +import CloudmosCards from "@/components/deploy-page/cloudmos-cards.astro"; import ResourcesCard from "@/components/deploy-page/resources-card.astro"; import TopPagination from "@/components/deploy-page/top-pagination.astro"; +import Layout from "@/layouts/layout.astro"; import { Image } from "astro:assets"; -import CloudmosCards from "@/components/deploy-page/cloudmos-cards.astro"; +import { getEntry } from "astro:content"; -const deployPage = await getEntryBySlug("Deploy_Homepage", "index"); +const deployPage = await getEntry("Deploy_Homepage", "index"); const { - pageTitle, resourcesSection, heroSection, cloudmosResourcesSection, @@ -23,7 +22,7 @@ const {
-

{heroSection.title} @@ -49,7 +47,7 @@ const {
    - {heroSection.featureList.map((li) =>
  • {`• ${li}`}
  • )} + {heroSection.featureList.map((li: string) =>
  • {`• ${li}`}
  • )}
@@ -101,7 +99,7 @@ const {