Skip to content

Commit a28e5e2

Browse files
committed
feat : implement no vote view
1 parent 38f3bec commit a28e5e2

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/features/home/ui/CardSection.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
1+
import { Button } from '@/shared/ui';
12
import { useFetchAllElections } from '../api';
23
import CardStack from './CardStack';
4+
import { getDate } from '@/shared/utils';
35

46
export default function CardSection() {
57
const { data, isFetching, isError } = useFetchAllElections();
8+
const currentYear = Number(getDate(new Date(), 'YYYY'));
9+
610
if (isFetching) return <></>;
711
if (isError) return <></>;
812
if (data && data.length === 0)
913
return (
1014
<>
1115
<p className="mb-8 text-2xl font-semibold">진행중인 선거가 없어요</p>
12-
<div className="shadow-card flex h-fit w-full cursor-pointer flex-col rounded-lg bg-white p-6">
13-
<div className="flex w-full justify-between">투표가 없어여</div>
16+
<div className="relative h-[266px]">
17+
<div
18+
className="bg-m/60 absolute left-1/2 h-[100px] w-full -translate-x-1/2 rounded-lg"
19+
style={{ scale: 0.97 }}
20+
/>
21+
<div className="shadow-card bg-m absolute top-4 z-10 flex h-fit w-full cursor-pointer flex-col rounded-lg p-6">
22+
<p className="mb-2.5 text-2xl font-semibold text-white">
23+
{currentYear + 1}
24+
<br />
25+
투표가 시작되지 않았어요
26+
</p>
27+
<p className="mb-6 text-white">
28+
{currentYear} 투표는 종료되었습니다
29+
<br />
30+
새로운 투표가 생기면 알려드릴게요
31+
</p>
32+
<Button intent="home" size="lg">
33+
{currentYear} 선거결과 보러가기
34+
</Button>
35+
</div>
1436
</div>
1537
</>
1638
);

src/shared/ui/Button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const ButtonVariants = cva(
2020
login: 'bg-[#1A1A1A] text-white font-medium',
2121
loginWhite: 'border-[1px] border-[#767676]',
2222
kakao: 'bg-[#FDE500] text-[#111]',
23+
home: 'bg-white/30 border-[1px] border-white text-white',
2324
},
2425
size: {
2526
fit: 'w-full h-fit text-lg',

0 commit comments

Comments
 (0)