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