diff --git a/.storybook/preview-body.html b/.storybook/preview-body.html index 23699d190..ba12aafb9 100644 --- a/.storybook/preview-body.html +++ b/.storybook/preview-body.html @@ -276,10 +276,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" > - - + + + + + + + + + { - const { routeBack } = useRoutePage(); - +const SectionTitle = ({ name, hasSearchLink }: SectionTitleProps) => { return ( - - - - {link ? ( - - {name} - - ) : ( - {name} - )} - {link && } - - +
+
+ + + + + {name} + +
+ {hasSearchLink && ( + + + + )} +
); }; 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; -`; diff --git a/src/components/Common/SectionTitle/sectionTitle.css.ts b/src/components/Common/SectionTitle/sectionTitle.css.ts new file mode 100644 index 000000000..be0030e95 --- /dev/null +++ b/src/components/Common/SectionTitle/sectionTitle.css.ts @@ -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', +}); diff --git a/src/components/Common/Svg/SvgIcon.tsx b/src/components/Common/Svg/SvgIcon.tsx index 4b6c0796b..305891eb8 100644 --- a/src/components/Common/Svg/SvgIcon.tsx +++ b/src/components/Common/Svg/SvgIcon.tsx @@ -43,6 +43,7 @@ export const SVG_ICON_VARIANTS = [ 'arrowUpDown', 'heartEmpty', 'heartFilled', + 'box', 'close2', 'disk', ] as const; diff --git a/src/components/Common/Svg/SvgSprite.tsx b/src/components/Common/Svg/SvgSprite.tsx index 922b6ec46..106e7367c 100644 --- a/src/components/Common/Svg/SvgSprite.tsx +++ b/src/components/Common/Svg/SvgSprite.tsx @@ -243,8 +243,19 @@ const SvgSprite = () => {
- - + + + + + + + + + diff --git a/src/components/Product/ProductOverviewList/ProductOverviewList.tsx b/src/components/Product/ProductOverviewList/ProductOverviewList.tsx index 66d615cb7..eb91ba36b 100644 --- a/src/components/Product/ProductOverviewList/ProductOverviewList.tsx +++ b/src/components/Product/ProductOverviewList/ProductOverviewList.tsx @@ -8,10 +8,10 @@ import type { Product } from '@/types/product'; interface ProductOverviewListProps { products: Product[]; - isSearchPage?: boolean; + hasBorder?: boolean; } -const ProductOverviewList = ({ products, isSearchPage = false }: ProductOverviewListProps) => { +const ProductOverviewList = ({ products, hasBorder = false }: ProductOverviewListProps) => { return (
    {products.map(({ id, image, name, price, averageRating }) => ( @@ -19,7 +19,7 @@ const ProductOverviewList = ({ products, isSearchPage = false }: ProductOverview - {isSearchPage && ( + {hasBorder && ( <>

    diff --git a/src/components/Recipe/CommentForm/CommentForm.tsx b/src/components/Recipe/CommentForm/CommentForm.tsx index 114322c56..b162150c6 100644 --- a/src/components/Recipe/CommentForm/CommentForm.tsx +++ b/src/components/Recipe/CommentForm/CommentForm.tsx @@ -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 { useRef, useState } from 'react'; -import { SvgIcon } from '@/components/Common'; +import { commentForm, commentTextarea, container, profileImage, sendButton } from './commentForm.css'; + +import { SvgIcon, Text } from '@/components/Common'; import { useScroll } from '@/hooks/common'; +import { useMemberQuery } from '@/hooks/queries/members'; import { useRecipeCommentMutation } from '@/hooks/queries/recipe'; +import { vars } from '@/styles/theme.css'; interface CommentFormProps { recipeId: number; @@ -15,16 +18,27 @@ interface CommentFormProps { const MAX_COMMENT_LENGTH = 200; const CommentForm = ({ recipeId, scrollTargetRef }: CommentFormProps) => { + const { data: member } = useMemberQuery(); + const [commentValue, setCommentValue] = useState(''); const { mutate } = useRecipeCommentMutation(recipeId); - const theme = useTheme(); const { toast } = useToastActionContext(); const { scrollToPosition } = useScroll(); + const textAreaRef = useRef(null); + + const autoResizeTextarea = () => { + if (textAreaRef.current) { + textAreaRef.current.style.height = 'auto'; + textAreaRef.current.style.height = textAreaRef.current.scrollHeight + 'px'; + } + }; + const handleCommentInput: ChangeEventHandler = (e) => { setCommentValue(e.target.value); + autoResizeTextarea(); }; const handleSubmitComment: FormEventHandler = (e) => { @@ -51,54 +65,40 @@ const CommentForm = ({ recipeId, scrollTargetRef }: CommentFormProps) => { }; return ( - -
    - - - + {`${member?.nickname}의 + <> + +