Fixed padding and disable copy and paste on chat input

This commit is contained in:
Lucas Oliveira 2023-05-22 20:01:26 -03:00
commit 2b6b790f4a

View file

@ -1,6 +1,7 @@
import { LockClosedIcon, PaperAirplaneIcon } from "@heroicons/react/24/outline";
import { classNames } from "../../../utils";
import { useEffect, useRef, useState } from "react";
import { useContext, useEffect, useRef, useState } from "react";
import { TabsContext } from "../../../contexts/tabsContext";
export default function ChatInput({
lockChat,
@ -16,6 +17,8 @@ export default function ChatInput({
}
}, [chatValue]);
const { setDisableCP } = useContext(TabsContext);
return (
<div className="relative">
<textarea
@ -24,6 +27,12 @@ export default function ChatInput({
sendMessage();
}
}}
onBlur={() => {
setDisableCP(false)
}}
onFocus={() => {
setDisableCP(true)
}}
rows={1}
ref={inputRef}
disabled={lockChat}
@ -49,7 +58,7 @@ export default function ChatInput({
)}
placeholder={"Send a message..."}
/>
<div className="absolute bottom-1 right-3">
<div className="absolute bottom-0.5 right-3">
<button disabled={lockChat} onClick={() => sendMessage()}>
{lockChat ? (
<LockClosedIcon