add auto select to the paste input and added a placeholder to the input
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m3s
Publish Docker Image / docker (ubuntu-latest) (push) Successful in 53s

This commit is contained in:
Lee 2024-04-24 18:42:42 +01:00
parent d50242b96e
commit 71e913092e

@ -1,6 +1,6 @@
"use client"; "use client";
import { ReactElement, useState } from "react"; import { ReactElement, useEffect, useState } from "react";
import { ActionMenu } from "@/app/components/action-menu"; import { ActionMenu } from "@/app/components/action-menu";
import { Button } from "@/app/components/ui/button"; import { Button } from "@/app/components/ui/button";
import { useToast } from "@/app/components/ui/use-toast"; import { useToast } from "@/app/components/ui/use-toast";
@ -52,6 +52,10 @@ export default function Home(): ReactElement {
window.location.href = `/${data.id}`; window.location.href = `/${data.id}`;
} }
useEffect(() => {
document.getElementById("paste-input")?.focus();
}, []);
return ( return (
<div className="p-3 h-screen w-screen relative"> <div className="p-3 h-screen w-screen relative">
<div className="flex gap-2 h-full w-full text-xs"> <div className="flex gap-2 h-full w-full text-xs">
@ -63,7 +67,9 @@ export default function Home(): ReactElement {
onInput={(event) => { onInput={(event) => {
setValue((event.target as HTMLTextAreaElement).value); setValue((event.target as HTMLTextAreaElement).value);
}} }}
id="paste-input"
className="w-full h-full bg-background outline-none resize-none" className="w-full h-full bg-background outline-none resize-none"
placeholder="Paste your code here..."
/> />
</div> </div>