Skip to content

Commit 377e6ee

Browse files
committed
feat(Schedule): TimeTableコンポーネントを使う
1 parent 51eaeb4 commit 377e6ee

File tree

4 files changed

+45
-25
lines changed

4 files changed

+45
-25
lines changed

2025/src/components/Schedule.astro

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
import { getCollection } from "astro:content";
3+
import Heading from "../Heading.astro";
4+
import TimeTable from "./TimeTable.astro";
5+
6+
const timetable = await getCollection("timetable");
7+
---
8+
9+
<section id="schedule" class="bg-white py-10 md:py-16">
10+
<div class="container mx-auto px-4 max-w-4xl">
11+
<Heading>スケジュール</Heading>
12+
{
13+
timetable
14+
.shift()
15+
?.data.map((schedule) => <TimeTable {...schedule} />)
16+
}
17+
</div>
18+
</section>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { MicVocal, Zap, Coffee } from "@lucide/astro";
2+
3+
export const getScheduleCardStyle = (title: string) => {
4+
const isBreak = ["Short break", "Lunch break"].includes(title);
5+
if (isBreak) {
6+
return ["bg-gray-50 border-gray-200", Coffee];
7+
}
8+
const isLightningTalks = title === "Lightning talks";
9+
if (isLightningTalks) {
10+
return ["bg-yellow-50 border-yellow-200", Zap];
11+
}
12+
13+
const isOtherEvent = ["Opening", "Closing", "After party"].includes(title);
14+
if(isOtherEvent) {
15+
return ["bg-blue-50 border-blue-200", MicVocal]
16+
}
17+
18+
19+
return ["bg-green-50", MicVocal];
20+
};
21+
22+
export const formatTime = (date: Date): string => {
23+
const hours = date.getHours().toString().padStart(2, "0");
24+
const minutes = date.getMinutes().toString().padStart(2, "0");
25+
return `${hours}:${minutes}`;
26+
};

2025/src/pages/[lang]/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import AboutVimConf from "../../components/AboutVimConf.astro";
33
import KeynoteSpeakers from "../../components/KeynoteSpeakers/index.astro";
4-
import Schedule from "../../components/Schedule.astro";
4+
import Schedule from "../../components/Schedule/index.astro";
55
import Sponsors from "../../components/Sponsors/index.astro";
66
import Staff from "../../components/Staff/index.astro";
77
import Top from "../../components/Top.astro";

0 commit comments

Comments
 (0)