This commit is contained in:
parent
e3ce3c90c7
commit
2a78d49bb0
1 changed files with 2 additions and 4 deletions
|
@ -3,12 +3,11 @@
|
||||||
import { useRef, useEffect, useLayoutEffect } from 'react';
|
import { useRef, useEffect, useLayoutEffect } from 'react';
|
||||||
import { useSearchParams } from 'next/navigation';
|
import { useSearchParams } from 'next/navigation';
|
||||||
|
|
||||||
import comic_sans from '../../../../comic.ts';
|
|
||||||
import { message_style } from '../components/Input.css';
|
import { message_style } from '../components/Input.css';
|
||||||
|
|
||||||
export default function Input() {
|
export default function Input() {
|
||||||
const search_params = useSearchParams();
|
const search_params = useSearchParams();
|
||||||
const input_ref = useRef<HTMLParagraphElement>(null);
|
const input_ref = useRef<HTMLTextAreaElement | null>(null);
|
||||||
|
|
||||||
function set_message(message: string) {
|
function set_message(message: string) {
|
||||||
const encoded = btoa(message);
|
const encoded = btoa(message);
|
||||||
|
@ -46,8 +45,7 @@ export default function Input() {
|
||||||
<textarea
|
<textarea
|
||||||
ref={input_ref}
|
ref={input_ref}
|
||||||
className={message_style}
|
className={message_style}
|
||||||
type="text"
|
rows={1}
|
||||||
rows="1"
|
|
||||||
onInput={() => set_message(input_ref.current!.textContent ?? '')}
|
onInput={() => set_message(input_ref.current!.textContent ?? '')}
|
||||||
defaultValue={message}
|
defaultValue={message}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue