Skip to content
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: 꿀조합 상세 페이지 디자인 마이그레이션 #71

Merged
merged 31 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6ec7c71
feat: 박스 svg icon 추가
xodms0309 Mar 20, 2024
9aaa7cc
style: PageHeader import문 추가
xodms0309 Mar 20, 2024
c33a49f
feat: RecipeFavoriteButton 컴포넌트 디자인 수정
xodms0309 Mar 20, 2024
c9359d4
feat: 꿀조합 상세 페이지 디자인 수정
xodms0309 Mar 20, 2024
ff2ac0d
feat: 댓글 리스트 스타일 마이그레이션
xodms0309 Mar 23, 2024
1fc7105
feat: 댓글작성폼 스타일 마이그레이션
xodms0309 Mar 23, 2024
73207e0
fix: className 수정
xodms0309 Mar 23, 2024
fdd166b
Merge remote-tracking branch 'origin/feat/v2' into feat/issue-59
xodms0309 Mar 23, 2024
f5a7463
feat: 꿀조합 상세 페이지 title 스타일 수정
xodms0309 Mar 23, 2024
9b5c016
feat: line height global style로 적용
xodms0309 Mar 23, 2024
826c9b9
Merge remote-tracking branch 'origin/feat/v2' into feat/issue-59
xodms0309 Apr 1, 2024
24faade
feat: plane 아이콘 교체
xodms0309 Apr 1, 2024
c317c40
style: 린트 적용
xodms0309 Apr 1, 2024
9e9cd24
feat: 댓글창 스타일 마이그레이션
xodms0309 Apr 1, 2024
667b0e5
feat: section title 컴포넌트 디자인 마이그레이션
xodms0309 Apr 1, 2024
d5229c1
feat: 꿀조합 상세페이지 Text 컴포넌트와 SectionTitle 컴포넌트로 교체
xodms0309 Apr 1, 2024
b8274db
feat: RecipeDetail 타입 변경
xodms0309 Apr 1, 2024
c716be5
feat: 사용한 상품 바텀시트 적용
xodms0309 Apr 1, 2024
5c3dcfd
fix: 사진을 사용자의 프로필 사진으로 교체
xodms0309 Apr 7, 2024
5839161
refactor: CommentItem의 텍스트를 Text 컴포넌트로 교체
xodms0309 Apr 7, 2024
ce6c61c
feat: borderRadius 삭제
xodms0309 Apr 7, 2024
adcd805
Merge remote-tracking branch 'origin/feat/v2' into feat/issue-59
xodms0309 Apr 9, 2024
a272d01
feat: svg icon 하나로 교체
xodms0309 Apr 9, 2024
09f99d9
feat: favoriteButton 스타일 수정
xodms0309 Apr 9, 2024
ad18363
style: 린트 적용
xodms0309 Apr 9, 2024
00cc55a
Merge remote-tracking branch 'origin/feat/v2' into feat/issue-59
xodms0309 Apr 13, 2024
8d5990f
feat: 댓글 form 스타일 수정
xodms0309 Apr 13, 2024
feb7e1f
feat: 꿀조합 상세 디자인 변경 적용
xodms0309 Apr 13, 2024
c8a671a
fix: rate->averageRating으로 이름 변경
xodms0309 Apr 13, 2024
5721558
refactor: ProductOverviewItem -> ProductOVerviewList 컴포넌트로 교체
xodms0309 Apr 13, 2024
321cdd2
feat: CommentList, CommentItem 스토리북 추가
xodms0309 Apr 13, 2024
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
30 changes: 26 additions & 4 deletions .storybook/preview-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,19 @@
d="M14.485 9.47a.75.75 0 0 0-1.063 1.06c1.164 1.168 1.133 3.279-.303 4.72l-4.847 4.866c-1.435 1.44-3.533 1.47-4.694.304c-1.164-1.168-1.132-3.28.303-4.72l2.424-2.433a.75.75 0 0 0-1.063-1.059l-2.424 2.433c-1.911 1.92-2.151 4.982-.303 6.838c1.85 1.858 4.907 1.615 6.82-.304l4.847-4.867c1.911-1.918 2.151-4.982.303-6.837Z"
></path>
</g>
<symbol id="plane" width="32" height="32" viewBox="0 0 256 256">
<path
d="M232 127.89a16 16 0 0 1-8.18 14L55.91 237.9A16.14 16.14 0 0 1 48 240a16 16 0 0 1-15.05-21.34l27.35-79.95a4 4 0 0 1 3.79-2.71H136a8 8 0 0 0 8-8.53a8.19 8.19 0 0 0-8.26-7.47H64.16a4 4 0 0 1-3.79-2.7l-27.44-80a16 16 0 0 1 22.92-19.23l168 95.89a16 16 0 0 1 8.15 13.93Z"
/>
<symbol id="plane" viewBox="0 0 18 19">
<g clip-path="url(#clip0_4423_13410)">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M15.1975 0.625674C15.5681 0.490352 15.9695 0.4631 16.3553 0.547225C16.7447 0.632193 17.1016 0.827207 17.3834 1.10908C17.6653 1.39096 17.8603 1.74785 17.9453 2.13732C18.0294 2.52293 18.0021 2.92444 17.8669 3.29502L13.2717 17.0676C13.1597 17.4063 12.9624 17.7115 12.6989 17.9522C12.4363 18.1922 12.1165 18.3608 11.7702 18.442C11.4238 18.5265 11.0613 18.5193 10.7185 18.4213C10.3759 18.3235 10.0647 18.1383 9.81533 17.884L7.35018 15.4301L4.76068 16.7692C4.55875 16.8736 4.31669 16.8636 4.12405 16.7428C3.93143 16.6222 3.81686 16.4087 3.82276 16.1815L3.92892 12.0881L12.9867 5.50856C13.3458 5.24774 13.4255 4.74521 13.1646 4.38615C12.9038 4.02708 12.4013 3.94744 12.0422 4.20826L2.83074 10.8994L0.606834 8.67548C0.365991 8.4348 0.188451 8.13786 0.0906127 7.81172C-0.00653 7.48791 -0.0223126 7.14519 0.0446081 6.81389C0.111615 6.45195 0.273411 6.11419 0.513558 5.8351C0.75535 5.5541 1.0678 5.34276 1.4186 5.22295L1.42294 5.22147L15.1975 0.625674Z"
/>
</g>
<defs>
<clipPath id="clip0_4423_13410">
<rect width="18" height="18" fill="white" transform="translate(0 0.5)" />
</clipPath>
</defs>
</symbol>
<symbol id="info" viewBox="0 0 16 16">
<path
Expand Down Expand Up @@ -310,6 +319,19 @@
d="M11.306 2.916c1.09-1.28 2.76-2.09 4.5-2.09 3.08 0 5.5 2.42 5.5 5.5 0 3.777-3.395 6.855-8.538 11.519l-.012.011a2.161 2.161 0 0 1-2.9.01l-.04-.036c-5.128-4.66-8.51-7.733-8.51-11.504 0-3.08 2.42-5.5 5.5-5.5 1.74 0 3.41.81 4.5 2.09z"
/>
</symbol>
<symbol id="box" fill="none" viewBox="0 0 13 12">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘가 지금 저랑 겹치는 아이콘인데, 저는 disk라는 이름으로 해놨거든요?
만약 제 레시피 PR이 먼저 머지되면, 타미가 땡긴후에 지우면 되고
타미 PR이 먼저 머지되면, 제가 땡긴 후에 컴포넌트도 교체할게요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오케............

