update upload page
All checks were successful
CI / Maven unit tests (push) Successful in 13s
CI / Build and push images (push) Has been skipped
CI / Deploy to server (push) Has been skipped

This commit is contained in:
2026-08-16 15:15:42 +01:00
parent a2e45a712b
commit 20693df628
3 changed files with 35 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
import clsx from "clsx"; import clsx from "clsx";
import React from "react";
type Props = { type Props = {
children: React.ReactNode; children: React.ReactNode;
@@ -6,7 +7,7 @@ type Props = {
}; };
const Box = ({ children, className }: Props) => ( const Box = ({ children, className }: Props) => (
<div className={clsx("bg-white border border-gray-200 shadow-sm rounded-lg", className)}> <div className={clsx("bg-card border-hairline shadow-sm rounded-lg", className)}>
{children} {children}
</div> </div>
); );

View File

@@ -10,6 +10,7 @@
--color-sidebar: #F2EEE6; --color-sidebar: #F2EEE6;
--color-card: #FDFBF7; --color-card: #FDFBF7;
--color-fields: #F4F0E8; --color-fields: #F4F0E8;
--color-dropzone: #F9F6EF;
/* ── Ink ─────────────────────────────────────────────────────────────── */ /* ── Ink ─────────────────────────────────────────────────────────────── */
--color-text-primary: #2B2620; --color-text-primary: #2B2620;

View File

@@ -1,12 +1,11 @@
import {useState} from "react"; import {useState} from "react";
import {useNavigate} from "react-router-dom"; import {useNavigate} from "react-router-dom";
import BlueButton from "../components/buttons/BlueButton.tsx";
import Box from "../components/Box.tsx"; import Box from "../components/Box.tsx";
const ClipUpload = () => { const ClipUpload = () => {
const [file, setFile] = useState<File | null>(null); const [file, setFile] = useState<File | null>(null);
const navigate = useNavigate();
const [error, setError] = useState<null | string>(null); const [error, setError] = useState<null | string>(null);
const navigate = useNavigate();
const press = () => { const press = () => {
if (!file) { if (!file) {
@@ -17,10 +16,17 @@ const ClipUpload = () => {
}; };
return ( return (
<div className="flex items-start justify-center p-8 min-h-full"> <div className="flex justify-center p-8">
<Box className="flex flex-col gap-4 p-6 w-full max-w-md"> <Box className="flex flex-col gap-4 p-6 w-full max-w-md">
<h1 className="text-lg font-semibold text-gray-900">Upload Clip</h1> <div
className="cursor-pointer rounded-lg border-2
border-dashed border-hairline bg-dropzone
p-4 text-center text-sm text-text-secondary
hover:bg-hover transition-colors duration-150
min-h-50 flex flex-col items-center justify-center gap-2"
>
<label className="cursor-pointer block">
Choose file
<input <input
type="file" type="file"
onChange={(e) => { onChange={(e) => {
@@ -28,12 +34,22 @@ const ClipUpload = () => {
setFile(selected); setFile(selected);
setError(null); setError(null);
}} }}
className="h-36 cursor-pointer rounded-lg border-2 border-dashed border-gray-300 bg-gray-50 p-4 text-center text-sm text-gray-500 hover:bg-gray-100 hover:border-primary transition-colors duration-150" className="hidden"
/> />
</label>
{file && (
<p className="mt-2 text-xs text-text-secondary">{file.name}</p>
)}
</div>
<BlueButton onClick={press}>Upload</BlueButton> <button
onClick={press}
className={"hover:bg-hover p-1 rounded-md"}
>
Upload
</button>
{error && <p className="text-sm text-red-500 text-center">{error}</p>} {error && <p className="text-sm font-body text-center">{error}</p>}
</Box> </Box>
</div> </div>
) )