diff --git a/frontend/src/intake/Submit.tsx b/frontend/src/intake/Submit.tsx index 2151898..c1332c7 100644 --- a/frontend/src/intake/Submit.tsx +++ b/frontend/src/intake/Submit.tsx @@ -8,6 +8,7 @@ import Input from 'antd/es/input'; import Alert from 'antd/es/alert'; import Spin from 'antd/es/spin'; import Space from 'antd/es/space'; +import Checkbox from 'antd/es/checkbox'; import { UploadOutlined } from '@ant-design/icons'; import type { UploadFile } from 'antd/es/upload/interface'; import { fetchIntakeLink, submitItem } from './intakeApi'; @@ -33,6 +34,10 @@ export default function Submit() { const [checking, setChecking] = useState(true); const [files, setFiles] = useState([]); const [note, setNote] = useState(''); + // Ticked by default. Most items look better cut out, and a submitter who + // wants their kitchen table in the photograph can say so — the reverse + // default would mean almost nobody got it. + const [removeBackground, setRemoveBackground] = useState(true); const [sending, setSending] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(null); @@ -62,7 +67,8 @@ export default function Submit() { // rather than map-then-filter because a type predicate cannot narrow to // File here — antd's RcFile extends it, so the predicate would widen. files.flatMap((f) => (f.originFileObj ? [f.originFileObj] : [])), - note + note, + removeBackground ); setSending(false); @@ -129,6 +135,7 @@ export default function Submit() { onClick={() => { setFiles([]); setNote(''); + setRemoveBackground(true); setSent(false); }} > @@ -171,6 +178,17 @@ export default function Submit() { placeholder="What is it, what is it made of, how big, what condition, where did it come from? Anything you know helps — a photo cannot show any of it." /> + {state.kind === 'usable' && state.link.backgroundRemoval && ( + setRemoveBackground(e.target.checked)} + > + {/* Described by what it does, not by how. Nobody sending in a + vase knows what a cut-out or an alpha channel is. */} + Remove the background from my photos + + )} + {error && }