-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from TripInfoWeb/dev_informations
Fix: 빌드 오류 수정
- Loading branch information
Showing
5 changed files
with
84 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,79 +1,77 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { forwardRef } from "react"; | ||
import { RefObject } from "react"; | ||
import { IoIosArrowUp } from "react-icons/io"; | ||
import { MdClose } from "react-icons/md"; | ||
|
||
interface Props { | ||
visible: boolean; | ||
ref: RefObject<HTMLDivElement>; | ||
onClick: () => void; | ||
onScrollToTop: () => void; | ||
} | ||
|
||
const FloatingButton = forwardRef<HTMLDivElement, Props>( | ||
({ visible, onClick, onScrollToTop }, ref) => { | ||
|
||
return ( | ||
<div className="fixed bottom-8 left-[calc(100vw-12px)] z-40 flex w-24 translate-x-[-100%] flex-col items-center gap-3"> | ||
{visible && ( | ||
<div ref={ref} className="flex flex-col items-center gap-3"> | ||
<div className="flex animate-fadeIn flex-col items-center gap-6 rounded-full bg-[#F2FAF7] px-4 py-[1.875rem] dark:bg-slate-500"> | ||
<Link | ||
className="flex flex-col items-center text-sm hover:text-main" | ||
href="/diary/write" | ||
onClick={onClick} | ||
> | ||
<p>일기</p> | ||
<p>등록하기</p> | ||
</Link> | ||
<Link | ||
className="flex flex-col items-center text-sm hover:text-main" | ||
href="/gathering/write" | ||
onClick={onClick} | ||
> | ||
<p>모임</p> | ||
<p>등록하기</p> | ||
</Link> | ||
<Link | ||
className="flex flex-col items-center text-sm hover:text-main" | ||
href="/informations/write" | ||
onClick={onClick} | ||
> | ||
<p>여행정보</p> | ||
<p>등록하기</p> | ||
</Link> | ||
</div> | ||
<button | ||
className="flex h-12 w-12 animate-buttonRotation flex-row items-center justify-center rounded-full bg-main text-white shadow-md hover:scale-105" | ||
const FloatingButton = ({ visible, ref, onClick, onScrollToTop }: Props) => { | ||
return ( | ||
<div className="fixed bottom-8 left-[calc(100vw-12px)] z-40 flex w-24 translate-x-[-100%] flex-col items-center gap-3"> | ||
{visible && ( | ||
<div ref={ref} className="flex flex-col items-center gap-3"> | ||
<div className="flex animate-fadeIn flex-col items-center gap-6 rounded-full bg-[#F2FAF7] px-4 py-[1.875rem] dark:bg-slate-500"> | ||
<Link | ||
className="flex flex-col items-center text-sm hover:text-main" | ||
href="/diary/write" | ||
onClick={onClick} | ||
> | ||
<p>일기</p> | ||
<p>등록하기</p> | ||
</Link> | ||
<Link | ||
className="flex flex-col items-center text-sm hover:text-main" | ||
href="/gathering/write" | ||
onClick={onClick} | ||
> | ||
<p>모임</p> | ||
<p>등록하기</p> | ||
</Link> | ||
<Link | ||
className="flex flex-col items-center text-sm hover:text-main" | ||
href="/informations/write" | ||
onClick={onClick} | ||
> | ||
<MdClose size={"1.5rem"} /> | ||
</button> | ||
<p>여행정보</p> | ||
<p>등록하기</p> | ||
</Link> | ||
</div> | ||
)} | ||
{!visible && ( | ||
<button | ||
className="flex h-12 w-12 flex-row items-center justify-center rounded-full bg-black text-white shadow-md hover:scale-105 dark:bg-slate-600" | ||
className="flex h-12 w-12 animate-buttonRotation flex-row items-center justify-center rounded-full bg-main text-white shadow-md hover:scale-105" | ||
onClick={onClick} | ||
> | ||
<Image | ||
className="-ml-1" | ||
src="/pencil-icon.png" | ||
alt="pencil-icon" | ||
width={24} | ||
height={24} | ||
/> | ||
<MdClose size={"1.5rem"} /> | ||
</button> | ||
)} | ||
</div> | ||
)} | ||
{!visible && ( | ||
<button | ||
className="flex h-12 w-12 flex-row items-center justify-center rounded-full bg-black text-white shadow-md hover:scale-105 dark:bg-slate-600" | ||
onClick={onScrollToTop} | ||
onClick={onClick} | ||
> | ||
<IoIosArrowUp size={"1.5rem"} /> | ||
<Image | ||
className="-ml-1" | ||
src="/pencil-icon.png" | ||
alt="pencil-icon" | ||
width={24} | ||
height={24} | ||
/> | ||
</button> | ||
</div> | ||
); | ||
}, | ||
); | ||
)} | ||
<button | ||
className="flex h-12 w-12 flex-row items-center justify-center rounded-full bg-black text-white shadow-md hover:scale-105 dark:bg-slate-600" | ||
onClick={onScrollToTop} | ||
> | ||
<IoIosArrowUp size={"1.5rem"} /> | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FloatingButton; |
This file contains 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 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 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