-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor/component #203
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
Refactor/component #203
Changes from all commits
496cfd6
763029f
1c5ee98
68e8119
50642cf
3eeadc5
a5e22ca
6b2e4b5
d77f2b2
92a1fb9
9dd06cd
37f8b39
dc45f50
cd0d635
fcd8330
1ff3148
38ffc93
22f494e
abdc9b1
87169c6
6881396
d116856
9cd64b9
2abfb96
43b7fc7
b530159
0603cf8
4fe8aef
be6290a
31a6cd9
4e7203c
b391629
2b8693b
b548e4f
26b5b7e
4186d63
3666f67
1cdfe74
3802c21
d1c34a5
58a1fd6
2cc9a8b
a79544d
bbe7411
0bb5504
2aa6ae7
5881a78
9bbb1ea
d84ed10
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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { useEffect, useState } from "react"; | ||
|
|
||
| import useFetch from "@/utils/apiUtils"; | ||
|
|
||
| import { ArticleResponse } from "../type/response"; | ||
|
|
||
| /* ---------- 타입 ---------- */ | ||
|
|
||
| interface ArticleListResponse { | ||
| news: ArticleResponse[]; // 최대 5개 | ||
| } | ||
|
|
||
| const useGetArticleList = (userId: number | null) => { | ||
| const { result, loading, error, fetchData } = useFetch<ArticleListResponse>(); | ||
|
|
||
| const [articleList, setArticleList] = useState<ArticleResponse[]>([]); | ||
|
|
||
| /* 페이지 변경 시 데이터 요청 */ | ||
| useEffect(() => { | ||
| if (userId === null) return; | ||
|
|
||
| fetchData({ | ||
| method: "get", | ||
| url: `/news?site-user-id=${userId}`, | ||
| body: undefined, | ||
| isToken: true, | ||
| }); | ||
| }, [userId, fetchData]); | ||
|
|
||
| /* 응답 처리 */ | ||
| useEffect(() => { | ||
| if (result) { | ||
| setArticleList(result.data.news); | ||
| } | ||
| }, [result]); | ||
|
|
||
| return { articleList, loading, error }; | ||
| }; | ||
|
|
||
| export default useGetArticleList; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,9 +5,22 @@ import { useState } from "react"; | |||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import { ArticleResponse } from "@/api/article/type/response"; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import { IconLikeFill, IconLikeNotFill } from "@/public/svgs/mentor"; | ||||||||||||||||||||||||||||||||||||||||||||||||
| <<<<<<< HEAD | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| <<<<<<< HEAD | ||||||||||||||||||||||||||||||||||||||||||||||||
| interface MentorArticleProps { | ||||||||||||||||||||||||||||||||||||||||||||||||
| article: ArticleResponse; | ||||||||||||||||||||||||||||||||||||||||||||||||
| ======= | ||||||||||||||||||||||||||||||||||||||||||||||||
| import { IconLikeFill, IconLkieNotFill } from "@/public/svgs/mentor"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| interface MentorArticleProps { | ||||||||||||||||||||||||||||||||||||||||||||||||
| article: Article; | ||||||||||||||||||||||||||||||||||||||||||||||||
| >>>>>>> upstream/main | ||||||||||||||||||||||||||||||||||||||||||||||||
| ======= | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| interface MentorArticleProps { | ||||||||||||||||||||||||||||||||||||||||||||||||
| article: ArticleResponse; | ||||||||||||||||||||||||||||||||||||||||||||||||
| >>>>>>> main | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
24
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. 여러 병합 충돌을 해결해주세요 이 파일에 해결되지 않은 병합 충돌이 여러 개 있습니다. 충돌 해결 시 다음 사항을 고려하세요:
다음과 같이 수정하세요: -import { ArticleResponse } from "@/api/article/type/response";
-import { IconLikeFill, IconLikeNotFill } from "@/public/svgs/mentor";
-<<<<<<< HEAD
-
-<<<<<<< HEAD
-interface MentorArticleProps {
- article: ArticleResponse;
-=======
-import { IconLikeFill, IconLkieNotFill } from "@/public/svgs/mentor";
-
-interface MentorArticleProps {
- article: Article;
->>>>>>> upstream/main
-=======
-
-interface MentorArticleProps {
- article: ArticleResponse;
->>>>>>> main
-}
+import { ArticleResponse } from "@/api/article/type/response";
+import { IconLikeFill, IconLikeNotFill } from "@/public/svgs/mentor";
+
+interface MentorArticleProps {
+ article: ArticleResponse;
+}📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (2.1.2)[error] 12-13: Expected a property, or a signature but instead found '==='. Expected a property, or a signature here. (parse) [error] 17-18: Expected a property, or a signature but instead found '>'. Expected a property, or a signature here. (parse) [error] 22-23: Expected a property, or a signature but instead found '>'. Expected a property, or a signature here. (parse) [error] 14-14: Shouldn't redeclare 'IconLikeFill'. Consider to delete it or rename it. 'IconLikeFill' is defined here: (lint/suspicious/noRedeclare) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const MentorArticle = ({ article }: MentorArticleProps) => { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,31 @@ import useGetMentorList from "@/api/mentor/client/useGetMentorList"; | |
|
|
||
| const MentorFindSection = () => { | ||
| const [selectedFilter, setSelectedFilter] = useState<FilterTab>(FilterTab.ALL); | ||
| <<<<<<< HEAD | ||
| <<<<<<< HEAD | ||
| ======= | ||
| >>>>>>> main | ||
| const { page, lastElementRef } = useInfinityScroll(); | ||
| const { mentorList } = useGetMentorList({ | ||
| page, | ||
| region: selectedFilter !== FilterTab.ALL ? selectedFilter : undefined, | ||
| }); | ||
| <<<<<<< HEAD | ||
| ======= | ||
| const mentorListData = getMentorListData(); | ||
|
|
||
| const filteredMentors = useMemo(() => { | ||
| return mentorListData.filter((mentor) => { | ||
| if (selectedFilter === FilterTab.ALL) return true; | ||
| if (selectedFilter === FilterTab.EUROPE) return mentor.country === FilterTab.EUROPE; | ||
| if (selectedFilter === FilterTab.AMERICAS) return mentor.country === FilterTab.AMERICAS; | ||
| if (selectedFilter === FilterTab.ASIA) return mentor.country === FilterTab.ASIA; | ||
| return false; | ||
| }); | ||
| }, [mentorListData, selectedFilter]); | ||
|
Comment on lines
+27
to
+37
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. 🛠️ Refactor suggestion 필터링 로직 개선이 필요합니다 병합 충돌 해결 시 필터링 로직을 포함하기로 결정하신다면, 다음 문제들을 해결해야 합니다:
API 데이터를 사용하는 현재 구현을 유지하는 것을 권장합니다. 필터링은 이미 🤖 Prompt for AI Agents
Contributor
Author
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. 해당 부분 기능구현시 추후 삭제 에정입니다 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. @manNomi 알겠습니다! 기능 구현 시 해당 부분을 삭제할 예정이시라면 현재 상태로 두시는 것이 맞습니다. 임시 코드에 대한 명확한 설명 감사합니다. 추후 기능 완성 시 깔끔하게 정리되겠네요. ✏️ Learnings added
🧠 Learnings used |
||
| >>>>>>> upstream/main | ||
| ======= | ||
| >>>>>>> main | ||
|
Comment on lines
+16
to
+40
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. 병합 충돌을 해결해주세요 현재 코드에 해결되지 않은 병합 충돌 마커가 있습니다. 이로 인해 빌드가 실패합니다. 다음과 같이 수정하세요: -<<<<<<< HEAD
-<<<<<<< HEAD
-=======
->>>>>>> main
const { page, lastElementRef } = useInfinityScroll();
const { mentorList } = useGetMentorList({
page,
region: selectedFilter !== FilterTab.ALL ? selectedFilter : undefined,
});
-<<<<<<< HEAD
-=======
- const mentorListData = getMentorListData();
-
- const filteredMentors = useMemo(() => {
- return mentorListData.filter((mentor) => {
- if (selectedFilter === FilterTab.ALL) return true;
- if (selectedFilter === FilterTab.EUROPE) return mentor.country === FilterTab.EUROPE;
- if (selectedFilter === FilterTab.AMERICAS) return mentor.country === FilterTab.AMERICAS;
- if (selectedFilter === FilterTab.ASIA) return mentor.country === FilterTab.ASIA;
- return false;
- });
- }, [mentorListData, selectedFilter]);
->>>>>>> upstream/main
-=======
->>>>>>> main
🧰 Tools🪛 Biome (2.1.2)[error] 24-26: Expected a statement but instead found '<<<<<<< HEAD Expected a statement here. (parse) [error] 37-40: Expected a statement but instead found '>>>>>>> upstream/main
Expected a statement here. (parse) 🤖 Prompt for AI Agents
Contributor
Author
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. 이미 해결된 사항입니다 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. 🧩 Analysis chain@manNomi 확인해보겠습니다. 🏁 Script executed: Length of output: 2525 @manNomi 확인해보니 현재 파일에는 여전히 병합 충돌 마커들이 남아있는 것으로 보입니다: 16-18번 라인: 24-33번 라인: 로컬에서 해결하셨다면 변경사항을 푸시해주세요. 혹시 다른 파일을 말씀하신 건가요? 🤔 🧬 Code Graph Analysis ResultsPossibly relevant snippets from
|
||
|
|
||
| return ( | ||
| <div className="px-4"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,15 @@ const MentorClient = () => { | |
| const isMentor = false; | ||
| return ( | ||
| <> | ||
| <<<<<<< HEAD | ||
| <<<<<<< HEAD | ||
| {isMentor ? ( | ||
| ======= | ||
| {!isMentor ? ( | ||
| >>>>>>> upstream/main | ||
| ======= | ||
| {isMentor ? ( | ||
| >>>>>>> main | ||
|
Comment on lines
+10
to
+18
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. Git 병합 충돌을 해결해야 합니다. 코드에 병합 충돌 마커( 로직을 보면 다음 diff를 적용하여 병합 충돌을 해결하세요: -<<<<<<< HEAD
-<<<<<<< HEAD
- {isMentor ? (
-=======
- {!isMentor ? (
->>>>>>> upstream/main
-=======
{isMentor ? (
->>>>>>> main
🧰 Tools🪛 Biome (2.1.2)[error] 11-11: Expected a type parameter but instead found '<<<<<<'. Expected a type parameter here. (parse) [error] 11-11: expected Remove HEAD (parse) [error] 12-12: expected Remove { (parse) [error] 12-13: Expected a parameter but instead found '==='. Expected a parameter here. (parse) [error] 14-14: expected Remove ! (parse) [error] 14-15: Expected an expression for the left hand side of the This operator requires a left hand side value (parse) [error] 15-15: Expected an expression but instead found '>>>'. Expected an expression here. (parse) [error] 15-15: Expected an expression but instead found '>'. Expected an expression here. (parse) [error] 16-16: Expected an expression but instead found '==='. Expected an expression here. (parse) [error] 16-16: Expected an expression but instead found '='. Expected an expression here. (parse) [error] 14-16: Invalid assignment to This expression cannot be assigned to (parse) [error] 17-17: expected Remove ? (parse) [error] 17-18: expected Remove > (parse) [error] 18-18: Expected an expression but instead found '>>>'. Expected an expression here. (parse) [error] 18-18: Expected an expression but instead found '>'. Expected an expression here. (parse) [error] 10-28: Expected corresponding JSX closing tag for 'HEAD'. Opening tag closing tag (parse) 🤖 Prompt for AI Agents |
||
| // 멘토페이지 | ||
| <> | ||
| {/* 나의 멘토 - 멘티 탭 및 채팅카드 */} | ||
|
|
||
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.
1. 병합 충돌이 해결되지 않았습니다
다음과 같이 병합 충돌을 해결해주세요:
🧰 Tools
🪛 Biome (2.1.2)
[error] 16-17: Expected a statement but instead found '======='.
Expected a statement here.
(parse)
[error] 18-18: Shouldn't redeclare 'myMentorProfile'. Consider to delete it or rename it.
'myMentorProfile' is defined here:
(lint/suspicious/noRedeclare)
[error] 18-18: Shouldn't redeclare 'setMyMentorProfile'. Consider to delete it or rename it.
'setMyMentorProfile' is defined here:
(lint/suspicious/noRedeclare)
🤖 Prompt for AI Agents