Skip to content

Commit

Permalink
Merge pull request #21 from gdgbari/main
Browse files Browse the repository at this point in the history
fix: fixed scheduling + hardcode time fix on a talk
  • Loading branch information
domysh authored Sep 18, 2024
2 parents c054388 + ffedcd3 commit fb2c860
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 16 deletions.
37 changes: 30 additions & 7 deletions src/components/Schedule/Pages/ScheduleList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,40 @@
import ScheduleCard from "../ScheduleCard.astro";
import { getLangFromUrl, useTranslations } from "../../../i18n/utils";
import { getSchedule } from "../../../data/api/sessionize_api";
import "./grid-style.css";
const schedule = await getSchedule();
const schedule = (await getSchedule()).map((s) => {
s.rooms = s.rooms.map((r) => {
r.sessions = r.sessions.map((si) => {
if (si.title.indexOf("42!") != -1){
si.endsAt = "2024-10-26T14:35:00Z"
}
return si
});
return r
});
s.timeSlots = s.timeSlots.map((ts) => {
ts.rooms = ts.rooms.map((r) => {
if (r.session.title.indexOf("42!") != -1){
r.session.endsAt = "2024-10-26T14:35:00Z"
}
return r
});
return ts
})
return s
});
const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang);
---
<div class="text-white">


{
schedule.map((s) => {
const totalScheduleCols = s.rooms.length + 1;
const totalScheduleCols = s.rooms.length;
const totalScheduleRows = s.timeSlots.length;
let skipPadding: {[key:string]:number} = s.rooms.map((room) => ({[room.id]:0})).reduce((a,b)=>({...a,...b}),{})
return (
Expand All @@ -24,11 +48,10 @@ const t = useTranslations(lang);
weekday: "long",
})}
</p>
<div
class={`grid grid-flow-row xl:grid-cols-[90px_repeat(5,_minmax(0,_1fr))] xl:grid-rows-${totalScheduleRows} grid-cols-1 gap-4`}
>
{/* Some classes are created manually due to tilewind issues */}
<div class={`grid grid-flow-row grid-cols-layout-${totalScheduleCols} grid-rows-layout-${totalScheduleRows} grid-cols-1 gap-4`} >
{s.timeSlots.map((ts,ts_idx) => {

const hasServiceSession = ts.rooms.some(
(tsr) => tsr.session.isServiceSession,
);
Expand Down Expand Up @@ -77,7 +100,7 @@ const t = useTranslations(lang);
}
return {
data: tsr,
html: <div class={`xl:col-span-${ hasServiceSession ? totalScheduleCols - 1 : 1 } row-span-${slots}`}>
html: <div class={`xl:col-span-${ hasServiceSession ? totalScheduleCols : 1 } row-span-${slots}`}>
<ScheduleCard value={tsr} />
</div>
};
Expand Down
62 changes: 62 additions & 0 deletions src/components/Schedule/Pages/grid-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@media (min-width: 1280px) {
.grid-cols-layout-1 {
grid-template-columns: 90px repeat(1, minmax(0, 1fr));
}
.grid-rows-layout-1 {
grid-template-rows: repeat(1, minmax(0, 1fr));
}
.grid-cols-layout-2 {
grid-template-columns: 90px repeat(2, minmax(0, 1fr));
}
.grid-rows-layout-2 {
grid-template-rows: repeat(2, minmax(0, 1fr));
}
.grid-cols-layout-3 {
grid-template-columns: 90px repeat(3, minmax(0, 1fr));
}
.grid-rows-layout-3 {
grid-template-rows: repeat(3, minmax(0, 1fr));
}
.grid-cols-layout-4 {
grid-template-columns: 90px repeat(4, minmax(0, 1fr));
}
.grid-rows-layout-4 {
grid-template-rows: repeat(4, minmax(0, 1fr));
}
.grid-cols-layout-5 {
grid-template-columns: 90px repeat(5, minmax(0, 1fr));
}
.grid-rows-layout-5 {
grid-template-rows: repeat(5, minmax(0, 1fr));
}
.grid-cols-layout-6 {
grid-template-columns: 90px repeat(6, minmax(0, 1fr));
}
.grid-rows-layout-6 {
grid-template-rows: repeat(6, minmax(0, 1fr));
}
.grid-cols-layout-7 {
grid-template-columns: 90px repeat(7, minmax(0, 1fr));
}
.grid-rows-layout-7 {
grid-template-rows: repeat(7, minmax(0, 1fr));
}
.grid-cols-layout-8 {
grid-template-columns: 90px repeat(8, minmax(0, 1fr));
}
.grid-rows-layout-8 {
grid-template-rows: repeat(8, minmax(0, 1fr));
}
.grid-cols-layout-9 {
grid-template-columns: 90px repeat(9, minmax(0, 1fr));
}
.grid-rows-layout-9 {
grid-template-rows: repeat(9, minmax(0, 1fr));
}
.grid-cols-layout-10 {
grid-template-columns: 90px repeat(10, minmax(0, 1fr));
}
.grid-rows-layout-10 {
grid-template-rows: repeat(10, minmax(0, 1fr));
}
}
10 changes: 1 addition & 9 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ module.exports = {
"left-[-16rem]",
"bg-black/30",
"bg-black/0",
"xl:grid-cols-1",
"xl:grid-cols-2",
"xl:grid-cols-3",
"xl:grid-cols-4",
"xl:grid-cols-5",
"xl:grid-cols-6",
"xl:grid-rows-13",
"xl:col-span-1",
"xl:col-span-2",
"xl:col-span-3",
Expand Down Expand Up @@ -112,7 +105,6 @@ module.exports = {
"bg-[url(/assets/images/gallery/07.webp)]",
"bg-[url(/assets/images/gallery/08.webp)]",
"bg-[url(/assets/images/gallery/09.webp)]",
"bg-[url(/assets/images/gallery/10.webp)]",
"xl:grid-cols-[200px_repeat(5,_minmax(0,_1fr))]"
"bg-[url(/assets/images/gallery/10.webp)]"
],
};

0 comments on commit fb2c860

Please sign in to comment.