-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96dd10d
commit 4eb6b97
Showing
6 changed files
with
43 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Goodtocode.Subjects.Rcl; | ||
|
||
public enum AlertTypes | ||
{ | ||
Success, | ||
Error, | ||
Info, | ||
Warning | ||
} |
21 changes: 20 additions & 1 deletion
21
src/Subjects/Presentation.Shared.Rcl/Alert/SimpleAlert.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
@using Goodtocode.Common.Extensions; | ||
|
||
<div hidden="@string.IsNullOrEmpty(Message)" class="alert alert-danger m-4" role="alert">@Message</div> | ||
<div hidden="@string.IsNullOrEmpty(Message)" class="alert m-4 @alertClass" role="alert">@Message</div> | ||
|
||
@code { | ||
[Parameter] | ||
public string Message { get; set; } | ||
Check warning on line 7 in src/Subjects/Presentation.Shared.Rcl/Alert/SimpleAlert.razor
|
||
[Parameter] | ||
public AlertTypes AlertType { get; set; } = AlertTypes.Error; | ||
|
||
private string alertClass = "alert-danger"; | ||
|
||
protected override async Task OnParametersSetAsync() | ||
Check warning on line 13 in src/Subjects/Presentation.Shared.Rcl/Alert/SimpleAlert.razor
|
||
{ | ||
switch(AlertType) | ||
{ | ||
case AlertTypes.Error: | ||
alertClass = "alert-danger"; | ||
break; | ||
case AlertTypes.Warning: | ||
alertClass = "alert-warning"; | ||
break; | ||
case AlertTypes.Info: | ||
alertClass = "alert-info"; | ||
break; | ||
case AlertTypes.Success: | ||
alertClass = "alert-success"; | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters