-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat : 포즈픽 페이지 구현 #9
Changes from all commits
bee48b9
5dc2ac5
46ea61c
b2f0618
f994af3
0802428
f277398
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'use client'; | ||
|
||
import { BottomFixedButton } from '@/components/Button'; | ||
import Image from 'next/image'; | ||
import { useState } from 'react'; | ||
|
||
const countList = ['1인', '2인', '3인', '4인', '5인+']; | ||
|
||
export default function PickSection() { | ||
const [countState, setCountState] = useState<string>('1인'); | ||
|
||
return ( | ||
<section className="flex flex-col "> | ||
<div className="my-16 flex h-40 justify-evenly rounded-8 px-20"> | ||
{countList.map((count) => ( | ||
<CountItem | ||
key={count} | ||
onClick={() => setCountState(count)} | ||
isSelected={count === countState} | ||
count={count} | ||
/> | ||
))} | ||
</div> | ||
<div className="relative h-520 grow bg-black"> | ||
<Image src="/images/sample.png" fill alt="image" /> | ||
</div> | ||
<BottomFixedButton text="포즈 pick!" className="bg-main-violet text-white" /> | ||
</section> | ||
); | ||
} | ||
|
||
interface CountItemProps { | ||
isSelected: boolean; | ||
count: string; | ||
onClick: () => void; | ||
} | ||
|
||
function CountItem({ isSelected, count, onClick }: CountItemProps) { | ||
return ( | ||
<div | ||
className={`flex grow cursor-pointer items-center justify-center first:rounded-l-8 last:rounded-r-8 ${ | ||
isSelected | ||
? 'border-1 border-main-violet bg-main-violet-bright' | ||
: 'border-1 border-default bg-sub-white' | ||
}`} | ||
onClick={onClick} | ||
> | ||
<h6 className={isSelected ? 'text-main-violet-dark' : ''}>{count}</h6> | ||
</div> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import PickSection from './components/PickSection'; | ||
|
||
export default function Pick() { | ||
return <>포즈픽s</>; | ||
return ( | ||
<> | ||
<PickSection /> | ||
</> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ | |
display: none; | ||
} | ||
|
||
html { | ||
font-size: 4vw; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4vw는 어떻게 나온 기준일까요 ?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 폰트사이즈는 아래에 있는 너비가 440px일 때 16px이고, 그 이후로는 vw, 즉 뷰포트 너비에 맞게 font-size또한 작아져야 합니다. 이야기하면서 생각난건데, 정확한 수치는 4vw가 아니겠네요. 440px * x = 16 x = 16/440px = 약 0.036.. 이네요. calc를 이용하면 |
||
} | ||
|
||
@media (min-width: 420px) { | ||
html { | ||
font-size: 16px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ export default function RootLayout({ children }: { children: React.ReactNode }) | |
return ( | ||
<html lang="ko"> | ||
<body className="flex h-[100dvh] w-screen touch-none justify-center bg-slate-100 py-px"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 전 PR에서 루트 레이아웃에 변경사항이 있었는데 혹시 머지중에 충돌난다면 규성님이 쓰신걸루 해주세요! |
||
<div className="h-full w-full max-w-440 bg-white px-20 text-black drop-shadow-2xl"> | ||
<div className="h-full w-full max-w-440 bg-white text-black drop-shadow-2xl"> | ||
{children} | ||
</div> | ||
</body> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { StrictPropsWithChildren } from '@/types'; | ||
|
||
export default function BottomFixedDiv({ children }: StrictPropsWithChildren) { | ||
return ( | ||
<div className="fixed inset-x-0 bottom-0 mx-auto max-w-440"> | ||
<div className="px-20 pb-20">{children}</div> | ||
</div> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import BottomFixedDiv from '../BottomFixedDiv'; | ||
import Button, { type ButtonProps } from './Button'; | ||
|
||
export default function BottomFixedButton({ ...props }: ButtonProps) { | ||
return ( | ||
<BottomFixedDiv> | ||
<Button {...props} /> | ||
</BottomFixedDiv> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ButtonHTMLAttributes, HTMLAttributes, PropsWithChildren } from 'react'; | ||
|
||
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
text: string; | ||
type?: 'button' | 'submit'; | ||
className?: string; | ||
props?: PropsWithChildren<HTMLAttributes<HTMLButtonElement>>; | ||
} | ||
|
||
export default function Button({ text, type = 'button', className, ...props }: ButtonProps) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저희 버튼도 종류가 많아서.. Primary Button으로 따로 이름을 붙이는건 어떨까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 음 그것도 좋은 방법이 될 거 같아요. 버튼이 다양해서 각 도메인에서 버튼을 커스텀하여 만드는 방법을 생각했지만, 자주 쓰는 primary button은 만들면 좋을 거 같네요. |
||
return ( | ||
<button | ||
className={`flex h-60 w-full items-center justify-center rounded-xl py-14 text-center text-16 ${className}`} | ||
type={type} | ||
{...props} | ||
> | ||
<h5>{text}</h5> | ||
</button> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as Button } from './Button'; | ||
export { default as BottomFixedButton } from './BottomFixedButton'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import { COLOR } from "../../src/constants/color"; | ||
|
||
export const colors = { | ||
// bg | ||
"white": COLOR.white, | ||
"sub-white": COLOR.gray[50], | ||
"divider": COLOR.gray[100], | ||
// bg | ||
white: COLOR.white, | ||
'sub-white': COLOR.gray[50], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 큰 상관은 없긴 한데, 요 파일 프리티어로 자동 적용 된 것 같네요..! |
||
divider: COLOR.gray[100], | ||
|
||
// border | ||
"default": COLOR.gray[300], | ||
"active": COLOR.gray[900], | ||
"disabled": COLOR.gray[100], | ||
// border | ||
default: COLOR.gray[300], | ||
active: COLOR.gray[900], | ||
disabled: COLOR.gray[100], | ||
|
||
// brand colors | ||
"main-violet-light": COLOR.violet[300], | ||
"main-violet": COLOR.violet[500], | ||
"main-violet-dark": COLOR.violet[700], | ||
// brand colors | ||
'main-violet-bright': COLOR.violet[100], | ||
'main-violet-light': COLOR.violet[300], | ||
'main-violet': COLOR.violet[600], | ||
'main-violet-dark': COLOR.violet[700], | ||
|
||
// text | ||
"cto": COLOR.black, | ||
"brand": COLOR.violet[500], | ||
"primary":COLOR.gray[900], | ||
"secondary": COLOR.gray[700], | ||
"tertiary": COLOR.gray[500], | ||
"caption": COLOR.gray[400], | ||
|
||
// icon | ||
"icon-default": COLOR.gray[800], | ||
"icon-hover": COLOR.gray[600], | ||
"icon-disabled": COLOR.gray[500], | ||
// text | ||
cto: COLOR.black, | ||
brand: COLOR.violet[500], | ||
primary: COLOR.gray[900], | ||
secondary: COLOR.gray[700], | ||
tertiary: COLOR.gray[500], | ||
caption: COLOR.gray[400], | ||
|
||
} as const | ||
// icon | ||
'icon-default': COLOR.gray[800], | ||
'icon-hover': COLOR.gray[600], | ||
'icon-disabled': COLOR.gray[500], | ||
} as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우와 tailwind 고수같아요... 짱... 👍🏻