Add mention support

Allow vertical resizing of inputs
This commit is contained in:
jude
2024-03-03 21:44:35 +00:00
parent 66135ecd08
commit 329492b244
11 changed files with 219 additions and 78 deletions

View File

@ -1,18 +1,28 @@
export const Title = ({ title, onInput }) => (
<>
<label class="is-sr-only" for="embedTitle">
Embed Title
</label>
<textarea
class="discord-title message-input autoresize"
placeholder="Embed Title..."
maxlength={256}
rows={1}
name="embed_title"
value={title}
onInput={(ev) => {
onInput(ev.currentTarget.value);
}}
></textarea>
</>
);
import { useParams } from "wouter";
import { useRef } from "preact/hooks";
import { useMentions } from "../../App/useMentions";
export const Title = ({ title, onInput }) => {
const input = useRef(null);
useMentions(input);
return (
<>
<label class="is-sr-only" for="embedTitle">
Embed Title
</label>
<textarea
class="discord-title message-input autoresize"
placeholder="Embed Title..."
maxlength={256}
rows={1}
ref={input}
name="embed_title"
value={title}
onInput={(ev) => {
onInput(ev.currentTarget.value);
}}
></textarea>
</>
);
};