-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from piber-dev/main
events
- Loading branch information
Showing
12 changed files
with
137 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Akash Events (Archive) | ||
description: Here is the list of archived events | ||
|
||
pubDate: "2024-10-14" | ||
disableTableOfContents: true | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
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/archived"); | ||
const allCards = cards.map((card) => card.data); | ||
const eventDurationInMilliSeconds = 864000000; // 10 days | ||
const archivePeriodInMilliSeconds = 31449600000; // 1 year | ||
const currentOffsetDateTime = new Date(new Date() - eventDurationInMilliSeconds).getTime(); // offset into the past as event duration can last up to a week | ||
const cutoffOffsetDateTime = new Date(new Date() - archivePeriodInMilliSeconds).getTime(); // cutoff time set into the past by the archive period variable for when events should not be shown in archive | ||
const archivedCards = allCards.filter((curr: any) => { | ||
// skip all tbd events for the archive as we never went to those or they are in the future | ||
if (curr.tbd) { | ||
return false; | ||
} | ||
const eventDate = new Date(curr.eventDate).getTime(); | ||
if (eventDate < cutoffOffsetDateTime) { | ||
return false; | ||
} | ||
return eventDate < currentOffsetDateTime; | ||
}); | ||
const astroUrl = Astro.url; | ||
const sortedCards = archivedCards.sort((a, b) => { | ||
return ( | ||
new Date(a.eventDate).getTime() - | ||
new Date(b.eventDate).getTime() | ||
); | ||
}); | ||
--- | ||
|
||
<Layout | ||
title={data?.title} | ||
image="/meta-images/community.png" | ||
image="/meta-images/community.png" | ||
description={data?.description} | ||
> | ||
<TopMargin> | ||
<div class="overflow-hidden"> | ||
<div> | ||
<div class="mx-auto mt-10 md:mt-0 text-center"> | ||
<h1 id="overview" class="text-3xl md:text-4xl lg:text-5xl"> | ||
{data?.title} | ||
</h1> | ||
<p class="mt-3 text-base leading-[24px] text-para"> | ||
{data?.description} | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="overflow-hidden"> | ||
{ | ||
<div class="mt-8 grid grid-cols-1 gap-y-8 sm:grid-cols-2 sm:gap-x-6 lg:grid-cols-3 2xl:grid-cols-4"> | ||
{sortedCards.map((card: any) => ( | ||
<EventCard key={card.id} card={card} /> | ||
))} | ||
</div> | ||
} | ||
<div class="flex justify-center mt-10"> | ||
<ButtonLink | ||
variant="secondary" | ||
size="xs" | ||
link={"../events/"} | ||
> | ||
See current and upcoming events | ||
</ButtonLink> | ||
</div> | ||
</div> | ||
</div> | ||
</TopMargin> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.