Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ const upcomingCohortsSectionCollection = defineCollection({
link: z.string().optional(),
blogLink: z.string().optional(),
closed: z.boolean().optional(),
status: z.string().optional(),
}),
),
}),
Expand Down
1 change: 1 addition & 0 deletions src/content/sections/upcoming-cohorts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cohorts:
description: 'Networks'
duration: '3 weeks'
dates: 'starting March 30'
status: 'Closing soon!'
link: 'https://sovereignengineering.typeform.com/SEC-07'
blogLink: 'https://primal.net/soveng/sec-07-the-network-stack'
- name: 'SEC-08'
Expand Down
6 changes: 5 additions & 1 deletion src/layouts/partials/CallToAction.astro
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ const resolvedImage = imageMap[call_to_action.data.image] || null;
)}
</div>
<p class="mt-4 text-white text-lg">
Can't make March? Check the dates of our <a href="/#upcoming-cohorts" class="underline hover:no-underline">upcoming cohorts</a>.
Can't make April? Check the dates of our{" "}
<a href="/#upcoming-cohorts" class="underline hover:no-underline">
upcoming cohorts
</a>
.
</p>
</div>
</div>
Expand Down
24 changes: 18 additions & 6 deletions src/layouts/partials/UpcomingCohorts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { upcoming_cohorts } = Astro.props;
<h2 set:html={markdownify(upcoming_cohorts.data.title)} class="mb-4" />
<div class="flex flex-col gap-2">
{upcoming_cohorts.data.cohorts.map(
(cohort: { name: string; description?: string; duration?: string; dates: string; link?: string; blogLink?: string; closed?: boolean }) => {
(cohort: { name: string; description?: string; duration?: string; dates: string; link?: string; blogLink?: string; closed?: boolean; status?: string }) => {
const descriptionPart = cohort.description ? `: ${cohort.description}` : '';
const durationDesktop = cohort.duration ? `${cohort.duration}, ` : '';
const durationMobile = cohort.duration ? `${cohort.duration.replace('weeks', 'wks')}, ` : '';
Expand All @@ -33,7 +33,7 @@ const { upcoming_cohorts } = Astro.props;
</>
);
return (
<div class="text-lg font-medium text-text-dark dark:text-white">
<div class={`text-lg font-medium text-text-dark dark:text-white ${cohort.closed ? 'opacity-60' : ''}`}>
{nameAndDescription}
{` (`}
<span class="hidden md:inline">{durationDesktop}</span>
Expand All @@ -44,10 +44,22 @@ const { upcoming_cohorts } = Astro.props;
{cohort.closed ? (
<span class="text-text dark:text-darkmode-text opacity-60"> - Applications closed</span>
) : cohort.link && (
<> - <a href={cohort.link} target="_blank" rel="noopener noreferrer" class="underline hover:no-underline">
<span class="hidden md:inline">Apply now!</span>
<span class="md:hidden">Apply</span>
</a></>
<>
{" - "}
<a
href={cohort.link}
target="_blank"
rel="noopener noreferrer"
class="underline hover:no-underline"
>
<span class="hidden md:inline">
{cohort.status ?? "Apply now!"}
</span>
<span class="md:hidden">
{cohort.status ? cohort.status : "Apply"}
</span>
</a>
</>
)}
</div>
);
Expand Down