procurement: prepend added items and links
This commit is contained in:
parent
f238d9457a
commit
b974c09aca
@ -1324,7 +1324,7 @@ export default function ProcurementPage() {
|
||||
<span className="app-text-muted text-xs font-medium">Ссылки</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => updateItemRow(idx, { links: [...it.links, ""] })}
|
||||
onClick={() => updateItemRow(idx, { links: ["", ...it.links] })}
|
||||
className="app-link-accent inline-flex items-center gap-1 text-xs font-medium"
|
||||
>
|
||||
<Plus size={12} /> Добавить ссылку
|
||||
|
||||
@ -213,7 +213,7 @@ function ProcurementItemCard({
|
||||
))}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => updateDraft({ links: [...draft.links, ""] })}
|
||||
onClick={() => updateDraft({ links: ["", ...draft.links] })}
|
||||
className="app-link-accent inline-flex items-center gap-1 text-xs font-medium"
|
||||
>
|
||||
<Plus size={12} /> Добавить ссылку
|
||||
|
||||
@ -742,7 +742,7 @@ export function useProcurementPage(user: User | null) {
|
||||
}, []);
|
||||
|
||||
const addItemRow = useCallback(() => {
|
||||
setForm((previous) => ({ ...previous, items: [...previous.items, { ...emptyItem }] }));
|
||||
setForm((previous) => ({ ...previous, items: [{ ...emptyItem }, ...previous.items] }));
|
||||
}, []);
|
||||
|
||||
const removeItemRow = useCallback((index: number) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user