File tree Expand file tree Collapse file tree 6 files changed +49
-6
lines changed
Expand file tree Collapse file tree 6 files changed +49
-6
lines changed Original file line number Diff line number Diff line change 1- import React from "react" ;
1+ import React , { useEffect , useState } from "react" ;
2+ import ToTopBtn from "@/components/toTopBtn/ToTopBtn" ;
23
34interface ContainerProps {
45 children : React . ReactNode ;
56}
67
78const Container = ( { children } : ContainerProps ) => {
9+ const [ showBtn , setShowBtn ] = useState ( false ) ;
10+
11+ useEffect ( ( ) => {
12+ const handleScroll = ( ) => {
13+ if ( window . scrollY > 300 ) {
14+ setShowBtn ( true ) ;
15+ } else {
16+ setShowBtn ( false ) ;
17+ }
18+ } ;
19+ window . addEventListener ( "scroll" , handleScroll ) ;
20+
21+ return ( ) => {
22+ window . removeEventListener ( "scroll" , handleScroll ) ;
23+ } ;
24+ } , [ ] ) ;
25+
826 return (
927 < div className = "w-full max-w-[1125px] mx-auto p-[10px] md:p-10 lg:p-10 px-[32.5px]" >
1028 { children }
29+ { showBtn && < ToTopBtn /> }
1130 </ div >
1231 ) ;
1332} ;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ const AddFolderModal = ({ folderName }: { folderName: string }) => {
3737 return (
3838 < ModalContainer title = "폴더 추가" >
3939 < ModalInput
40- placeholder = "내용 입력 "
40+ placeholder = "이름을 입력해주세요 "
4141 name = { folderName }
4242 value = { value }
4343 onChange = { handleChange }
Original file line number Diff line number Diff line change 11import ModalContainer from "./modalComponents/ModalContainer" ;
22import ModalShare from "./modalComponents/ModalShare" ;
33
4- const SNSModal = ( { folderName } : { folderName : string } ) => {
4+ const SNSModal = ( ) => {
55 return (
6- < ModalContainer title = "폴더 공유" subtitle = { folderName } >
6+ < ModalContainer title = "폴더 공유" >
77 < ModalShare />
88 </ ModalContainer >
99 ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ export const Modal = () => {
5252 />
5353 ) ;
5454 case "SNSModal" :
55- return < SNSModal folderName = { props . folderName || "폴더이름" } /> ;
55+ return (
56+ < SNSModal
57+ // folderName={props.folderName || "폴더이름"}
58+ />
59+ ) ;
5660 case "EditLink" :
5761 return (
5862 < EditLink
Original file line number Diff line number Diff line change 1+ import { FaAngleUp } from "react-icons/fa6" ;
2+
3+ const ToTopBtn = ( ) => {
4+ const handleClickToTop = ( ) => {
5+ window . scrollTo ( { top : 0 } ) ;
6+ } ;
7+
8+ return (
9+ < >
10+ < button
11+ type = "button"
12+ onClick = { handleClickToTop }
13+ className = "fixed bottom-10 right-10 rounded-full border bg-white opacity-70 border-purple100 size-[40px] flex items-center justify-center"
14+ >
15+ < FaAngleUp fill = "purple100" />
16+ </ button >
17+ </ >
18+ ) ;
19+ } ;
20+ export default ToTopBtn ;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ const LinkPage = ({
6969 < div className = "bg-gray100 w-full h-[219px] flex justify-center items-center" >
7070 < AddLinkInput folderList = { folderList } />
7171 </ div >
72- < main className = "mt-[40px]" >
72+ < main className = "mt-[40px] relative " >
7373 < Container >
7474 < SearchInput />
7575 { search && < SearchResultMessage message = { search } /> }
You can’t perform that action at this time.
0 commit comments