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
26 changes: 13 additions & 13 deletions src/features/events/components/EventsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,26 @@ function EventsCard({
const isOpen = recruitStatus === "OPEN";

return (
<div className="flex items-center gap-3 px-5">
{/* 썸네일이 없으면 Figma와 같은 단색 placeholder.
CTA 버튼 안에 버튼을 중첩할 수 없어서, 상세 진입은 썸네일과 텍스트 블록에만 건다. */}
<div className="relative isolate flex items-center gap-3 px-5">
{/* 버튼 안에 CTA 버튼을 중첩할 수 없어서, 상세 진입 버튼을 카드 전체에 덮어 깔고 CTA만 그 위로 올린다.
isolate로 카드 안에서만 z 순서를 정해 목록 위에 겹치는 헤더 같은 요소와 섞이지 않게 한다. */}
<button
aria-label={`${title} 상세 보기`}
className="size-28 shrink-0 overflow-hidden rounded-xl bg-thumbnail-placeholder"
className="absolute inset-0 z-10"
onClick={onSelect}
type="button"
>
/>

{/* 썸네일이 없으면 Figma와 같은 단색 placeholder */}
<div className="size-28 shrink-0 overflow-hidden rounded-xl bg-thumbnail-placeholder">
{thumbnailUrl && (
<LazyImage alt="" className="size-full" src={thumbnailUrl} />
)}
</button>
</div>

{/* Figma에서 오른쪽 칼럼은 썸네일과 같은 높이(112)에 justify-between이라 뱃지는 위, 버튼은 아래 끝에 붙는다 */}
<div className="flex h-28 min-w-px flex-1 flex-col justify-between">
<button
className="flex flex-col items-start gap-1 text-left"
onClick={onSelect}
type="button"
>
<div className="flex flex-col items-start gap-1">
<EventsStatusBadge
status={recruitStatus}
statusLabel={getEventStatusLabel(event)}
Expand All @@ -77,9 +76,10 @@ function EventsCard({
>
행사일 {formatDate(event.eventStartAt.slice(0, 10))}
</Typography>
</button>
</div>

<div className="flex justify-end">
{/* CTA 옆 빈 자리는 상세 진입으로 남겨야 해서 래퍼를 줄 전체가 아니라 버튼 너비로만 둔다 */}
<div className="relative z-20 self-end">
{applicationId === null ? (
<Button
color="primary"
Expand Down
6 changes: 1 addition & 5 deletions src/features/home/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ function HomeScreen() {
<HomeAppliedEventSection
onBrowse={() => navigate(EVENTS_TAB_PATHS.event)}
onMore={() => navigate(EVENTS_TAB_PATHS.application)}
onSelect={(event) =>
push(
`${EVENTS_TAB_PATHS.application}/${event.applicationId}`,
)
}
onSelect={(event) => push(`/events/${event.eventId}`)}
/>
</Suspense>
</div>
Expand Down
33 changes: 21 additions & 12 deletions src/features/home/components/HomeApplyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,31 @@ import type { HomeApplySection } from "@/shared/entities/home/homeTypes";

// Figma: Upcoming Event Card (nodeId 3147:146262), Upcoming Application Card (3491:149798)
// 행사·사물함이 같은 모양이다. 배지 옆 `행사일` 문구는 Figma에서 투명 처리돼 있어 그리지 않는다.
// 버튼 안에 버튼을 둘 수 없어서, 카드 선택은 배지·제목 영역에만 건다(행사 목록 카드와 같은 방식).
// 버튼 안에 버튼을 둘 수 없어서, 카드 선택 버튼을 카드 전체에 덮어 깔고 신청하기 버튼만 그 위로 올린다
// (행사 목록 카드와 같은 방식). isolate로 카드 안에서만 z 순서를 정한다.
interface HomeApplyCardProps {
section: HomeApplySection;
onSelect: () => void;
onApply: () => void;
}

function HomeApplyCard({ section, onSelect, onApply }: HomeApplyCardProps) {
// 사물함 제목은 운영 회차 이름(예: 2026-2학기)이라 무엇을 신청하는지 붙여 준다
const title =
section.targetType === "LOCKER"
? `${section.title} 사물함 배정`
: section.title;

return (
<div className="flex items-center gap-4 rounded-xl bg-background-normal p-4">
<div className="relative isolate flex items-center gap-4 rounded-xl bg-background-normal p-4">
{/* 사물함은 상세 없이 신청으로 가서 "상세 보기" 대신 보이는 제목을 그대로 이름으로 쓴다 */}
<button
className="flex min-w-0 flex-1 flex-col items-start gap-2 text-left"
aria-label={title}
className="absolute inset-0 z-10 rounded-xl"
onClick={onSelect}
type="button"
>
/>
<div className="flex min-w-0 flex-1 flex-col items-start gap-2">
<ContentBadge
accentColor="semantic.accent.foreground.redOrange"
color="accent"
Expand All @@ -34,15 +44,14 @@ function HomeApplyCard({ section, onSelect, onApply }: HomeApplyCardProps) {
variant="body1"
weight="bold"
>
{/* 사물함 제목은 운영 회차 이름(예: 2026-2학기)이라 무엇을 신청하는지 붙여 준다 */}
{section.targetType === "LOCKER"
? `${section.title} 사물함 배정`
: section.title}
{title}
</Typography>
</button>
<Button onClick={onApply} size="small">
신청하기
</Button>
</div>
<div className="relative z-20 shrink-0">
<Button onClick={onApply} size="small">
신청하기
</Button>
</div>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/entities/home/homeQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export const homeResponseSchema = z.looseObject({
// 오늘이나 그 뒤에 열리는 신청한 행사
appliedEvents: previewSchema(
z.looseObject({
// 누르면 이것으로 신청내역 상세를 연다
applicationId: z.number(),
// 누르면 이것으로 행사 상세를 연다
eventId: z.number(),
title: z.string(),
eventDate: z.string(),
Expand Down
Loading