Skip to content

Commit

Permalink
Merge pull request #43 from Nexters/feature/poll-empty
Browse files Browse the repository at this point in the history
feat: 투표 없을 때 Fallback UI 추가
  • Loading branch information
cs-shin authored Feb 21, 2025
2 parents a7390af + 83b8bdf commit b950957
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Binary file added public/images/poll/poll_empty_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/app/poll/PollClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useVoteListByUser } from './hooks/useVoteListByUser';
import { useMemo, useState } from 'react';
import TooltipContainer from './components/Poll/TooltipContainer';
import usePollPageLogActions from './hooks/usePollPageLogActions';
import Image from 'next/image';

export default function PollClient() {
const [currentTab, setCurrentTab] = useState<'ongoing' | 'end'>('ongoing');
Expand Down Expand Up @@ -56,6 +57,19 @@ export default function PollClient() {
투표를 하면 블록체인에 저장된 컨트렉트를 확인할 수 있어요.
</p>
<Tabs currentTab={currentTab} handleChangeTab={handleChangeTab}>
{polls?.length === 0 && (
<div className="mt-[12rem] flex flex-col items-center justify-center">
<Image src="/images/poll/poll_empty_block.png" alt="end_poll_empty" width={260} height={260} />
<strong className="mt-[1rem] text-title-1-semibold text-gray-900">
{currentTab === 'ongoing' ? '진행중인 투표' : '종료된 투표'}가 없어요!
</strong>
<p className="mt-[0.8rem] text-body-2-regular text-gray-700">
{currentTab === 'ongoing'
? '종료된 투표에서 참여한 투표를 확인해볼까요?'
: '진행중인 투표에서 참여해볼까요?'}
</p>
</div>
)}
{polls?.map(
({
id,
Expand Down

0 comments on commit b950957

Please sign in to comment.