-
Notifications
You must be signed in to change notification settings - Fork 0
deploy: 3.0.1 배포 (#218) #220
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
75152df
feat: 모바일 헤더 수정 (#216)
AndyH0ng 719b8c7
feat: 모바일 뷰 구현 (#216)
AndyH0ng 8fa44a5
feat: 모바일 뷰 구현 (#216)
AndyH0ng d4a65e5
Merge branch 'develop' into design/mobile-ux-216
AndyH0ng 01fdbea
Update src/components/common/layout/HeaderButton.tsx
AndyH0ng 66fbac1
Merge pull request #217 from TTORANG/design/mobile-ux-216
AndyH0ng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,11 @@ export default function SlidePage() { | |
|
|
||
| const slideIdParam = searchParams.get('slideId'); | ||
| const currentSlide = slides?.find((s) => s.slideId === slideIdParam) ?? slides?.[0]; | ||
| const currentIndex = currentSlide | ||
| ? (slides?.findIndex((s) => s.slideId === currentSlide.slideId) ?? -1) | ||
| : -1; | ||
| const hasPrev = currentIndex > 0; | ||
| const hasNext = !!slides && currentIndex >= 0 && currentIndex < slides.length - 1; | ||
|
|
||
| /** | ||
| * 슬라이드 로드 에러 처리 | ||
|
|
@@ -49,15 +54,71 @@ export default function SlidePage() { | |
| } | ||
| }, [projectId, currentSlide?.slideId]); | ||
|
|
||
| const goPrev = () => { | ||
| if (!slides || !hasPrev) return; | ||
| setSearchParams({ slideId: slides[currentIndex - 1].slideId }, { replace: true }); | ||
| }; | ||
|
|
||
| const goNext = () => { | ||
| if (!slides || !hasNext) return; | ||
| setSearchParams({ slideId: slides[currentIndex + 1].slideId }, { replace: true }); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="h-full bg-gray-100"> | ||
| <div className="flex h-full gap-12 pl-14 pr-20 pt-6"> | ||
| <div className="hidden min-[1024px]:flex h-full gap-12 pl-14 pr-20 pt-6"> | ||
| <SlideList slides={slides} currentSlideId={currentSlide?.slideId} isLoading={isLoading} /> | ||
|
|
||
| <main className="flex-1 h-full min-w-0 overflow-hidden"> | ||
| <SlideWorkspace slide={currentSlide} isLoading={isLoading} /> | ||
| </main> | ||
| </div> | ||
|
|
||
| <div className="flex min-[1024px]:hidden h-full flex-col px-4 py-4"> | ||
| <div className="flex items-center justify-between pb-3"> | ||
| <button | ||
| type="button" | ||
| onClick={goPrev} | ||
| disabled={!hasPrev} | ||
| className="rounded-full border border-gray-200 bg-white p-2 text-gray-800 shadow-sm disabled:cursor-not-allowed disabled:opacity-35" | ||
| aria-label="이전 슬라이드" | ||
| > | ||
| <svg width="20" height="20" viewBox="0 0 24 24" fill="none"> | ||
| <path | ||
| d="m15 18-6-6 6-6" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| </svg> | ||
|
Comment on lines
+86
to
+94
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| </button> | ||
| <span className="text-body-s-bold text-gray-800"> | ||
| {slides && currentIndex >= 0 ? `${currentIndex + 1} / ${slides.length}` : '- / -'} | ||
| </span> | ||
| <button | ||
| type="button" | ||
| onClick={goNext} | ||
| disabled={!hasNext} | ||
| className="rounded-full border border-gray-200 bg-white p-2 text-gray-800 shadow-sm disabled:cursor-not-allowed disabled:opacity-35" | ||
| aria-label="다음 슬라이드" | ||
| > | ||
| <svg width="20" height="20" viewBox="0 0 24 24" fill="none"> | ||
| <path | ||
| d="m9 6 6 6-6 6" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| </svg> | ||
| </button> | ||
| </div> | ||
|
|
||
| <div className="min-h-0 flex-1 overflow-hidden"> | ||
| <SlideWorkspace slide={currentSlide} isLoading={isLoading} /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
className을 생성하는 로직이 77-80 라인에서도 동일하게 반복되고 있습니다. 코드 중복을 줄이고 유지보수성을 높이기 위해 이clsx호출을 컴포넌트 상단의 변수로 추출하여 두 버튼에서 공유하는 것을 권장합니다.예시:
References
classNamelogic into a helper function, using utilities likeclsxto improve readability and maintainability.