<path
d="M11.0689 0.428589H1.64035C1.16696 0.428589 0.783203 0.812345 0.783203 1.28573V10.7143C0.783203 11.1877 1.16696 11.5714 1.64035 11.5714H11.0689C11.5423 11.5714 11.9261 11.1877 11.9261 10.7143V1.28573C11.9261 0.812345 11.5423 0.428589 11.0689 0.428589Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M8.0692 0.428589V4.7143C8.0692 4.82797 8.02404 4.93698 7.94367 5.01735C7.8633 5.09772 7.75429 5.14287 7.64063 5.14287H5.0692C4.95553 5.14287 4.84652 5.09772 4.76615 5.01735C4.68578 4.93698 4.64062 4.82797 4.64062 4.7143V0.428589"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path d="M7.64062 9.42859H9.78348" stroke-linecap="round" stroke-linejoin="round" />
</symbol>
<symbol id="close2" viewBox="0 0 13 12">
<path d="M11.3705 0.81424L1.15625 11.0285" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" />
<path d="M1.15625 0.81424L11.3705 11.0285" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" />
Expand Down
Binary file added src/assets/comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/Common/SectionTitle/SectionTitle.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export const Default: Story = {
},
};

export const Bookmarked: Story = {
export const HasSearch: Story = {
args: {
name: '사이다',
hasSearchLink: true,
},
};
66 changes: 23 additions & 43 deletions src/components/Common/SectionTitle/SectionTitle.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우리 이 Title 컴포넌트 통일 해야할 거 같아요.
지금 스토리북에 너무 비슷한게 많네요!
SectionTitle
SectionHeader
PageHeader
NavigableSectionTitle
대충 비슷한 거 찾은 것만 이정도인데, 여기서 더 공통적으로 쓸 수 있는 헤더는 좀 합쳐야할 듯???
이번주 회의 피그마에 topBar라고 디자이너분들이 모아두셨더라구여??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇네여 안그래도 이거 한 번 정리 들어가야 할 것 같다고 생각했어요🤔 일단 이번 pr은 냅두고 작업하시면 나중에 합치는걸로 해요

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 지금 제가 작업중임다 일단 머지하구 나중에 제가 갈아끼울게용~~

Original file line number Diff line number Diff line change
@@ -1,54 +1,34 @@
import { Button, Heading, Link, theme } from '@fun-eat/design-system';
import { Link as RouterLink } from 'react-router-dom';
import styled from 'styled-components';
import { Link } from 'react-router-dom';

import { SvgIcon } from '@/components/Common';
import { useRoutePage } from '@/hooks/common';
import { container, wrapper } from './sectionTitle.css';

import { SvgIcon, Text } from '@/components/Common';
import { PATH } from '@/constants/path';
import { vars } from '@/styles/theme.css';

interface SectionTitleProps {
name: string;
link?: string;
hasSearchLink?: boolean;
}

const SectionTitle = ({ name, link }: SectionTitleProps) => {
const { routeBack } = useRoutePage();

const SectionTitle = ({ name, hasSearchLink }: SectionTitleProps) => {
return (
<SectionTitleContainer>
<SectionTitleWrapper>
<Button type="button" variant="transparent" onClick={routeBack} aria-label="뒤로 가기">
<SvgIcon variant="arrow" fill={theme.colors.gray5} width={15} height={15} />
</Button>
{link ? (
<Link as={RouterLink} to={link} block>
<ProductName size="xl">{name}</ProductName>
</Link>
) : (
<ProductName size="xl">{name}</ProductName>
)}
{link && <SvgIcon variant="link" width={20} height={20} />}
</SectionTitleWrapper>
</SectionTitleContainer>
<div className={container}>
<div className={wrapper}>
<Link to=".." relative="path">
<SvgIcon variant="arrowLeft" stroke={vars.colors.black} height={24} />
</Link>
<Text size="headline" weight="semiBold">
{name}
</Text>
</div>
{hasSearchLink && (
<Link to={PATH.SEARCH}>
<SvgIcon variant="search2" stroke={vars.colors.black} width={20} height={20} />
</Link>
)}
</div>
);
};

export default SectionTitle;

const SectionTitleContainer = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
`;

const SectionTitleWrapper = styled.div`
display: flex;
align-items: center;

svg {
padding-top: 2px;
}
`;

const ProductName = styled(Heading)`
margin: 0 5px 0 16px;
`;
13 changes: 13 additions & 0 deletions src/components/Common/SectionTitle/sectionTitle.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { style } from '@vanilla-extract/css';

export const container = style({
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
});

export const wrapper = style({
display: 'flex',
gap: 18,
alignItems: 'flex-start',
});
1 change: 1 addition & 0 deletions src/components/Common/Svg/SvgIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const SVG_ICON_VARIANTS = [
'arrowRight',
'heartEmpty',
'heartFilled',
'box',
'close2',
] as const;
export type SvgIconVariant = (typeof SVG_ICON_VARIANTS)[number];
Expand Down
28 changes: 26 additions & 2 deletions src/components/Common/Svg/SvgSprite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,19 @@ const SvgSprite = () => {
<path d="M14.485 9.47a.75.75 0 0 0-1.063 1.06c1.164 1.168 1.133 3.279-.303 4.72l-4.847 4.866c-1.435 1.44-3.533 1.47-4.694.304c-1.164-1.168-1.132-3.28.303-4.72l2.424-2.433a.75.75 0 0 0-1.063-1.059l-2.424 2.433c-1.911 1.92-2.151 4.982-.303 6.838c1.85 1.858 4.907 1.615 6.82-.304l4.847-4.867c1.911-1.918 2.151-4.982.303-6.837Z" />
</g>
</symbol>
<symbol id="plane" viewBox="0 0 256 256">
<path d="M232 127.89a16 16 0 0 1-8.18 14L55.91 237.9A16.14 16.14 0 0 1 48 240a16 16 0 0 1-15.05-21.34l27.35-79.95a4 4 0 0 1 3.79-2.71H136a8 8 0 0 0 8-8.53a8.19 8.19 0 0 0-8.26-7.47H64.16a4 4 0 0 1-3.79-2.7l-27.44-80a16 16 0 0 1 22.92-19.23l168 95.89a16 16 0 0 1 8.15 13.93Z" />
<symbol id="plane" viewBox="0 0 18 19">
<g clipPath="url(#clip0_4423_13410)">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M15.1975 0.625674C15.5681 0.490352 15.9695 0.4631 16.3553 0.547225C16.7447 0.632193 17.1016 0.827207 17.3834 1.10908C17.6653 1.39096 17.8603 1.74785 17.9453 2.13732C18.0294 2.52293 18.0021 2.92444 17.8669 3.29502L13.2717 17.0676C13.1597 17.4063 12.9624 17.7115 12.6989 17.9522C12.4363 18.1922 12.1165 18.3608 11.7702 18.442C11.4238 18.5265 11.0613 18.5193 10.7185 18.4213C10.3759 18.3235 10.0647 18.1383 9.81533 17.884L7.35018 15.4301L4.76068 16.7692C4.55875 16.8736 4.31669 16.8636 4.12405 16.7428C3.93143 16.6222 3.81686 16.4087 3.82276 16.1815L3.92892 12.0881L12.9867 5.50856C13.3458 5.24774 13.4255 4.74521 13.1646 4.38615C12.9038 4.02708 12.4013 3.94744 12.0422 4.20826L2.83074 10.8994L0.606834 8.67548C0.365991 8.4348 0.188451 8.13786 0.0906127 7.81172C-0.00653 7.48791 -0.0223126 7.14519 0.0446081 6.81389C0.111615 6.45195 0.273411 6.11419 0.513558 5.8351C0.75535 5.5541 1.0678 5.34276 1.4186 5.22295L1.42294 5.22147L15.1975 0.625674Z"
/>
</g>
<defs>
<clipPath id="clip0_4423_13410">
<rect width="18" height="18" fill="white" transform="translate(0 0.5)" />
</clipPath>
</defs>
</symbol>
<symbol id="info" viewBox="0 0 16 16">
<path d="M8 7a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0v-3A.5.5 0 0 1 8 7zm0-.75a.749.749 0 1 0 0-1.5.749.749 0 0 0 0 1.498zM2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8zm6-5a5 5 0 1 0 0 10A5 5 0 0 0 8 3z" />
Expand Down Expand Up @@ -270,6 +281,19 @@ const SvgSprite = () => {
d="M11.306 2.916c1.09-1.28 2.76-2.09 4.5-2.09 3.08 0 5.5 2.42 5.5 5.5 0 3.777-3.395 6.855-8.538 11.519l-.012.011a2.161 2.161 0 0 1-2.9.01l-.04-.036c-5.128-4.66-8.51-7.733-8.51-11.504 0-3.08 2.42-5.5 5.5-5.5 1.74 0 3.41.81 4.5 2.09z"
/>
</symbol>
<symbol id="box" fill="none" viewBox="0 0 13 12">
<path
d="M11.0689 0.428589H1.64035C1.16696 0.428589 0.783203 0.812345 0.783203 1.28573V10.7143C0.783203 11.1877 1.16696 11.5714 1.64035 11.5714H11.0689C11.5423 11.5714 11.9261 11.1877 11.9261 10.7143V1.28573C11.9261 0.812345 11.5423 0.428589 11.0689 0.428589Z"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8.0692 0.428589V4.7143C8.0692 4.82797 8.02404 4.93698 7.94367 5.01735C7.8633 5.09772 7.75429 5.14287 7.64063 5.14287H5.0692C4.95553 5.14287 4.84652 5.09772 4.76615 5.01735C4.68578 4.93698 4.64062 4.82797 4.64062 4.7143V0.428589"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path d="M7.64062 9.42859H9.78348" strokeLinecap="round" strokeLinejoin="round" />
</symbol>
<symbol id="close2" viewBox="0 0 13 12">
<path d="M11.3705 0.81424L1.15625 11.0285" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
<path d="M1.15625 0.81424L11.3705 11.0285" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
Expand Down
67 changes: 23 additions & 44 deletions src/components/Recipe/CommentForm/CommentForm.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Button, Spacing, Text, Textarea, useTheme, useToastActionContext } from '@fun-eat/design-system';
import { useToastActionContext } from '@fun-eat/design-system';
import type { ChangeEventHandler, FormEventHandler, RefObject } from 'react';
import { useState } from 'react';
import styled from 'styled-components';

import { SvgIcon } from '@/components/Common';
import { commentForm, commentTextarea, container } from './commentForm.css';

import CommentImage from '@/assets/comment.png';
import { SvgIcon, Text } from '@/components/Common';
import { useScroll } from '@/hooks/common';
import { useRecipeCommentMutation } from '@/hooks/queries/recipe';
import { vars } from '@/styles/theme.css';

interface CommentFormProps {
recipeId: number;
Expand All @@ -18,7 +21,6 @@ const CommentForm = ({ recipeId, scrollTargetRef }: CommentFormProps) => {
const [commentValue, setCommentValue] = useState('');
const { mutate } = useRecipeCommentMutation(recipeId);

const theme = useTheme();
const { toast } = useToastActionContext();

const { scrollToPosition } = useScroll();
Expand Down Expand Up @@ -51,54 +53,31 @@ const CommentForm = ({ recipeId, scrollTargetRef }: CommentFormProps) => {
};

return (
<CommentFormContainer>
<Form onSubmit={handleSubmitComment}>
<CommentTextarea
placeholder="댓글을 입력하세요. (200자)"
<div className={container}>
<img src={CommentImage} width={29} height={29} />
<form className={commentForm} onSubmit={handleSubmitComment}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alt 추가해주세용~~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거는 사용자 프사있을 때는 프사 보이는게 아닌가요?!?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 이거 사용자 프사였어요? ㅋㅋㅋㅋㅋㅋㅋ 그냥 아이콘인줄 ㅠ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(사실 나도 모름 ㅎ 근데 아마 프사 같음.... 아마....😇)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프사가 맞아보이네요

<textarea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 스토리북에서 오른쪽에 하얀 거 있길래 땡겼는데...

스크린샷 2024-04-08 오전 1 30 37

요래 되네요...?

스크린샷 2024-04-08 오전 1 31 01

이거 스토리북에서만 이런건가요...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMG_7647

인스타 느낌으로 가야할거 같은데요.? 줄따라 늘어나다가 특정 높이에서 끊기는 느낌으로

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 못땡기게 하는 방법 있으려나..? 찾아볼게요 높이 고정하는거

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

css resize 속성 있슴다

className={commentTextarea}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 textarea면 우리 v.1 디자인처럼 칸 수 넘어가면 뚱뚱해지나요?

스크린샷 2024-04-08 오전 1 28 25

placeholder="댓글을 남겨보세요! (200자)"
value={commentValue}
onChange={handleCommentInput}
maxLength={MAX_COMMENT_LENGTH}
rows={1}
/>
<SubmitButton variant="transparent" disabled={commentValue.length === 0}>
<Text size="caption4" color="disabled">
{commentValue.length}/200
</Text>
<button>
<SvgIcon
variant="plane"
width={30}
height={30}
fill={commentValue.length === 0 ? theme.colors.gray2 : theme.colors.gray4}
width={18}
height={18}
fill={commentValue.length === 0 ? vars.colors.gray3 : vars.colors.gray5}
/>
</SubmitButton>
</Form>
<Spacing size={8} />
<Text size="xs" color={theme.textColors.info} align="right">
{commentValue.length}자 / {MAX_COMMENT_LENGTH}자
</Text>
</CommentFormContainer>
</button>
</form>
</div>
);
};

export default CommentForm;

const CommentFormContainer = styled.div`
position: fixed;
bottom: 0;
width: calc(100% - 40px);
max-width: 540px;
padding: 16px 0;
background: ${({ theme }) => theme.backgroundColors.default};
`;

const Form = styled.form`
display: flex;
gap: 4px;
justify-content: space-around;
align-items: center;
`;

const CommentTextarea = styled(Textarea)`
height: 50px;
padding: 8px;
`;

const SubmitButton = styled(Button)`
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
`;
34 changes: 34 additions & 0 deletions src/components/Recipe/CommentForm/commentForm.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { vars } from '@/styles/theme.css';
import { style } from '@vanilla-extract/css';

export const container = style({
display: 'flex',
gap: 8,
alignItems: 'center',
marginBottom: 24,
padding: '6px 13px 6px 6px',
background: vars.colors.background.category,
borderRadius: 20,
});

export const commentForm = style({
display: 'flex',
gap: 8,
alignItems: 'center',
width: '100%',
});

export const commentTextarea = style({
width: '100%',
height: '100%',
border: 'none',
outline: 'none',
background: 'none',
fontSize: '1.4rem',

selectors: {
'&:placeholder': {
color: '#808080',
},
},
});
38 changes: 6 additions & 32 deletions src/components/Recipe/CommentItem/CommentItem.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,20 @@
import { Divider, Spacing, Text, useTheme } from '@fun-eat/design-system';
import styled from 'styled-components';
import { commentItem, container } from './commentItem.css';

import { MemberImage } from '@/components/Members';
import type { Comment } from '@/types/recipe';
import { getFormattedDate } from '@/utils/date';

interface CommentItemProps {
recipeComment: Comment;
}

const CommentItem = ({ recipeComment }: CommentItemProps) => {
const theme = useTheme();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요친구는 스토리북 없나요???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋㅋㅋ이거 전에 급하게 한거라서 없는듯 추가할게요

const { author, comment, createdAt } = recipeComment;
const { author, comment } = recipeComment;

return (
<>
<AuthorWrapper>
<MemberImage src={author.profileImage} alt={`${author.nickname}님의 프로필`} width={32} height={32} />
<div>
<Text size="xs" color={theme.textColors.info}>
{author.nickname} 님
</Text>
<Text size="xs" color={theme.textColors.info}>
{getFormattedDate(createdAt)}
</Text>
</div>
</AuthorWrapper>
<CommentContent size="sm">{comment}</CommentContent>
<Divider variant="disabled" />
<Spacing size={16} />
</>
<li className={container}>
<span className={commentItem['nickname']}>{author.nickname}</span>
<p className={commentItem['content']}>{comment}</p>
</li>
);
};

export default CommentItem;

const AuthorWrapper = styled.div`
display: flex;
gap: 12px;
align-items: center;
`;

const CommentContent = styled(Text)`
margin: 16px 0;
`;
16 changes: 16 additions & 0 deletions src/components/Recipe/CommentItem/commentItem.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { style, styleVariants } from '@vanilla-extract/css';

export const container = style({
display: 'flex',
gap: 6,
});

const baseText = style({
color: '#3D3D3D',
fontSize: '1.2rem',
});

export const commentItem = styleVariants({
nickname: [baseText, { fontWeight: 600, whiteSpace: 'nowrap' }],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 부분 fontWeight는 vars에서 가져와서 쓸 수 있나요???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넹 됩니다! 수정할게여

content: [baseText, { fontWeight: 400 }],
});
Loading
Loading