Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ circle:nth-child(3) {

.compose {
display: flex;
align-items: flex-end;
flex-shrink: 0;
margin-top: 16px;
padding: 24px;
Expand All @@ -55,9 +56,10 @@ circle:nth-child(3) {
display: flex;
flex-grow: 1;
margin-right: 16px;
align-items: flex-end;
}

.compose input {
.compose textarea {
border: 1px solid #eeeeee;
width: 100%;
padding: 12px;
Expand Down Expand Up @@ -220,16 +222,8 @@ iframe {
}
}








/* loader */


.loader {
--dim: 3rem;
width: var(--dim);
Expand Down Expand Up @@ -273,19 +267,23 @@ iframe {
transform: scale(1) rotate(0);
}

20%, 25% {
20%,
25% {
transform: scale(1.3) rotate(90deg);
}

45%, 50% {
45%,
50% {
transform: scale(1) rotate(180deg);
}

70%, 75% {
70%,
75% {
transform: scale(1.3) rotate(270deg);
}

95%, 100% {
95%,
100% {
transform: scale(1) rotate(360deg);
}
}
}
21 changes: 19 additions & 2 deletions src/Components/ChatPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const ChatPage = ({ darkMode, setDarkMode }) => {
isTyping: false,
data: "",
});
const [textareaHeight, setTextareaHeight] = useState("3rem");

const toggleMenu = () => {
setIsMenuOpen(!isMenuOpen);
Expand Down Expand Up @@ -172,6 +173,14 @@ const ChatPage = ({ darkMode, setDarkMode }) => {
}, [500]);
};

const handleTextareaResize = (event) => {
const { scrollHeight, clientHeight } = event.target;

// Ensure the textarea doesn't exceed maxHeight
const newHeight = Math.min(10 * clientHeight, scrollHeight);
setTextareaHeight(`${newHeight}px`);
};

const handleSendLocation = () => {
if (!navigator.geolocation) {
return alert("Geolocation is not supported by your browser.");
Expand Down Expand Up @@ -411,14 +420,22 @@ const ChatPage = ({ darkMode, setDarkMode }) => {
className="flex items-center"
onSubmit={handleSubmit}
>
<input
<textarea
name="message"
placeholder="Message"
className="rounded-lg"
value={inputMessage}
onChange={handleTyping}
required
onInput={handleTextareaResize}
style={{
resize: "none",
minHeight: "1.5rem",
maxHeight: "10rem",
height: textareaHeight,
overflowY: "auto",
}}
/>

{!micHide && (
<FaMicrophone
size={40}
Expand Down