-
Notifications
You must be signed in to change notification settings - Fork 5
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
캐러셀 슬라이드 구현 (issue#57) #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다 버건디~!! 코드 넘 잘 짜셨는데요~~~!!!
frontend/src/hooks/useCarousel.ts
Outdated
const carouselItems = React.Children.toArray(children); | ||
const carouselItemLength = carouselItems.length; | ||
const [currentIndex, setCurrentIndex] = useState(1); | ||
const [isAnimating, setIsAnimating] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 짚어주셔서 감사합니다~!
isSliding
으로 바꿔보았어요 !
frontend/src/hooks/useCarousel.ts
Outdated
const useCarousel = ({ children }: PropsWithChildren) => { | ||
const carouselItems = React.Children.toArray(children); | ||
const carouselItemLength = carouselItems.length; | ||
const [currentIndex, setCurrentIndex] = useState(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단순 궁금) currentIndex 초기값이 0이 아니라 1인 이유가 궁금해요~~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 짚어주셔서 감사합니다 :)
(이유 없습니다.. 휴먼 에러.. 🥲)
import type { PropsWithChildren } from 'react'; | ||
import React, { useState, useRef, useEffect } from 'react'; | ||
|
||
const useCarousel = ({ children }: PropsWithChildren) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
버건디 말씀과 다르게 useCarousel 로직 깔끔한데요 ㅎㅎ 뚝딱뚝딱 잘 만드셨네요 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깔끔하게 작성해주셔서 이해가 쏙쏙 되었습니다 ㅎㅎ고생하셨어요~!!
import React, { useState, useRef, useEffect } from 'react'; | ||
|
||
const useCarousel = ({ children }: PropsWithChildren) => { | ||
const carouselItems = React.Children.toArray(children); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이런 방법으로도 배열을 만들 수 있군요!! 배워갑니다 👍
{carouselItems.map((item, index) => ( | ||
<S.Slide key={`original-${index}`}>{item}</S.Slide> | ||
))} | ||
{carouselItems.map((item, index) => ( | ||
<S.Slide key={`clone-${index}`}>{item}</S.Slide> | ||
))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단순 질문) clone 슬라이드는 어떤 역할을 하는지 궁금합니다~! original과 clone 두 개가 있어서요 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇군요!! 설명 감사합니다 버건디👍
구현 요약
캐러셀 슬라이드를 구현했습니다.
연관 이슈
일단 돌아가는 쓰레기 만들어보았습니다..
close #57