ModalInfo.razor 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <div class="modal" tabindex="-1" role="dialog" style="display:none" id="@elementid">
  2. <div class="modal-container">
  3. <div class="modal__body">
  4. <div class="modal__body__header">
  5. <div class="modal__body__header__info">
  6. <img src="img/user.svg" alt="">
  7. <p>@Title</p>
  8. </div>
  9. </div>
  10. <div class="modal__body__container modal__body__container_noflex">
  11. <div class="modal__404__text__box">
  12. @Body
  13. <p class="modal__404__text">
  14. @((MarkupString)message)
  15. </p>
  16. </div>
  17. </div>
  18. </div>
  19. <a class="modal_close" style="cursor:pointer" @onclick="@Close">&#10006;</a>
  20. </div>
  21. </div>
  22. @code {
  23. [Inject]
  24. public IJSRuntime JsRuntime { get; set; }
  25. [Parameter]
  26. public RenderFragment Title { get; set; }
  27. [Parameter]
  28. public RenderFragment Body { get; set; }
  29. private string message = "";
  30. private string elementid = "modal_info";
  31. public void Open(string message = "")
  32. {
  33. this.message = message;
  34. JsRuntime.InvokeVoidAsync("OpenModal", elementid);
  35. }
  36. public void Close()
  37. {
  38. JsRuntime.InvokeVoidAsync("CloseModal", elementid);
  39. }
  40. }