fix: File uploads

fix: onboarding
closes #169 #166
This commit is contained in:
2024-07-11 12:04:50 +01:00
parent c1a018820f
commit 7d3f21da84
14 changed files with 97 additions and 158 deletions

View File

@ -47,6 +47,7 @@ export function StreamEditor({ ev, onFinish, options }: StreamEditorProps) {
const [goalAmount, setGoalMount] = useState(0);
const [game, setGame] = useState<GameInfo>();
const [gameId, setGameId] = useState<string>();
const [error, setError] = useState("");
const login = useLogin();
const { formatMessage } = useIntl();
const system = useContext(SnortContext);
@ -180,8 +181,9 @@ export function StreamEditor({ ev, onFinish, options }: StreamEditorProps) {
{image && <img src={image} className="mb-2 aspect-video object-cover rounded-xl" />}
<div className="flex gap-2">
<input type="text" placeholder="https://" value={image} onChange={e => setImage(e.target.value)} />
<FileUploader onResult={v => setImage(v ?? "")} />
<FileUploader onResult={v => setImage(v ?? "")} onError={e => setError(e.toString())} />
</div>
{error && <b className="text-warning">{error}</b>}
</StreamInput>
)}
{(options?.canSetStream ?? true) && (