diff --git a/src/bookmarks/ui/BookmarkArticle.tsx b/src/bookmarks/ui/BookmarkArticle.tsx index 150a5da6..2dbc8f77 100644 --- a/src/bookmarks/ui/BookmarkArticle.tsx +++ b/src/bookmarks/ui/BookmarkArticle.tsx @@ -109,9 +109,15 @@ const BookMarkArticle = () => { - - {bookmarkDetail?.categoryName ?? ''} - + {bookmarkDetail?.categoryName && ( + 5 ? 0.8 : 1} + > + {bookmarkDetail.categoryName ?? ''} + + )} diff --git a/src/category/ui/Add/CategoryName.tsx b/src/category/ui/Add/CategoryName.tsx index 4e0a0436..a3da2611 100644 --- a/src/category/ui/Add/CategoryName.tsx +++ b/src/category/ui/Add/CategoryName.tsx @@ -3,6 +3,8 @@ import Text from '@/common-ui/Text'; import getRem from '@/utils/getRem'; import styled from '@emotion/styled'; +const CATEGORY_MAX_LENGTH = 10; + interface NameProps { onChangeCategoryName: (name: string) => void; categoryName: string; @@ -17,7 +19,11 @@ const CategoryName = ({ categoryName, onChangeCategoryName }: NameProps) => { onChangeCategoryName(e.target.value)} + maxLength={CATEGORY_MAX_LENGTH} /> + {`${categoryName.length} / ${CATEGORY_MAX_LENGTH}자`} ); }; @@ -30,4 +36,9 @@ const CategoryNameInput = styled(Input)` margin-top: ${getRem(20)}; `; +const CountText = styled(Text.P)` + text-align: right; + margin-top: ${getRem(10)}; +`; + export default CategoryName;