Skip to content

Commit

Permalink
Feat: 코멘트 글자수 초과시 입력 제한 기능 추가 및 타이틀 에러시 플레이스홀더 색상 변경 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyoung-min committed Feb 2, 2024
1 parent 9b1b3be commit df0c95a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/app/create/_components/Items.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ export const title = style({
},
});

export const errorTitle = style([
title,
{
'::placeholder': {
color: '#FF5454',
},
},
]);

export const comment = style({
width: '100%',
resize: 'none',
Expand Down
4 changes: 3 additions & 1 deletion src/app/create/_components/Items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ export default function Items() {
itemLength={watchItems.length}
titleInput={
<input
className={styles.title}
className={titleError ? styles.errorTitle : styles.title}
placeholder={itemPlaceholder.title}
autoComplete="off"
maxLength={100}
{...register(`items.${index}.title`, itemTitleRules)}
/>
}
commentTextArea={
<textarea
className={styles.comment}
placeholder={itemPlaceholder.comment}
maxLength={100}
{...register(`items.${index}.comment`, itemCommentRules)}
/>
}
Expand Down

0 comments on commit df0c95a

Please sign in to comment.