Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-fe: DropdownSub 컴포넌트 구현 #762

Merged
merged 19 commits into from
Oct 7, 2024
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 3, 2024

Original issue description

목적

DropdownSubTrigger 컴포넌트는 현재 드롭다운, 팝오버메뉴의 내부 아이템 요소입니다.
현재 '단계 이동' 기능에서 사용되는 UI개선을 위해서 만들어 집니다.

작업 세부사항

  • DropdownSubTrigger 컴포넌트 구현.
  • Storybook 예제 추가

참고 사항

아래의 별표줄 밑에 요구사항 ID만 작성해주세요. Prefix 금지!


COM_DROP_SUB

closes #761

  1. RecursiveDropdownItem 컴포넌트를 이용하여 DropdownItem을 렌더링 합니다.
      <Dropdown
           initValue={process.name}
           size="sm"
           width={112}
           isShadow={false}
           disabled={applicant.isRejected}
         >
           <RecursiveDropdownItem items={menuItems} /> --> items요소에 DropdownItem 트리 구조를 할당하면 됩니다.
         </Dropdown>
  2. DropdownPovider를 구현하였습니다.
    interface DropdownContext {
       isOpen: boolean;
       open: () => void;
       close: () => void;
       selected?: string;
       setSelected: (name: string) => void;
    }
useModal 훅을 통해 사용할 수 있습니다.
  1. ApplicantModla에서 지원자 단계 이동 Dropdown에 있는 이메일 보내기, 불합격 기능을 삭제했습니다.
  2. 좌우 스크롤을 아래로 내렸습니다.
스크린샷 2024-10-04 오후 5 34 45

@github-actions github-actions bot added feature 새로운 기능 frontend 프론트엔드 labels Oct 3, 2024
@lurgi lurgi changed the title feat-fe: DropdownSubTrigger 컴포넌트 구현 feat-fe: DropdownSub 컴포넌트 구현 Oct 3, 2024
Copy link
Contributor Author

github-actions bot commented Oct 4, 2024

1728030968.302279

Copy link
Contributor Author

github-actions bot commented Oct 4, 2024

1728030972.419849

@lurgi lurgi marked this pull request as ready for review October 4, 2024 08:36
Copy link
Contributor Author

github-actions bot commented Oct 4, 2024

1728031004.015119

Copy link
Contributor

@llqqssttyy llqqssttyy left a comment

Choose a reason for hiding this comment

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

제가 봤을 떄 예측 불가능한 동작은 없었습니다. 남긴 코멘트에 대해서 검토하시고 반영해주세요~

items: (ClickableItem | SubTrigger)[];
}

export type DropdownItemType = ClickableItem | SubTrigger;
Copy link
Contributor

Choose a reason for hiding this comment

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

타입 오버라이딩을 사용해서 잘 구현해주셨네요👍

padding: 0.4rem;

top: -0.36rem;
right: ${({ width }) => `${width - 4}px`};
Copy link
Contributor

Choose a reason for hiding this comment

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

현재는 왼쪽에 고정적으로 렌더링되는데요,
prop으로 렌더링 방향을 받아서 선택할 수 있게 만들 수 있을까요?!

@@ -1,3 +1,4 @@
import { useDropdown } from '@contexts/DropdownContext';
Copy link
Contributor

Choose a reason for hiding this comment

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

저는 SubTrigger가 atom이라고 생각하는데 러기는 어떻게 생각하시나용?

@@ -0,0 +1,61 @@
import DropdownSubTrigger from '@components/_common/molecules/DropdownSubTrigger';
Copy link
Contributor

Choose a reason for hiding this comment

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

molecules로 바꿔주세요~

size?: 'sm' | 'md';
}

export default function RecursiveDropdownItem({ items, size = 'sm' }: RecursiveDropdownRendererProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

러쉬: DropdownItemSelector 어떤가요?

Copy link
Contributor

Choose a reason for hiding this comment

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

렛서: DropdownItemRenderer 어떤가요?

Copy link
Contributor

Choose a reason for hiding this comment

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

러기가 판단하고 변경or유지 후 props의 interface와 이름 일치시켜주세요~

Copy link
Contributor

@llqqssttyy llqqssttyy left a comment

Choose a reason for hiding this comment

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

변경사항 확인했습니다! 고생하셨어요~

Copy link
Contributor

@seongjinme seongjinme left a comment

Choose a reason for hiding this comment

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

러기 고생하셨어요. 쉽지 않은 작업을 해주셨네요. 지난 주에 렛서가 피드백 드렸던 내용도 반영되었고, 서브 드랍다운 노출 위치를 정할 수 있도록 유연하게 만들어 주신 것 같아요. Storybook과 local test 환경에서 각각 테스트했고, 모두 의도대로 동작하는 것을 확인했기에 Approve 드립니다. 🙏

Comment on lines -30 to +21
setIsOpen(!isOpen);
if (isOpen) close();
if (!isOpen) open();
Copy link
Contributor

Choose a reason for hiding this comment

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

Early return이나 if-else보다는 이런 방식이 더 직관적이라고 생각하신 것일까요? 🤔

@lurgi lurgi merged commit f98ee10 into fe/develop Oct 7, 2024
24 of 26 checks passed
@lurgi lurgi deleted the fe-761-COM_DROP_SUB branch October 7, 2024 06:16
lurgi added a commit that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 새로운 기능 frontend 프론트엔드
Projects
Status: 완료
Development

Successfully merging this pull request may close these issues.

3 participants