Skip to content

Commit

Permalink
Merge pull request #143 from pyconjp/feature/sprint_side
Browse files Browse the repository at this point in the history
Add Sprint Slide
  • Loading branch information
k-nakamura authored Sep 29, 2024
2 parents 9f462fa + a67644d commit b56c669
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/app/[lang]/sprint/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import AnnounceSection from "@/components/sections/AnnounceSection";
import {announce} from "@/data/announce";
import {Metadata} from "next";
import {getDictionary} from "@/lib/dictionaries";
import SprintOutPutSection from "@/components/sections/SprintOutPutSection";

export const runtime = 'edge';
export const revalidate = 3600;
Expand All @@ -24,5 +25,6 @@ export default async function Sprint({params: {lang}}: { params: { lang: 'ja' |
<AnnounceSection announce={announce} lang={lang}/>
<SprintVenueSection lang={lang}/>
<SprintSection lang={lang}/>
<SprintOutPutSection lang={lang}/>
</main>
}
13 changes: 13 additions & 0 deletions src/components/elements/GoogleSlide.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {IframeHTMLAttributes} from "react";

export default function GoogleSlide({slideId, ...props}: {
slideId: string,
props?: IframeHTMLAttributes<HTMLIFrameElement>
}) {
return <iframe
src={`https://docs.google.com/presentation/d/${slideId}/embed?start=false&loop=false&delayms=60000`}
width="960" height="569" allowFullScreen
className='w-full h-full'
{...props}
/>
}
27 changes: 27 additions & 0 deletions src/components/sections/SprintOutPutSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {getSprints} from "@/lib/sprints";
import SectionSubTitle from "@/components/elements/SectionSubTitle";
import {getDictionary} from "@/lib/dictionaries";
import GoogleSlide from "@/components/elements/GoogleSlide";

export default async function SprintOutPutSection({lang}: { lang: 'ja' | 'en' }) {
const sprints = await getSprints();
const dictionary = await getDictionary(lang);

return <section className={'lg:mt-8 mt-6 lg:mb-20 mb-14' + (sprints.some(sprint => sprint.slide) ? '' : ' hidden')}>
<SectionSubTitle title={'Sprint Output'} subtitle={dictionary.sprint.output}/>
<div className="grid lg:grid-cols-2 grid-cols-1 lg:gap-6 gap-16 mx-auto lg:w-10/12 w-11/12">
{
sprints
.filter(sprint => sprint.slide)
.map(
(sprint, index) => <div key={index} className="flex flex-col gap-2 text-lg">
<div className='w-full aspect-video'>
<GoogleSlide slideId={sprint.slide}/>
</div>
<div className={'text-center'}>{sprint.leader}</div>
</div>
)
}
</div>
</section>
}
3 changes: 2 additions & 1 deletion src/dictionaries/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"community": "Community"
},
"sprint": {
"themes": "List of Submitted Themes"
"themes": "List of Submitted Themes",
"output": "Output"
},
"special_thanks": {
"description": "These are the contributors to PyCon JP 2024."
Expand Down
3 changes: 2 additions & 1 deletion src/dictionaries/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"community": "コミュニティ"
},
"sprint": {
"themes": "応募されたテーマ一覧"
"themes": "応募されたテーマ一覧",
"output": "成果物"
},
"special_thanks": {
"description": "PyCon JP 2024の開催に貢献してくださった方々です。"
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/prebuild.mts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ writeJson('./src/cache/special_sponsors.json', specialSponsors);

const sprints: Sprint[] = await fetchSheet<Sprint>(
process.env.SPRINT_SPREADSHEET_ID || '',
'シート1!B2:C51',
['leader', 'description']
'シート1!B2:D51',
['leader', 'description', 'slide']
);
writeJson('./src/cache/sprints.json', sprints);

Expand Down
1 change: 1 addition & 0 deletions src/types/Sprint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type Sprint = {
leader: string,
description: string,
slide: string,
}

0 comments on commit b56c669

Please sign in to comment.