mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 21:00:41 +00:00
feat: refactor authentication forms to use <form> elements for better submission handling
This commit is contained in:
@@ -20,14 +20,19 @@ export default function ConfirmDialog(props: ConfirmDialogProps) {
|
||||
if (!props.open) return null;
|
||||
return (
|
||||
<div className="dialog-mask">
|
||||
<div className="dialog-card">
|
||||
<form
|
||||
className="dialog-card"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
props.onConfirm();
|
||||
}}
|
||||
>
|
||||
<h3 className="dialog-title">{props.title}</h3>
|
||||
<div className="dialog-message">{props.message}</div>
|
||||
{props.children}
|
||||
<button
|
||||
type="button"
|
||||
type="submit"
|
||||
className={`btn ${props.danger ? 'btn-danger' : 'btn-primary'} dialog-btn`}
|
||||
onClick={props.onConfirm}
|
||||
>
|
||||
<Check size={14} className="btn-icon" />
|
||||
{props.confirmText || t('txt_yes')}
|
||||
@@ -37,7 +42,7 @@ export default function ConfirmDialog(props: ConfirmDialogProps) {
|
||||
{props.cancelText || t('txt_no')}
|
||||
</button>
|
||||
{props.afterActions}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user