Desktop D3 writes in the window: push listing text, upload graphics, screenshots and previews, render jobs, catalog sync and price export, Play rollout share / halt / resume / complete and iOS phased release controls, TestFlight What to Test, internal groups and testers, reply editor with approve and send; every one a dry run, a native dialog, then the real run
This commit is contained in:
parent
a66da010ec
commit
168b5de7ce
15 changed files with 573 additions and 69 deletions
16
apps/desktop/src/ui/WriteButton.tsx
Normal file
16
apps/desktop/src/ui/WriteButton.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// A button that runs one confirm-gated write (dry run -> native dialog -> apply) and spins while it runs.
|
||||
import type { ReactNode } from 'react';
|
||||
import type { useWrite, WriteRun } from '../store';
|
||||
import { Icon, type IconName } from './icons';
|
||||
|
||||
export function WriteButton({ w, run, icon, children, primary, danger, disabled, hint, small = true }: {
|
||||
w: WriteRun; run: ReturnType<typeof useWrite>; icon: IconName; children: ReactNode; primary?: boolean; danger?: boolean; disabled?: boolean; hint?: string; small?: boolean;
|
||||
}) {
|
||||
const mine = run.isBusy(w.method, w.args);
|
||||
return (
|
||||
<button className={`btn${small ? ' btn-sm' : ''}${primary ? ' btn-primary' : ''}${danger ? ' btn-danger' : ''}`} disabled={disabled || !!run.busy} title={hint} aria-busy={mine || undefined}
|
||||
onClick={() => { run.run(w); }}>
|
||||
<Icon name={mine ? 'refresh' : icon} className={mine ? 'spin' : undefined} />{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue