Skip to content

Commit

Permalink
chore: #11 props name 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
leeminhee119 committed Jul 17, 2024
1 parent 2db2be1 commit 2f049af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/test/Staging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export default function Staging() {
<br />
<InputLabelContainer id={"retro"}>
<Label order={1}>회고 이름</Label>
<Input onChange={handleChangeName} value={layerName} maxLength={10} wordCount />
<Input onChange={handleChangeName} value={layerName} maxLength={10} count />
</InputLabelContainer>

<InputLabelContainer id={"description"}>
<Label>한 줄 설명</Label>
<TextArea onChange={handleChangeDescription} value={description} maxLength={20} wordCount />
<TextArea onChange={handleChangeDescription} value={description} maxLength={20} count />
</InputLabelContainer>

<ButtonProvider>
Expand Down
6 changes: 3 additions & 3 deletions src/component/common/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ type InputProps = {
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
width?: string;
wordCount?: boolean;
count?: boolean;
} & React.InputHTMLAttributes<HTMLInputElement>;

export const Input = forwardRef(function ({ id, width = "100%", wordCount, ...props }: InputProps) {
export const Input = forwardRef(function ({ id, width = "100%", count, ...props }: InputProps) {
const { maxLength, value } = props;
const inputContext = useContext(InputContext);
return (
Expand All @@ -34,7 +34,7 @@ export const Input = forwardRef(function ({ id, width = "100%", wordCount, ...pr
{...props}
/>
{/* FIXME - typography 컬러 넣기 !! */}
{wordCount && maxLength && <Typography variant="CAPTION" color={"lightGrey"}>{`${value.length}/${maxLength}`}</Typography>}
{count && maxLength && <Typography variant="CAPTION" color={"lightGrey"}>{`${value.length}/${maxLength}`}</Typography>}
</div>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/component/common/input/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ type TextAreaProps = {
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
width?: string;
height?: string;
wordCount?: boolean;
count?: boolean;
} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;

export const TextArea = forwardRef(function ({ id, width = "100%", height = "4.8rem", wordCount, ...props }: TextAreaProps) {
export const TextArea = forwardRef(function ({ id, width = "100%", height = "4.8rem", count, ...props }: TextAreaProps) {
const { maxLength, value } = props;
const textareaContext = useContext(InputContext);
return (
Expand All @@ -36,7 +36,7 @@ export const TextArea = forwardRef(function ({ id, width = "100%", height = "4.8
`}
{...props}
/>
{wordCount && maxLength && (
{count && maxLength && (
<div
css={css`
align-self: flex-end;
Expand Down

0 comments on commit 2f049af

Please sign in to comment.