-
Notifications
You must be signed in to change notification settings - Fork 0
refactor : dashboard 일부 수정 및 공통 기능 추가 #93
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
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ac47bbc
refactor(status-chart): none pointer 속성 추가
junye0l 8e17804
refactor(dashboard-api-list): api 개별 목록 클릭시 상세페이지 이동 기능 추가
junye0l 21d1f1b
feat(scroll): 페이지간 이동시 스크롤 제어를 위한 컴포넌트 작업
junye0l 10ac136
Merge branch 'develop' into refactor/dashboard
junye0l 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { useEffect, type RefObject } from "react"; | ||
| import { useLocation } from "react-router-dom"; | ||
|
|
||
| /** | ||
| * 라우트 변경 시 지정한 스크롤 컨테이너의 위치를 최상단으로 초기화하는 컴포넌트입니다. | ||
| * | ||
| * @remarks | ||
| * - `window`가 아니라 `targetRef`로 전달된 스크롤 컨테이너를 직접 제어합니다. | ||
| * - `pathname` 변경 시 `top`, `left` 위치를 0으로 되돌립니다. | ||
| * - 화면에 렌더링되는 UI 없이 라우팅 사이드 이펙트만 처리합니다. | ||
| * | ||
| * @author junyeol | ||
| */ | ||
|
|
||
| interface ScrollToTopProps { | ||
| targetRef: RefObject<HTMLElement | null>; | ||
| } | ||
|
|
||
| const ScrollToTop = ({ targetRef }: ScrollToTopProps) => { | ||
| const { pathname } = useLocation(); | ||
|
|
||
| useEffect(() => { | ||
| targetRef.current?.scrollTo({ top: 0, left: 0 }); | ||
| }, [pathname, targetRef]); | ||
|
|
||
| return null; | ||
| }; | ||
|
|
||
| export default ScrollToTop; |
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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export { default as AuthRoute } from "./AuthRoute"; | ||
| export { default as ScrollToTop } from "./ScrollToTop"; |
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
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.
Uh oh!
There was an error while loading. Please reload this page.