From 7621e44dc6bed0c2b6469de8c43786b9d01369af Mon Sep 17 00:00:00 2001 From: hongggy Date: Wed, 15 Jan 2025 13:32:24 +0900 Subject: [PATCH 01/10] =?UTF-8?q?refactor:=20=EB=AA=A8=EB=8B=AC=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=20app=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Folder/AddFolderButton.tsx | 2 +- components/Link/AddLinkInput.tsx | 5 +---- lib/api/axiosInstanceApi.ts | 4 ++-- pages/_app.tsx | 2 ++ pages/link/index.tsx | 4 ---- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/components/Folder/AddFolderButton.tsx b/components/Folder/AddFolderButton.tsx index 6079e5f..d823fb3 100644 --- a/components/Folder/AddFolderButton.tsx +++ b/components/Folder/AddFolderButton.tsx @@ -20,7 +20,7 @@ export const AddFolderButton = ({ className={ !isModal ? "md:mt-auto xl:mt-0 text-purple100" - : "fixed-bottom w-[120px] h-[35px] rounded-[20px] bg-purple100 text-white hover:bg-purple50" + : "fixed-bottom w-[120px] h-[35px] rounded-[20px] bg-purple100 text-white hover:bg-purple50 z-50" } onClick={() => openModal("AddFolderModal")} > diff --git a/components/Link/AddLinkInput.tsx b/components/Link/AddLinkInput.tsx index 8a2b49d..faaa1b7 100644 --- a/components/Link/AddLinkInput.tsx +++ b/components/Link/AddLinkInput.tsx @@ -1,6 +1,5 @@ import { ChangeEvent, KeyboardEvent, useEffect, useState } from "react"; import { FolderListData } from "@/types/folderTypes"; -import { Modal } from "../modal/modalManager/ModalManager"; import Image from "next/image"; import SubmitButton from "../SubMitButton"; import useModalStore from "@/store/useModalStore"; @@ -9,7 +8,7 @@ import toastMessages from "@/lib/toastMessage"; import { urlRegex } from "@/util/regex"; const AddLinkInput = ({ folderList }: FolderListData) => { - const { isOpen, openModal } = useModalStore(); + const { openModal } = useModalStore(); const [link, setLink] = useState(""); const handleChange = (e: ChangeEvent) => { @@ -54,8 +53,6 @@ const AddLinkInput = ({ folderList }: FolderListData) => { 추가하기 - - {isOpen && } ); }; diff --git a/lib/api/axiosInstanceApi.ts b/lib/api/axiosInstanceApi.ts index 44d9029..15fc843 100644 --- a/lib/api/axiosInstanceApi.ts +++ b/lib/api/axiosInstanceApi.ts @@ -5,8 +5,8 @@ const axiosInstance = axios.create({ }); export const proxy = axios.create({ - baseURL: "https://linkbrary-9-99.vercel.app", - // baseURL: "http://localhost:3000", + // baseURL: "https://linkbrary-9-99.vercel.app", + baseURL: "http://localhost:3000", // 로컬 테스트 }); proxy.interceptors.response.use( diff --git a/pages/_app.tsx b/pages/_app.tsx index 230fc4e..5c0d3f1 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,5 +1,6 @@ import Footer from "@/components/Layout/Footer"; import Header from "@/components/Layout/Header"; +import { Modal } from "@/components/modal/modalManager/ModalManager"; import "@/styles/globals.css"; import type { AppProps } from "next/app"; import Head from "next/head"; @@ -40,6 +41,7 @@ export default function App({ Component, pageProps }: AppProps) {
+
{!hidePaths.includes(router.pathname) &&
}
diff --git a/pages/link/index.tsx b/pages/link/index.tsx index c330ef4..308d158 100644 --- a/pages/link/index.tsx +++ b/pages/link/index.tsx @@ -4,7 +4,6 @@ import { useRouter } from "next/router"; import { parse } from "cookie"; import { LinkData } from "@/types/linkTypes"; import { FolderData } from "@/types/folderTypes"; -import { Modal } from "@/components/modal/modalManager/ModalManager"; import { SearchInput } from "../../components/Search/SearchInput"; import { useLinkCardStore } from "@/store/useLinkCardStore"; import axiosInstance from "@/lib/api/axiosInstanceApi"; @@ -22,7 +21,6 @@ import RenderEmptyLinkMessage from "@/components/Link/RenderEmptyLinkMessage"; import useFetchLinks from "@/hooks/useFetchLinks"; import useViewport from "@/hooks/useViewport"; import useFolderName from "@/hooks/useFolderName"; -import LoadingSpinner from "@/components/LoadingSpinner"; import LinkCardSkeleton from "@/components/skeleton/LinkCardSkeleton"; interface LinkPageProps { @@ -79,7 +77,6 @@ const LinkPage = ({ }: LinkPageProps) => { const router = useRouter(); const { search, folder } = router.query; - const { isOpen } = useModalStore(); const { isMobile } = useViewport(); const { totalCount, linkCardList, setLinkCardList } = useLinkCardStore.getState(); @@ -139,7 +136,6 @@ const LinkPage = ({ )} - {isOpen && } {isMobile && ( )} From 2eaa2a8a673080aaf7fb574f6280fdc5e206825e Mon Sep 17 00:00:00 2001 From: hongggy Date: Wed, 15 Jan 2025 13:37:49 +0900 Subject: [PATCH 02/10] =?UTF-8?q?fix:=20=EC=8A=A4=EC=BC=88=EB=A0=88?= =?UTF-8?q?=ED=86=A4=20=EB=B0=98=EC=9D=91=ED=98=95=20=EA=B0=9C=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/favorite/index.tsx | 2 +- pages/link/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/favorite/index.tsx b/pages/favorite/index.tsx index b62fdf0..0c7a7f5 100644 --- a/pages/favorite/index.tsx +++ b/pages/favorite/index.tsx @@ -87,7 +87,7 @@ const FavoritePage = ({
{/* 로딩 중일 때 */} {isLoading ? ( -
+
{[...Array(3)].map((_, index) => ( ))} diff --git a/pages/link/index.tsx b/pages/link/index.tsx index 308d158..bca238f 100644 --- a/pages/link/index.tsx +++ b/pages/link/index.tsx @@ -117,7 +117,7 @@ const LinkPage = ({ )}
{isLoading ? ( -
+
{[...Array(3)].map((_, index) => ( ))} From ca4c081533df96c9362b3a3093ad42139245da42 Mon Sep 17 00:00:00 2001 From: hongggy Date: Wed, 15 Jan 2025 13:45:04 +0900 Subject: [PATCH 03/10] =?UTF-8?q?feat:=20=ED=8F=B4=EB=8D=94=20=EC=97=86?= =?UTF-8?q?=EC=9C=BC=EB=A9=B4=20=EC=83=9D=EC=84=B1=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/toastMessage.ts | 1 + pages/link/index.tsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/toastMessage.ts b/lib/toastMessage.ts index affd653..c877e0e 100644 --- a/lib/toastMessage.ts +++ b/lib/toastMessage.ts @@ -10,6 +10,7 @@ const toastMessages = { editFolder: "폴더가 수정되었습니다", copyLink: "링크가 복사되었습니다", // SNS 모달에서 링크 복사 시 SNSshare: "공유가 완료되었습니다", + addFolderInfo: "폴더를 생성해주세요", }, error: { login: "로그인 실패: 이메일 또는 비밀번호를 확인해주세요", diff --git a/pages/link/index.tsx b/pages/link/index.tsx index bca238f..d553ff6 100644 --- a/pages/link/index.tsx +++ b/pages/link/index.tsx @@ -22,6 +22,8 @@ import useFetchLinks from "@/hooks/useFetchLinks"; import useViewport from "@/hooks/useViewport"; import useFolderName from "@/hooks/useFolderName"; import LinkCardSkeleton from "@/components/skeleton/LinkCardSkeleton"; +import toast, { Toaster } from "react-hot-toast"; +import toastMessages from "@/lib/toastMessage"; interface LinkPageProps { linkList: LinkData[]; @@ -83,6 +85,7 @@ const LinkPage = ({ const [isLoading, setIsLoading] = useState(false); const [folderName] = useFolderName(folder); const [folderList, setFolderList] = useState(initialFolderList); + const { openModal } = useModalStore(); useEffect(() => { setLinkCardList(initialLinkList, initialTotalCount); @@ -91,6 +94,13 @@ const LinkPage = ({ // 링크페이지의 query가 바뀌면 새로운 리스트로 업데이트 해주는 훅 useFetchLinks(setLinkCardList, setIsLoading); + // 생성된 폴더가 없으면 폴더 생성 모달 띄워주기 + useEffect(() => { + if (folderList.length === 0) { + toast.success(toastMessages.success.addFolderInfo); + openModal("AddFolderModal"); + } + }, []); return ( <>
From 8cb45de7828bd07d47e4034489ca9d40b43c9596 Mon Sep 17 00:00:00 2001 From: hongggy Date: Wed, 15 Jan 2025 13:47:46 +0900 Subject: [PATCH 04/10] =?UTF-8?q?chore:=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= =?UTF-8?q?=EB=B0=94=20=EC=BB=A4=EC=8A=A4=ED=85=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/_document.tsx | 2 +- styles/globals.css | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pages/_document.tsx b/pages/_document.tsx index db50883..eeae17c 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -4,7 +4,7 @@ export default function Document() { return ( - +
diff --git a/styles/globals.css b/styles/globals.css index 4bb4bc5..9fb8bde 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -62,3 +62,23 @@ em { input { outline: none; } + +/* 스크롤 커스텀 */ +.scrollbar-custom { + overflow-y: auto; /* 기본 overflow-y-auto 추가 */ +} +.scrollbar-custom::-webkit-scrollbar { + width: 8px; + height: 8px; /* 가로 스크롤바 높이 */ +} +.scrollbar-custom::-webkit-scrollbar-track { + background: transparent; +} +.scrollbar-custom::-webkit-scrollbar-thumb { + background: #6d6afe; + border-radius: 9999px; +} + +.scrollbar-custom::-webkit-scrollbar-thumb:hover { + background: #6d6afe; +} From 13e8446176a7d2ece58750bbaada2a0fe0245537 Mon Sep 17 00:00:00 2001 From: hongggy Date: Wed, 15 Jan 2025 13:57:16 +0900 Subject: [PATCH 05/10] =?UTF-8?q?chore:=20=EC=A0=84=EC=B2=B4=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=EC=97=90=20=EC=83=89=EC=83=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Folder/FolderTag.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/Folder/FolderTag.tsx b/components/Folder/FolderTag.tsx index 5d09465..c4c5872 100644 --- a/components/Folder/FolderTag.tsx +++ b/components/Folder/FolderTag.tsx @@ -7,25 +7,29 @@ const FolderTag = ({ folderList }: FolderListData) => { const folderStyle = "w-[100px] h-[35px] px-[15px] text-sm whitespace-nowrap truncate border border-purple100 rounded-md hover:bg-purple100 hover:text-white"; - + const selectedStyle = "bg-purple100 text-white"; const handleSubmit = (selectedFolderId: number | string) => { router.push({ pathname: router.pathname, query: selectedFolderId ? { folder: selectedFolderId } : {}, }); }; + const isAllSelected = currentFolderId === "" || currentFolderId === undefined; return (
  • -
  • {folderList.slice(0, 8).map((folder) => (