diff --git a/Iceshrimp.Frontend/Components/PromptDialog.razor b/Iceshrimp.Frontend/Components/PromptDialog.razor index 6cc9bc06..2b8ed3f6 100644 --- a/Iceshrimp.Frontend/Components/PromptDialog.razor +++ b/Iceshrimp.Frontend/Components/PromptDialog.razor @@ -18,7 +18,7 @@ }
+ disabled="@(Required && string.IsNullOrWhiteSpace(Input))">@(ButtonText ?? Loc["Submit"])
@@ -30,6 +30,7 @@ private EventCallback Action { get; set; } private string Text { get; set; } = ""; private string Placeholder { get; set; } = ""; + private bool Required { get; set; } private bool MultiLine { get; set; } private string? ButtonText { get; set; } private string Input { get; set; } = ""; @@ -39,11 +40,12 @@ await _module.InvokeVoidAsync("closeDialog", Dialog); } - public async Task Prompt(EventCallback action, string text, string placeholder, bool multiLine = false, string? buttonText = null) + public async Task Prompt(EventCallback action, string text, string placeholder, bool allowEmpty = false, bool multiLine = false, string? buttonText = null) { Action = action; Text = text; Placeholder = placeholder; + Required = !allowEmpty; MultiLine = multiLine; ButtonText = buttonText; Input = "";