-
Notifications
You must be signed in to change notification settings - Fork 0
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 #8 from meme-party/feat/common-components-responsive
디자인 시스템 적용 및 반응형처리
- Loading branch information
Showing
22 changed files
with
164 additions
and
104 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
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Image from "next/image" | ||
|
||
export default function Footer() { | ||
return ( | ||
<section> | ||
<article className="relative h-[20px] w-[120px]"> | ||
<Image src={"/kakao.png"} alt="logo" fill /> | ||
</article> | ||
</section> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Search } from "lucide-react" | ||
import Image from "next/image" | ||
import Button from "@/components/Button" | ||
import { COLORS } from "@/styles/colors" | ||
|
||
export default function Header() { | ||
// Todo 세션체크해서 닉네임, 버튼 조건부 렌더링 | ||
return ( | ||
// lg:px-[120px] | ||
<section className="flex h-[94px] w-full items-end justify-between px-[16px] py-[12px] md:h-auto md:items-center md:px-[24px] md:py-[8px]"> | ||
<article className="relative h-[24px] w-[120px]"> | ||
<Image src={"/kakao.png"} alt="logo" fill /> | ||
</article> | ||
<article className="flex flex-row-reverse items-center gap-[24px] md:flex md:flex-row"> | ||
<div className="flex items-center gap-[8px]"> | ||
<div className="relative h-[24px] w-[24px]"> | ||
<Image src={"/cat.png"} alt="profile-image" fill className="rounded-full" /> | ||
</div> | ||
<p className="hidden text-h3-r md:flex">유저 닉네임이 들어가요</p> | ||
</div> | ||
<Search size={24} color={COLORS.PRIMARY} /> | ||
<Button className="hidden bg-primary-300 px-[24px] py-[4px] text-h2-sb md:flex">로그인</Button> | ||
</article> | ||
</section> | ||
) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { cn } from "@/utils/cn" | ||
import type { ButtonHTMLAttributes } from "react" | ||
import Button from "./Button" | ||
|
||
interface Params extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
title: string | ||
variant?: "default" | "colored" | ||
} | ||
|
||
export default function TagSmallButton({ title, variant = "default", ...buttonProps }: Params) { | ||
return ( | ||
<Button | ||
{...buttonProps} | ||
className={cn( | ||
"w-fit rounded-[8px] bg-gray-scale-700 p-[8px] text-h3-m", | ||
variant === "colored" ? "border border-primary-400 text-primary-300" : "text-gray-scale-200", | ||
buttonProps.className | ||
)} | ||
> | ||
<p>{title}</p> | ||
</Button> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,20 @@ | ||
"use client" | ||
|
||
import { useToast } from "@/store/toast" | ||
import { cn } from "@/utils/cn" | ||
import { AnimatePresence, motion } from "framer-motion" | ||
import dynamic from "next/dynamic" | ||
import ReactDOM from "react-dom" | ||
|
||
const CircleCheck = dynamic(() => import("@/icons/CircleCheck")) | ||
const TriangleAlert = dynamic(() => import("@/icons/TriangleAlert")) | ||
const CircleAlert = dynamic(() => import("@/icons/CircleAlert")) | ||
import { Toaster } from "sonner" | ||
|
||
export default function Toast() { | ||
const { toast, closeToast } = useToast() | ||
|
||
const element = typeof window !== "undefined" && document.getElementById(`toastPortal`) | ||
|
||
if (!element) return null | ||
|
||
// Todo type 에 따라 텍스트색상 다르게 할건지 논의 필요 | ||
// const toastTypeClasses = { | ||
// success: "text-primary-300", | ||
// warning: "text-yellow-500", | ||
// error: "text-red-500" | ||
// } | ||
|
||
const content = ( | ||
<AnimatePresence> | ||
{toast.isOpened && ( | ||
<motion.section | ||
className="fixed bottom-0 flex w-full justify-center bg-dark/60 px-6 py-10 drop-shadow-toast backdrop-blur-lg" | ||
initial={{ y: 50, opacity: 0 }} | ||
animate={{ y: 0, opacity: 1 }} | ||
exit={{ y: 50, opacity: 0 }} | ||
transition={{ | ||
duration: 0.5, | ||
ease: "easeOut" | ||
}} | ||
> | ||
<article className="flex w-full max-w-[1280px] items-center justify-between"> | ||
<div | ||
className={cn( | ||
"flex gap-[4px] text-primary-300" | ||
// toastTypeClasses[toast.type] | ||
)} | ||
> | ||
{toast.type === "success" && <CircleCheck pathColor="#17161799" />} | ||
{toast.type === "warning" && <TriangleAlert pathColor="#17161799" />} | ||
{toast.type === "error" && <CircleAlert pathColor="#17161799" />} | ||
|
||
{toast.text} | ||
</div> | ||
{!toast.autoClose && ( | ||
<button | ||
className="min-w-[148px] rounded-md bg-gray-scale-800 px-3 py-2 text-white hover:bg-gray-scale-700" | ||
onClick={closeToast} | ||
> | ||
완료 | ||
</button> | ||
)} | ||
</article> | ||
</motion.section> | ||
)} | ||
</AnimatePresence> | ||
return ( | ||
<Toaster | ||
duration={3000} | ||
className="flex items-center justify-center font-pretendard" | ||
position="bottom-center" | ||
// offset={{ left: 0, right: 0 }} | ||
mobileOffset={{ left: 0, right: 0, bottom: 20 }} | ||
toastOptions={{ | ||
classNames: { | ||
toast: | ||
"bg-primary-300 drop-shadow-toast backdrop-blur-lg border-none text-h2-m max-w-[280px] sm:max-w-[340px] justify-self-center p-[8px]" | ||
} | ||
}} | ||
/> | ||
) | ||
|
||
return ReactDOM.createPortal(content, element) | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import localFont from "next/font/local" | ||
|
||
export const Pretendard = localFont({ | ||
src: "../fonts/PretendardVariable.woff2", | ||
variable: "--font-pretendard", | ||
weight: "400 500 600 700", | ||
display: "swap" | ||
}) |
Oops, something went wrong.