Skip to content

Conversation

@suji8073
Copy link
Member

@suji8073 suji8073 commented Jun 7, 2025

Motivation 🤔

  • 상위 리스트 페이지 중 ListTab 컴포넌트 구현
  • ListTab 스토리북 구성

Key Changes 🔑

  • TabComponent 내 타입과 구조를 가져와서 재정의했습니당 ! 😆
import { ContentInfo, TabInfo } from '@/components/molecules/tab/Tab';
import { ListTab } from '@/components/molecules/listTab';

type ListTabType = 'all' | 'inProgress' | 'completed';

const tabInfo: TabInfo<ListTabType> = [
  { tabType: 'all', label: '전체', count: 7 },
  { tabType: 'inProgress', label: '진행 중', count: 5 },
  { tabType: 'completed', label: '진행 완료', count: 2 },
];

const contentInfo: ContentInfo<ListTabType> = {
  all: { render: () => <div></div> },
  inProgress: { render: () => <div></div> },
  completed: { render: () => <div></div> },
};

const ListPage = () => {
  const [selectedTab, setSelectedTab] = useState<ListTabType>(
    tabInfo[0].tabType,
  );

  return (
    <div className='h-full w-full overflow-hidden bg-gray-50 text-center'>
      <div className='px-5'>
        <ListTab
          tabInfo={tabInfo}
          selectedTab={selectedTab}
          onClick={setSelectedTab}
        />
        {contentInfo[selectedTab].render()}
      </div>
    </div>
  );
};

export default ListPage;

Attachment 📷

image

@suji8073 suji8073 self-assigned this Jun 7, 2025
@suji8073 suji8073 added the ✨ Feature 기능 개발 label Jun 7, 2025
@github-actions
Copy link

github-actions bot commented Jun 7, 2025

Copy link
Contributor

@jungjunhyung99 jungjunhyung99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 수지님!!

@suji8073 suji8073 force-pushed the f/list-tab-component/suji_chae branch from a8bb484 to 66c597e Compare June 16, 2025 15:13
@suji8073 suji8073 changed the base branch from develop to main June 16, 2025 15:13
@github-actions
Copy link

@suji8073 suji8073 changed the base branch from main to develop June 18, 2025 12:44
@suji8073 suji8073 force-pushed the f/list-tab-component/suji_chae branch from 66c597e to 22ddf40 Compare June 18, 2025 13:19
@suji8073 suji8073 merged commit 4d70f4f into develop Jun 18, 2025
1 check passed
@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants