Fixed padding and disable copy and paste on chat input
This commit is contained in:
parent
610beb18dd
commit
2b6b790f4a
1 changed files with 11 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue