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
15 changes: 5 additions & 10 deletions src/components/workshop/Workshop2025Section.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ComponentProps } from 'astro/types'

export interface Item
extends Omit<ComponentProps<typeof WorkshopCard>, 'date'> {
date: Date
date?: Date
}
export function date(
month: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12,
Expand Down Expand Up @@ -64,38 +64,30 @@ export const items: Item[] = [

export const items2: Item[] = [
{
date: date(4, 17),
title: 'Python',
place: 'C301',
circleNames: ['Wani Hackase'],
description:
'Pythonの基礎を学びます。PythonはAIやデータ分析に使用されます。',
},
{
date: date(4, 18),
title: 'HTML, CSS',
place: 'C105',
circleNames: ['再履バス同好会 技術部'],
description:
'HTML, CSSの基礎を学びます。HTML, CSSはwebページの作成に使用されます。',
},
{
date: date(4, 19),
title: 'ハードウェア入門',
place: 'C104',
circleNames: ['ToolBox', 'Robohan'],
description:
'ハードウェアの基礎を学びます。電子回路、センサ、 メカ機構などを扱います。',
},
{
date: date(4, 22),
title: 'TypeScript',
circleNames: ['GGC'],
description:
'TypeScriptの基礎を学びます。TypeScriptはwebサイトの作成に使用されます。',
},
{
date: date(4, 23),
title: 'C/C++',
circleNames: ['RAINBOU'],
description:
Expand Down Expand Up @@ -134,7 +126,10 @@ const dateFormat = new Intl.DateTimeFormat('ja-JP', {
<ul class="grid grid-cols-[repeat(auto-fit,minmax(18rem,1fr))] gap-5">
{
items2.map(({ date, ...item }) => (
<WorkshopCard {...item} date={dateFormat.format(date)} />
<WorkshopCard
{...item}
date={date ? dateFormat.format(date) : undefined}
/>
))
}
</ul>
Expand Down
22 changes: 17 additions & 5 deletions src/components/workshop/WorkshopCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { OUTechsCirclesName } from '@/@types/ou-techs-members'
import { circles } from '../ou-techs/CircleList.astro'
interface Props {
title: string
date: string
date?: string
description: string
place?: string
circleNames?: OUTechsCirclesName[]
Expand Down Expand Up @@ -42,10 +42,22 @@ const clubInfos = circles.filter((c) => circleNames?.includes(c.name))
}
</p>
<p class="flex items-center gap-2 text-slate-600">
<Icon name="clock" alt="開催日時" class="w-4" />
<span>{date}</span>
<Icon name="map-pin" alt="開催場所" class="-mr-1 ml-2 w-4" />
<span>{place ?? '未定'}</span>
{
date ? (
<>
<Icon name="clock" alt="開催日時" class="w-4" />
<span class="mr-2">{date}</span>
</>
) : null
}
{
place ? (
<>
<Icon name="map-pin" alt="開催場所" class="-mr-1 w-4" />
<span>{place}</span>
</>
) : null
}
</p>
<p class="text-justify-ja">
{description}
Expand Down