Skip to content

Commit

Permalink
Merge pull request #186 from ItRecode/fix
Browse files Browse the repository at this point in the history
fix: input placeholder ๋‘์ค„ ๋ฒ„๊ทธ ์ˆ˜์ •
  • Loading branch information
Seongtaek-H authored Feb 1, 2023
2 parents 6ef58d2 + c53d940 commit ba0ed69
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pages/DetailRecord/ReplyInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ export default function ReplyInput({
}) {
const queryClient = useQueryClient()

const screenAvailWidth = window.screen.availWidth

const [image, setImage] = useState<string>('')
const [imageFile, setImageFile] = useState<File | null>(null)
const [text, setText] = useState('')
const [inputPlaceholder, setInputPlaceholder] =
useState('๋”ฐ๋œปํ•œ ๋งˆ์Œ์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”')

const textRef = useRef<HTMLTextAreaElement>(null)

Expand Down Expand Up @@ -199,6 +203,12 @@ export default function ReplyInput({
}
}, [isAnonymousUser])

useEffect(() => {
if (screenAvailWidth > 340) {
setInputPlaceholder('๋”ฐ๋œปํ•œ ๋งˆ์Œ์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”. (100์ž ์ด๋‚ด)')
}
}, [])

return (
<>
<InputSnackBar
Expand Down Expand Up @@ -240,7 +250,7 @@ export default function ReplyInput({
required={true}
placeholder={
inputMode.mode === 'reply'
? '๋”ฐ๋œปํ•œ ๋งˆ์Œ์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”. (100์ž ์ด๋‚ด)'
? inputPlaceholder
: '๋‹ต๊ธ€ ์ถ”๊ฐ€... (100์ž ์ด๋‚ด)'
}
onInput={handleResizeHeight}
Expand All @@ -252,7 +262,7 @@ export default function ReplyInput({
/>
<button
disabled={text === ''}
className={`mb-1 cursor-pointer bg-transparent text-xs ${
className={`mb-1 cursor-pointer whitespace-nowrap bg-transparent text-xs ${
text !== '' ? 'text-primary-2' : 'text-grey-6'
}`}
>
Expand Down

0 comments on commit ba0ed69

Please sign in to comment.