-
Notifications
You must be signed in to change notification settings - Fork 0
문의하기 개선 (#issue 269) #270
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 269) #270
Changes from all commits
0afdbe0
ef9e806
436b783
417e071
1bb667b
5c43643
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import * as S from './Header.styled'; | ||
| import Mainlogo from '../../../assets/mainlogo.svg'; | ||
| import { Link } from 'react-router-dom'; | ||
| import { Link, useLocation } from 'react-router-dom'; | ||
| import DropDown from '../dropDown/DropDown'; | ||
| import Avatar from '../avatar/Avatar'; | ||
| import { useAuth } from '../../../hooks/useAuth'; | ||
|
|
@@ -16,20 +16,22 @@ import { formatImgPath } from '../../../util/formatImgPath'; | |
| import bell from '../../../assets/bell.svg'; | ||
| import Notification from './Notification/Notification'; | ||
| import bellLogined from '../../../assets/bellLogined.svg'; | ||
| // import useNotification from '../../../hooks/useNotification'; | ||
| import useNotification from '../../../hooks/useNotification'; | ||
| import { useEffect } from 'react'; | ||
| import { testLiveAlarm } from '../../../api/alarm.api'; | ||
|
|
||
| function Header() { | ||
| const location = useLocation(); | ||
| const { isOpen, message, handleModalOpen, handleModalClose } = useModal(); | ||
| const { userLogout } = useAuth(handleModalOpen); | ||
| const isLoggedIn = useAuthStore((state) => state.isLoggedIn); | ||
| const { myData, isLoading } = useMyProfileInfo(); | ||
|
|
||
| // const { signalData, setSignalData } = useNotification(); | ||
|
|
||
| useEffect(() => { | ||
| testLiveAlarm(); | ||
| }, []); | ||
| // useEffect(() => { | ||
| // testLiveAlarm(); | ||
| // }, []); | ||
|
|
||
| const profileImg = myData?.profileImg | ||
| ? `${import.meta.env.VITE_APP_IMAGE_CDN_URL}/${formatImgPath( | ||
|
|
@@ -92,7 +94,7 @@ function Header() { | |
| <Link to={ROUTES.manageProjectsRoot}> | ||
| <S.Item>공고관리</S.Item> | ||
| </Link> | ||
| <Link to={ROUTES.inquiry}> | ||
| <Link to={ROUTES.inquiry} state={{ from: location.pathname }}> | ||
| <S.Item>문의하기</S.Item> | ||
| </Link> | ||
|
Comment on lines
+97
to
99
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. 💡 Verification agent 🧩 Analysis chain
-<Link to={ROUTES.inquiry} state={{ from: location.pathname }}>
+<Link
+ to={ROUTES.inquiry}
+ state={{ from: location.pathname || ROUTES.main }} // fallback
+>🏁 Script executed: #!/bin/bash
# usePostInquiry 훅 사용 위치 확인
echo "=== usePostInquiry 사용 확인 ==="
rg "usePostInquiry" -A5
# Inquiry 페이지에서 location.state 사용 확인
echo "=== location.state 사용 위치 확인 ==="
rg "location.state" -A5
# useLocation 훅 사용 위치 확인
echo "=== useLocation 사용 확인 ==="
rg "useLocation" -A5Length of output: 7546 Inquiry 페이지에서 직접 URL로 진입할 경우
+ import { ROUTES } from '../../../constants/routes';
...
- const { mutate: postInquiry } = usePostInquiry(
- location.state.from,
- handleModalOpen
- );
+ const { mutate: postInquiry } = usePostInquiry(
+ location.state?.from ?? ROUTES.main,
+ handleModalOpen
+ ); |
||
| <Link to='#' onClick={(e) => e.preventDefault()}> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| import { useLocation } from 'react-router-dom'; | ||
| import { ROUTES } from '../../constants/routes'; | ||
| import * as S from './MoveInquiredLink.styled'; | ||
|
|
||
| export default function MovedInquiredLink() { | ||
| return <S.MoveInquiredLink to={ROUTES.inquiry}>문의하기</S.MoveInquiredLink>; | ||
| const location = useLocation(); | ||
|
|
||
| return ( | ||
| <S.MoveInquiredLink to={ROUTES.inquiry} state={{ from: location.pathname }}> | ||
| 문의하기 | ||
| </S.MoveInquiredLink> | ||
| ); | ||
| } |
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는 제거하거나 실제 로직으로 복구해 주세요.
useNotification,useEffect,testLiveAlarm가 모두 사용처 없이 import만 존재합니다. 빌드-타임에 ESLint 오류가 발생하며 번들 크기도 불필요하게 증가합니다. 실제 알림 기능을 되살릴 계획이 없다면 import 와 주석 처리된 코드를 함께 제거해 주세요.📝 Committable suggestion
🧰 Tools
🪛 ESLint
[error] 19-19: 'useNotification' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 20-20: 'useEffect' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 21-21: 'testLiveAlarm' is defined but never used.
(@typescript-eslint/no-unused-vars)