diff --git a/src/App.scss b/src/App.scss index f4a13ea..f529540 100644 --- a/src/App.scss +++ b/src/App.scss @@ -34,6 +34,37 @@ h1 { font-size: 1em; } + .textarea-container { + position: relative; + width: 100%; + + textarea { + width: 100%; + box-sizing: border-box; + padding: 15px; + margin-bottom: 10px; + border: 1px solid #ddd; + border-radius: 10px; + font-size: 1em; + font-family: Arial, sans-serif; + } + + .char-count-container { + position: absolute; + bottom: 8px; + right: 12px; + font-size: 12px; + color: grey; + background: white; + padding: 2px 4px; + border-radius: 4px; + } + + .max-char-count { + background-color: rgba(255, 0, 0, 0.25); + } + } + button { padding: 15px; background-color: #ff9908; diff --git a/src/components/NewPostForm.js b/src/components/NewPostForm.js index 081ab7e..3470ae2 100644 --- a/src/components/NewPostForm.js +++ b/src/components/NewPostForm.js @@ -1,6 +1,7 @@ import React, { useState } from 'react'; const NewPostForm = ({ addPost }) => { + const [title, setTitle] = useState(''); const [text, setText] = useState(''); const handleSubmit = (e) => { @@ -15,10 +16,24 @@ const NewPostForm = ({ addPost }) => {
);