ant-design-blazor/components/modal/modalDialog/ModalFooter.razor
zxyao 31aac9f914 refactor: unified use of FeedbackComponent for modal comfirm and drawer (#1263)
* refactor: support to use the same template for confirm and modal

* refactor: support to use the same template for drawer

* refactor: separate interface IOkCancelRef

* chore: modify EventUtil class summary

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-04-04 15:40:54 +08:00

57 lines
1.6 KiB
C#

@namespace AntDesign
@inherits AntDomComponentBase
@{
var okProps = ModalProps.OkButtonProps ?? new ButtonProps();
okProps.Type = ModalProps.OkType;
okProps.Loading = ModalProps.ConfirmLoading;
var cancelProps = ModalProps.CancelButtonProps ?? new ButtonProps();
}
<div>
<Button OnClick="@HandleOk"
Loading="@okProps.Loading"
Type="@okProps.Type"
Block="@okProps.Block"
Ghost="@okProps.Ghost"
Search="@okProps.Search"
Shape="@okProps.Shape"
Size="@okProps.Size"
Icon="@okProps.Icon"
Disabled="@okProps.Disabled"
Danger="@okProps.IsDanger">
@{
if (ModalProps.OkText.IsT0)
{
@(ModalProps.OkText.AsT0)
}
else
{
@(ModalProps.OkText.AsT1)
}
}
</Button>
<Button OnClick="@HandleCancel"
Block="@cancelProps.Block"
Ghost="@cancelProps.Ghost"
Search="@cancelProps.Search"
Loading="@cancelProps.Loading"
Type="@cancelProps.Type"
Shape="@cancelProps.Shape"
Size="@cancelProps.Size"
Icon="@cancelProps.Icon"
Disabled="@cancelProps.Disabled"
Danger="@cancelProps.IsDanger">
@{
if (ModalProps.CancelText.IsT0)
{
@(ModalProps.CancelText.AsT0)
}
else
{
@(ModalProps.CancelText.AsT1)
}
}
</Button>
</div>