-
Notifications
You must be signed in to change notification settings - Fork 51
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
[조연아] week15 #538
The head ref may contain hidden characters: "part3-\uC870\uC5F0\uC544-week15"
[조연아] week15 #538
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.
연아님 고생하셨습니다! 이번에 axios interceptor 도입하면서 기존 fetch 대신 axios로 통일하고, axios<Type>.get()
을 이용하여 response 타입을 미리 정해두면 개발이 조금 더 편해질 것 같습니다. (~~Data 타입도 안만들어줘도 되구요)
고생하셨습니다!
@@ -10,14 +10,14 @@ import Profile from "@/components/profile/Profile"; | |||
export default function ShareNav({ | |||
data, | |||
}: { | |||
data: UserProfile[] | ShareUser; | |||
data: UserProfile[] | ShareUser | AuthShareUser | undefined; |
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.
해당 컴포넌트에서 사용하는 정보는 data의 email값 뿐으로 보이는데 data의 타입이 조금 과한 것 같습니다. email 값을 직접 받는식으로 수정해보는 것은 어떨까요?
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.
그렇게 한다면 FolderNav/ShareNav 를 하나의 컴포넌트를 이용할 수 있을 것 같습니다.
import SearchContext from "../../contexts/SearchContext"; | ||
import { Folder } from "@/types/folderMenuListTypes"; | ||
export type Data = Folder[] | [] | undefined; |
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.
[]
타입이 들어오는 경우가 있나요?
}; | ||
|
||
export default function DataList({ folderIdKey }: DataListProps) { | ||
const { LinkSDataArr } = useContext(LocaleContext); | ||
export default function DataList({ folderIdKey, data }: DataListProps) { | ||
const { inputValue, handleInputFunc } = useContext(SearchContext); |
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.
handleInputFunc
은 사용안해서 inputValue
만 꺼내쓰시면 좋을 것 같습니다.
}: { | ||
folderMenu: FolderMenuListProps[] | undefined; | ||
folderId: string | undefined; | ||
}) { | ||
const router = useRouter(); |
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.
nit
}: { | |
folderMenu: FolderMenuListProps[] | undefined; | |
folderId: string | undefined; | |
}) { | |
const router = useRouter(); | |
}: { | |
folderMenu?: FolderMenuListProps[]; | |
folderId?: string; | |
}) { |
user_id: 25, | ||
links: [], | ||
}, | ||
...copyfolderMenuList, |
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.
...
로 얕은복사가 이루어질 것 같아서 L30의 folderMenuList.slice()
는 불필요해 보입니다.
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.
[folderId].tsx 파일과 거의 유사한데 따로 만드신 이유가 있을까요?
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.
Optional Catch-all Segments 을 활용해볼 수 있을것 같아요.
@@ -164,9 +160,9 @@ export default function SingUpPage() { | |||
<Link href="https://www.google.com"> | |||
<Image src={google} alt="google" /> | |||
</Link> | |||
<Link href="https://www.kakaocorp.com/page"> | |||
{/* <Link href="https://www.kakaocorp.com/page"> |
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.
외부 링크는 a 태그를 사용해주셔야 합니다.
if (sharedFolderData.data.length === 0) { | ||
return { | ||
props: { | ||
errorCode: 404, | ||
}, | ||
}; | ||
} | ||
const folderData = sharedFolderData.data[sharedFolderData.data.length - 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.
데이터의 길이가 0인 것을 404 에러로 처리하는 것이 맞을까요? 404에러는 사용자가 사이트에서 존재하지 않는 URL을 탐색했을 때 발생합니다. 이 상황에서는 404 에러로 처리하기보다는 데이터가 없음을 알려주는 것이 좋아보입니다.
|
||
// https://bootcamp-api.codeit.kr/api/links?folderId=1 | ||
|
||
// export const AuthFolderLinks = async ( |
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.
안쓰는 주석은 지워주세요!
요구사항
기본
심화
주요 변경사항
배포도메인
https://firstmyvercel.vercel.app/
멘토에게