-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: 링크 검색 기능, 링크 추가 기능 구현 #78
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
Closed
The head ref may contain hidden characters: "feature/Link-\uD398\uC774\uC9C0"
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7dd4754
Feat: 검색했을 때 000으로 검색했습니다. 문구 표시 뜨게 하는 UI 추가
junjeeong 4055f2b
Working: 링크 검색, 추가 기능 작업중
junjeeong 6eaaace
Feat: 링크 검색기능 추가, CardsLayout margin 추가
junjeeong 68874c1
Feat: 링크 추가하기 기본 기능 구현
junjeeong db99170
Fix: input에 값 남는 버그, CI 버그 해결
junjeeong ba25f72
Fix: console.log 삭제
junjeeong 729e5a5
Merge branch 'develop' into feature/Link-페이지
junjeeong b00868b
Feat: 폴더추가 기능 구현
junjeeong 866a0f4
Feat: 폴더 추가 기능
junjeeong 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,27 @@ | ||
| import { useEffect, useState } from "react"; | ||
| import { useEffect } from "react"; | ||
| import { GetServerSidePropsContext } from "next"; | ||
| import { useRouter } from "next/router"; | ||
| import { proxy } from "@/lib/api/axiosInstanceApi"; | ||
| import { LinkData } from "@/types/linkTypes"; | ||
| import { FolderData } from "@/types/folderTypes"; | ||
| import { SearchInput } from "../../components/Search/SearchInput"; | ||
| import { Modal } from "@/components/modal/modalManager/ModalManager"; | ||
| import { useLinkCardStore } from "@/store/useLinkCardStore"; | ||
| import { useEffect } from "react"; | ||
| import Container from "@/components/Layout/Container"; | ||
| import { SearchInput } from "../../components/Search/SearchInput"; | ||
| import CardsLayout from "@/components/Layout/CardsLayout"; | ||
| import Container from "@/components/Layout/Container"; | ||
| import ActionButtons from "@/components/link/ActionButtons"; | ||
| import AddLinkInput from "@/components/link/AddLinkInput"; | ||
| import SearchResultMessage from "@/components/Search/SearchResultMessage"; | ||
| import useModalStore from "@/store/useModalStore"; | ||
| import FolderTag from "../../components/FolderTag"; | ||
| import LinkCard from "../../components/LinkCard"; | ||
| import useModalStore from "@/store/useModalStore"; | ||
|
|
||
| interface LinkPageProps { | ||
| linkList: LinkData[]; | ||
| folderList: FolderData[]; | ||
| } | ||
|
|
||
| // /link 페이지 접속시에 초기렌더링 데이터(전체 폴더, 전체링크리스트)만 fetch해서 client로 전달. | ||
| export const getServerSideProps = async ( | ||
| context: GetServerSidePropsContext | ||
| ) => { | ||
|
|
@@ -43,31 +43,44 @@ export const getServerSideProps = async ( | |
|
|
||
| return { | ||
| props: { | ||
| link: links || [], | ||
| linkList: links.list || [], | ||
| folderList: folders || [], | ||
| }, | ||
| }; | ||
| }; | ||
|
|
||
| const LinkPage = ({ | ||
| linkList: initialLinkList, | ||
| folderList: initialFolderList, | ||
| }: LinkPageProps) => { | ||
| const LinkPage = ({ linkList: initialLinkList, folderList }: LinkPageProps) => { | ||
| const router = useRouter(); | ||
| const [linkList, setLinkList] = useState(initialLinkList); | ||
| const [folderList, setFolderList] = useState(initialFolderList); | ||
| const { search } = router.query; | ||
| const { isOpen, openModal } = useModalStore(); | ||
| const { linkCardList, setLinkCardList } = useLinkCardStore(); | ||
|
|
||
| // 검색어 입력시 관련된 목록으로 setLinkCardList | ||
| useEffect(() => { | ||
| const fetchNewList = async () => { | ||
| const res = await proxy.get("/api/links", { | ||
| params: { search }, | ||
| }); | ||
| console.log(res.data); | ||
|
||
| setLinkCardList(res.data.list); | ||
| }; | ||
| if (search !== undefined) fetchNewList(); | ||
| }, [search]); | ||
| }, [setLinkCardList, search]); | ||
|
|
||
| // 클라이언트에서 초기 목록을 설정 | ||
| useEffect(() => { | ||
| setLinkCardList(initialLinkList); | ||
| }, [initialLinkList, setLinkCardList]); | ||
|
|
||
| // EditLink 호출 | ||
| const openEdit = (link: string, linkId: number) => { | ||
| openModal("EditLink", { link, linkId: linkId ?? null }); | ||
| }; | ||
|
|
||
| // DeleteLinkModal 호출 | ||
| const openDelete = (link: string, linkId: number) => { | ||
| openModal("DeleteLinkModal", { link, linkId: linkId ?? null }); | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
|
|
||
You are viewing a condensed version of this merge commit. You can view the full changes here.
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.
CardsLayout 레이아웃에 margin 을 추가하면 즐겨찾기 페이지에서도 css 가 적용되어서 아래 영역에 추가하는 게 더 좋을 것 같습니다!
