diff --git a/frontend/src/components/Recipe/CommentForm/CommentForm.tsx b/frontend/src/components/Recipe/CommentForm/CommentForm.tsx index ac53b1a40..28820c71a 100644 --- a/frontend/src/components/Recipe/CommentForm/CommentForm.tsx +++ b/frontend/src/components/Recipe/CommentForm/CommentForm.tsx @@ -3,6 +3,7 @@ import type { ChangeEventHandler, FormEventHandler } from 'react'; import { useState } from 'react'; import styled from 'styled-components'; +import { SvgIcon } from '@/components/Common'; import { useToastActionContext } from '@/hooks/context'; import useRecipeCommentMutation from '@/hooks/queries/recipe/useRecipeCommentMutation'; @@ -46,7 +47,7 @@ const CommentForm = ({ recipeId }: CommentFormProps) => { }; return ( - <> +
{ onChange={handleCommentInput} maxLength={MAX_COMMENT_LENGTH} /> - - 등록 + + {commentValue.length}자 / {MAX_COMMENT_LENGTH}자 - +
); }; 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)` - width: calc(100% - 50px); + height: 50px; padding: 8px; font-size: 1.4rem; `; const SubmitButton = styled(Button)` - background: ${({ theme, disabled }) => (disabled ? theme.colors.gray2 : theme.colors.primary)}; cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')}; `; diff --git a/frontend/src/pages/RecipeDetailPage.tsx b/frontend/src/pages/RecipeDetailPage.tsx index fab578792..da5f050bf 100644 --- a/frontend/src/pages/RecipeDetailPage.tsx +++ b/frontend/src/pages/RecipeDetailPage.tsx @@ -20,7 +20,7 @@ export const RecipeDetailPage = () => { const { id, images, title, content, author, products, totalPrice, favoriteCount, favorite, createdAt } = recipeDetail; return ( - + <> {images.length > 0 ? ( @@ -80,14 +80,10 @@ export const RecipeDetailPage = () => { - + ); }; -const RecipeDetailPageContainer = styled.div` - padding: 20px 20px 0; -`; - const RecipeImageContainer = styled.ul` display: flex; flex-direction: column; diff --git a/frontend/src/router/index.tsx b/frontend/src/router/index.tsx index 0103d0fc7..1f0ee78a9 100644 --- a/frontend/src/router/index.tsx +++ b/frontend/src/router/index.tsx @@ -17,15 +17,6 @@ const router = createBrowserRouter([ ), errorElement: , children: [ - { - path: `${PATH.RECIPE}/:recipeId`, - async lazy() { - const { RecipeDetailPage } = await import( - /* webpackChunkName: "RecipeDetailPage" */ '@/pages/RecipeDetailPage' - ); - return { Component: RecipeDetailPage }; - }, - }, { path: PATH.MEMBER, async lazy() { @@ -119,6 +110,15 @@ const router = createBrowserRouter([ return { Component: ProductDetailPage }; }, }, + { + path: `${PATH.RECIPE}/:recipeId`, + async lazy() { + const { RecipeDetailPage } = await import( + /* webpackChunkName: "RecipeDetailPage" */ '@/pages/RecipeDetailPage' + ); + return { Component: RecipeDetailPage }; + }, + }, ], }, {