Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion components/Layout/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
import React from "react";
import React, { useEffect, useState } from "react";
import ToTopBtn from "@/components/toTopBtn/ToTopBtn";

interface ContainerProps {
children: React.ReactNode;
}

const Container = ({ children }: ContainerProps) => {
const [showBtn, setShowBtn] = useState(false);

useEffect(() => {
const handleScroll = () => {
if (window.scrollY > 300) {
setShowBtn(true);
} else {
setShowBtn(false);
}
};
window.addEventListener("scroll", handleScroll);

return () => {
window.removeEventListener("scroll", handleScroll);
};
}, []);

return (
<div className="w-full max-w-[1125px] mx-auto p-[10px] md:p-10 lg:p-10 px-[32.5px]">
{children}
{showBtn && <ToTopBtn />}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion components/modal/AddFolderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const AddFolderModal = ({ folderName }: { folderName: string }) => {
return (
<ModalContainer title="폴더 추가">
<ModalInput
placeholder="내용 입력"
placeholder="이름을 입력해주세요"
name={folderName}
value={value}
onChange={handleChange}
Expand Down
4 changes: 2 additions & 2 deletions components/modal/SNSModal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ModalContainer from "./modalComponents/ModalContainer";
import ModalShare from "./modalComponents/ModalShare";

const SNSModal = ({ folderName }: { folderName: string }) => {
const SNSModal = () => {
return (
<ModalContainer title="폴더 공유" subtitle={folderName}>
<ModalContainer title="폴더 공유">
<ModalShare />
</ModalContainer>
);
Expand Down
6 changes: 5 additions & 1 deletion components/modal/modalManager/ModalManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export const Modal = () => {
/>
);
case "SNSModal":
return <SNSModal folderName={props.folderName || "폴더이름"} />;
return (
<SNSModal
// folderName={props.folderName || "폴더이름"}
/>
);
case "EditLink":
return (
<EditLink
Expand Down
20 changes: 20 additions & 0 deletions components/toTopBtn/ToTopBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FaAngleUp } from "react-icons/fa6";

const ToTopBtn = () => {
const handleClickToTop = () => {
window.scrollTo({ top: 0 });
};

return (
<>
<button
type="button"
onClick={handleClickToTop}
className="fixed bottom-10 right-10 rounded-full border bg-white opacity-70 border-purple100 size-[40px] flex items-center justify-center"
>
<FaAngleUp fill="purple100" />
</button>
</>
);
};
export default ToTopBtn;
2 changes: 1 addition & 1 deletion pages/link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const LinkPage = ({
<div className="bg-gray100 w-full h-[219px] flex justify-center items-center">
<AddLinkInput folderList={folderList} />
</div>
<main className="mt-[40px]">
<main className="mt-[40px] relative">
<Container>
<SearchInput />
{search && <SearchResultMessage message={search} />}
Expand Down
Loading