отладка прикрепления файлов
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { Paperclip } from "lucide-react";
|
||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
|
|
||||||
import { ApiError } from "../api/client";
|
import { ApiError } from "../api/client";
|
||||||
@@ -81,15 +82,16 @@ export function MatchMedia({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{editable && (
|
{editable && !full && (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
className="btn small"
|
className="btn small"
|
||||||
style={{ marginTop: 8 }}
|
style={{ marginTop: 8, gap: 6 }}
|
||||||
onClick={() => fileRef.current?.click()}
|
onClick={() => fileRef.current?.click()}
|
||||||
disabled={pending || full}
|
disabled={pending}
|
||||||
>
|
>
|
||||||
{full ? `Максимум ${max} фото` : "Добавить фото"}
|
<Paperclip size={16} />
|
||||||
|
Прикрепить медиа
|
||||||
</button>
|
</button>
|
||||||
<input
|
<input
|
||||||
ref={fileRef}
|
ref={fileRef}
|
||||||
|
|||||||
@@ -201,18 +201,21 @@ export function MatchDetailPage() {
|
|||||||
|
|
||||||
<div className="field">
|
<div className="field">
|
||||||
<label className="label">Комментарий о партии</label>
|
<label className="label">Комментарий о партии</label>
|
||||||
<textarea rows={2} value={overall} onChange={(e) => setOverall(e.target.value)} />
|
<textarea
|
||||||
</div>
|
rows={2}
|
||||||
|
style={{ resize: "none" }}
|
||||||
<div className="field">
|
value={overall}
|
||||||
<label className="label">Фото партии (до 10)</label>
|
onChange={(e) => setOverall(e.target.value)}
|
||||||
<MatchMedia
|
|
||||||
attachments={match.attachments}
|
|
||||||
editable
|
|
||||||
onUpload={(f) => uploadAtt.mutateAsync(f)}
|
|
||||||
onDelete={(aid) => deleteAtt.mutateAsync(aid)}
|
|
||||||
pending={uploadAtt.isPending || deleteAtt.isPending}
|
|
||||||
/>
|
/>
|
||||||
|
<div style={{ marginTop: 8 }}>
|
||||||
|
<MatchMedia
|
||||||
|
attachments={match.attachments}
|
||||||
|
editable
|
||||||
|
onUpload={(f) => uploadAtt.mutateAsync(f)}
|
||||||
|
onDelete={(aid) => deleteAtt.mutateAsync(aid)}
|
||||||
|
pending={uploadAtt.isPending || deleteAtt.isPending}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{error && <p className="error-text">{error}</p>}
|
{error && <p className="error-text">{error}</p>}
|
||||||
|
|||||||
@@ -158,18 +158,21 @@ export function AdminMatchEdit({ matchId, onClose }: { matchId: number; onClose:
|
|||||||
|
|
||||||
<div className="field">
|
<div className="field">
|
||||||
<label className="label">Комментарий о партии</label>
|
<label className="label">Комментарий о партии</label>
|
||||||
<textarea rows={2} value={overall} onChange={(e) => setOverall(e.target.value)} />
|
<textarea
|
||||||
</div>
|
rows={2}
|
||||||
|
style={{ resize: "none" }}
|
||||||
<div className="field">
|
value={overall}
|
||||||
<label className="label">Медиа (до 10)</label>
|
onChange={(e) => setOverall(e.target.value)}
|
||||||
<MatchMedia
|
|
||||||
attachments={attachments ?? []}
|
|
||||||
editable
|
|
||||||
onUpload={(f) => uploadAtt.mutateAsync(f)}
|
|
||||||
onDelete={(aid) => deleteAtt.mutateAsync(aid)}
|
|
||||||
pending={uploadAtt.isPending || deleteAtt.isPending}
|
|
||||||
/>
|
/>
|
||||||
|
<div style={{ marginTop: 8 }}>
|
||||||
|
<MatchMedia
|
||||||
|
attachments={attachments ?? []}
|
||||||
|
editable
|
||||||
|
onUpload={(f) => uploadAtt.mutateAsync(f)}
|
||||||
|
onDelete={(aid) => deleteAtt.mutateAsync(aid)}
|
||||||
|
pending={uploadAtt.isPending || deleteAtt.isPending}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{error && <p className="error-text">{error}</p>}
|
{error && <p className="error-text">{error}</p>}
|
||||||
|
|||||||
Reference in New Issue
Block a user