Skip to content

Commit

Permalink
feat: 에러 css 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kimeodml committed Mar 29, 2024
1 parent bcdc817 commit a9f84b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/page/AddMenu/components/MenuName/MenuName.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
font-size: 13px;
font-weight: 400;
}

&--error {
border: 0.5px #f7941e solid;
}
}

&__name-text {
Expand Down Expand Up @@ -67,6 +71,10 @@
font-size: 20px;
font-weight: 400;
}

&--error {
border: 0.5px #f7941e solid;
}
}

.name-text {
Expand Down
11 changes: 9 additions & 2 deletions src/page/AddMenu/components/MenuName/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import useMediaQuery from 'utils/hooks/useMediaQuery';
import useAddMenuStore from 'store/addMenu';
import { useErrorMessageStore } from 'store/errorMessageStore';
import cn from 'utils/ts/className';
import styles from './MenuName.module.scss';

interface MenuNameProps {
Expand All @@ -27,7 +28,10 @@ export default function MenuName({ isComplete }: MenuNameProps) {
<span className={styles['mobile__name-text']}>{name}</span>
) : (
<input
className={styles['mobile__name-input']}
className={cn({
[styles['mobile__name-input']]: true,
[styles['mobile__name-input--error']]: menuError,
})}
placeholder="예) 불족발 + 막국수 저녁 SET"
onChange={handleNameChange}
value={name}
Expand All @@ -44,7 +48,10 @@ export default function MenuName({ isComplete }: MenuNameProps) {
<span className={styles['name-text']}>{name}</span>
) : (
<input
className={styles['name-input']}
className={cn({
[styles['name-input']]: true,
[styles['name-input--error']]: menuError,
})}
placeholder="예) 불족발 + 막국수 저녁 SET"
onChange={handleNameChange}
value={name}
Expand Down
6 changes: 2 additions & 4 deletions src/page/AddMenu/components/MenuPrice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export default function MenuPrice({ isComplete }:MenuPriceProps) {
<input
type="number"
className={styles['mobile__price-info-inputs__price-input']}
value={singlePrice === 0 || singlePrice === null ? '' : singlePrice}
onChange={(e) => setSinglePrice(e.target.value === '' ? 0 : Number(e.target.value))}
value={singlePrice}
onChange={(e) => setSinglePrice(Number(e.target.value))}
/>
<p className={styles['mobile__price-info-inputs__price-input-won']}></p>
</div>
Expand Down Expand Up @@ -93,9 +93,7 @@ export default function MenuPrice({ isComplete }:MenuPriceProps) {
<>
<div className={styles.header}>
<div className={styles.header__title}>가격</div>

</div>

<div className={styles['price-info-input-box']}>
<div className={styles['price-info-inputs']}>
<div className={styles['price-info-inputs__price-input-box']}>
Expand Down

0 comments on commit a9f84b3

Please sign in to comment.