Improve Alert component
This commit is contained in:
parent
eda134c471
commit
adf24cbd5c
|
@ -1,4 +1,5 @@
|
|||
<div class="toast @AlertTypeToClass(this.Type)" role="alert">
|
||||
<div class="toast @this.AlertTypeToClass(this.Type)" role="alert">
|
||||
@this.AlertTypeToTitle(this.Type)
|
||||
@ChildContent
|
||||
</div>
|
||||
|
||||
|
@ -20,6 +21,23 @@
|
|||
}
|
||||
}
|
||||
|
||||
private RenderFragment? AlertTypeToTitle(AlertType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case AlertType.Error:
|
||||
return @<b>Error</b>;
|
||||
case AlertType.Warning:
|
||||
return @<b>Warning</b>;
|
||||
case AlertType.Success:
|
||||
return @<b>Success</b>;
|
||||
case AlertType.Info:
|
||||
return @<b>Info</b>;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public enum AlertType
|
||||
{
|
||||
Error,
|
||||
|
|
Loading…
Reference in a new issue