refactor: content -> articleContent 변수명 변경

This commit is contained in:
정기영 2024-07-18 14:18:04 +09:00
parent 2f69160543
commit 48df579336

View File

@ -6,12 +6,12 @@ export default function CreateArticle({ topic, title, backPath = '/' }) {
const navigate = useNavigate();
const [articleTitle, setArticleTitle] = useState('');
const [content, setContent] = useState('');
const [articleContent, setContent] = useState('');
const handleSubmit = (e) => {
e.preventDefault();
// TODO:
if (articleTitle && content) {
if (articleTitle && articleContent) {
navigate(backPath);
}
};
@ -50,7 +50,7 @@ export default function CreateArticle({ topic, title, backPath = '/' }) {
<textarea
className={styles.contentInput}
placeholder="내용을 입력하세요"
value={content}
value={articleContent}
onChange={(e) => setContent(e.target.value)}
></textarea>
</div>
@ -58,7 +58,7 @@ export default function CreateArticle({ topic, title, backPath = '/' }) {
type="button"
className={styles.button}
onClick={handleSubmit}
disabled={!articleTitle || !content}
disabled={!articleTitle || !articleContent}
>
<div>| i |</div>
<div> 쓰기</div>