Skip to content

Commit 822fd55

Browse files
committed
Create single component for TwoColc.
1 parent 9b7c9c8 commit 822fd55

File tree

4 files changed

+37
-26
lines changed

4 files changed

+37
-26
lines changed

src/components/TwoCols.astro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
const {content, sidebar } = Astro.props;
3+
---
4+
<section class="space-y-12 pb-6 md:p-6">
5+
<div class="flex flex-col lg:flex-row-reverse gap-6">
6+
<div class="w-full lg:max-w-[400px] lg:sticky lg:top-6 self-start">
7+
<slot name="content"/>
8+
</div>
9+
<div class="flex-1">
10+
<slot name="sidebar" />
11+
</div>
12+
</div>
13+
</section>

src/pages/company/[company]/[job].astro

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import Layout from "@layouts/MarkdownLayout.astro";
33
import JobCard from "@components/JobCard.astro";
44
import CompanyCard from "@components/CompanyCard.astro";
5+
import TwoCols from "@components/TwoCols.astro";
56
67
import { getEntry } from "astro:content";
78
@@ -31,13 +32,13 @@ export async function getStaticPaths() {
3132
description="EuroPython is the largest Python conference in Europe. We are looking forward to seeing you in Prague, Czech Republic & Remote from July 14th-20th 2025."
3233
>
3334
<section class="space-y-12 pb-6 md:p-6">
34-
<div class="flex flex-col lg:flex-row-reverse gap-6">
35-
<div class="w-full lg:max-w-[400px] lg:sticky lg:top-6 self-start">
35+
<TwoCols>
36+
<Fragment slot="content">
3637
<CompanyCard {company} />
37-
</div>
38-
<div class="flex-1">
38+
</Fragment>
39+
<Fragment slot="sidebar">
3940
{(<JobCard {job} />)}
40-
</div>
41-
</div>
41+
</Fragment>
42+
</TwoCols>
4243
</section>
4344
</Layout>

src/pages/company/[company]/index.astro

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import Layout from "@layouts/MarkdownLayout.astro";
33
import CompanyCard from "@components/CompanyCard.astro";
44
import CompanyCardBody from "@components/CompanyCardBody.astro";
5+
import TwoCols from "@components/TwoCols.astro";
56
67
import { getEntry, getCollection } from "astro:content";
78
@@ -22,19 +23,14 @@ export async function getStaticPaths() {
2223
title="EuroPython 2025 | July 14th-20th 2025 | Prague, Czech Republic & Remote"
2324
description="EuroPython is the largest Python conference in Europe. We are looking forward to seeing you in Prague, Czech Republic & Remote from July 14th-20th 2025."
2425
>
25-
26-
27-
<section class="space-y-12 pb-6 md:p-6">
28-
<div class="flex flex-col lg:flex-row-reverse gap-6">
29-
<div class="flex flex-col md:flex-row-reverse gap-6">
30-
<div class="w-full lg:max-w-[400px] lg:sticky lg:top-6 self-start">
31-
<CompanyCard {company} />
32-
</div>
33-
<div class="flex-1 ">
34-
<CompanyCardBody {company} />
35-
</div>
36-
</div>
37-
</section>
38-
<section class="space-y-12 pb-6">
26+
<section class="space-y-12 pb-6 md:p-6">
27+
<TwoCols>
28+
<Fragment slot="content">
29+
<CompanyCard {company} />
30+
</Fragment>
31+
<Fragment slot="sidebar">
32+
<CompanyCardBody {company} />
33+
</Fragment>
34+
</TwoCols>
3935
</section>
4036
</Layout>

src/pages/jobs.astro

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Layout from "@layouts/MarkdownLayout.astro";
55
66
import CompanyCard from "@components/CompanyCard.astro";
77
import JobCard from "@components/JobCard.astro";
8+
import TwoCols from "@components/TwoCols.astro";
89
910
const companies = await getCollection("companies");
1011
@@ -32,20 +33,20 @@ for (const path in jobFiles) {
3233
companies.map((company) => {
3334
const companyJobs = companiesJobsMap[company.id];
3435
return (
35-
<div class="flex flex-col lg:flex-row-reverse gap-6">
36-
<div class="w-full lg:max-w-[400px] lg:sticky lg:top-6 self-start">
36+
<TwoCols>
37+
<Fragment slot="content">
3738
<CompanyCard {company} />
38-
</div>
39-
<div class="flex-1 ">
39+
</Fragment>
40+
<Fragment slot="sidebar">
4041
{companyJobs.length > 0 && (
4142
<>
4243
{companyJobs.map((job) => (
4344
<JobCard {job} />
4445
))}
4546
</>
4647
)}
47-
</div>
48-
</div>
48+
</Fragment>
49+
</TwoCols>
4950
);
5051
})
5152
}

0 commit comments

Comments
 (0)