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

virtual scroll component (드르륵) 구현 #43

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

imb96
Copy link
Contributor

@imb96 imb96 commented Oct 30, 2023

⚙️ PR 타입

  • Feature
  • Hotfix

✨ 기능 설명 or 🚨 문제 상황

리스트중 아이템을 스크롤을 셀렉트 할 수 있는 컴포넌트를 구현했습니다.
리스트중 가운데에 있는 요소가 선택되며 배경색이 변경됩니다.

👨‍💻 구현 내용 or 👍 해결 내용

스크린샷 2023-10-30 오후 12 00 22

리스트가 하나일 경우인, 예를 들면 인원선택, 경기 플레이 타임 선택은 가능하지만
리스트가 여러개인 경기시작 시간 선택은 아직 구현하지 못했습니다.

🎯 PR 포인트

// 사용 예시
import { VirtualScroll } from '@components/shared/VirtualScroll';

const Page = () => {
  const [selectedItem, setSelectedItem] = useState<string | null>('');

  const handleItemSelected = (item: string) => {
    setSelectedItem(item);
  };

return (
    <>
      <VirtualScroll
        list={[
          '1명',
          '2명',
          '3명',
          '4명',
          '5명',
          '6명',
          '7명',
          '8명',
          '9명',
          '10명',
        ]}
        onItemSelected={handleItemSelected}
      />
      <h1>{selectedItem}</h1>
    </>
  );
}

📝 참고 사항

컴포넌트에 list: string[]를 props로 넘겨주시면 됩니다.
onItemSelected={선택된 아이템을 처리할 함수} 전달해주시면 됩니다.

❓ 궁금한 점

#41 close

@imb96 imb96 added 기능 코드의 기능이 추가되거나 바뀌었습니다. D-0 최대한 빨리 리뷰해 주세요 labels Oct 30, 2023
@imb96 imb96 added this to the 1차 스프린트 milestone Oct 30, 2023
@imb96 imb96 self-assigned this Oct 30, 2023
@imb96 imb96 linked an issue Oct 30, 2023 that may be closed by this pull request
@1eecan
Copy link
Contributor

1eecan commented Oct 30, 2023

🎉 @1eecan 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏

@1eecan 1eecan self-requested a review October 30, 2023 03:21
Copy link
Member

@1g2g 1g2g left a comment

Choose a reason for hiding this comment

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

LGTM!!

@imb96 imb96 merged commit 9402bad into dev Oct 30, 2023
@imb96 imb96 deleted the feat/#41-virtual-scroll-component branch October 30, 2023 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-0 최대한 빨리 리뷰해 주세요 기능 코드의 기능이 추가되거나 바뀌었습니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Virtual Scroll 컴포넌트 구현
3 participants