Add support for starting over on second step
This commit is contained in:
@@ -4,10 +4,11 @@ import classNames from "classnames";
|
|||||||
|
|
||||||
export type ImportBarProps = {
|
export type ImportBarProps = {
|
||||||
onSubmit: (opts: ImportOptions) => void;
|
onSubmit: (opts: ImportOptions) => void;
|
||||||
|
onStartOver: () => void;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function ImportBar({ onSubmit, loading }: ImportBarProps) {
|
export default function ImportBar({ onSubmit, loading, onStartOver }: ImportBarProps) {
|
||||||
const [formData, setFormData] = useState<ImportOptions>({ mode: 'add' });
|
const [formData, setFormData] = useState<ImportOptions>({ mode: 'add' });
|
||||||
|
|
||||||
|
|
||||||
@@ -76,6 +77,15 @@ export default function ImportBar({ onSubmit, loading }: ImportBarProps) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="field">
|
||||||
|
<div className="control">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="button is-secondary is-fullwidth"
|
||||||
|
onClick={onStartOver}>Start over again
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ export default function PrepareTransactionsPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<ImportBar loading={loading} onSubmit={handleSubmit} />
|
<ImportBar loading={loading} onSubmit={handleSubmit} onStartOver={() => location.reload()}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user