You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.0 KiB

2 years ago
  1. <template>
  2. <modal name="delete-contact-modal" width="100%" :clickToClose="false">
  3. <div class="tw-p-[20px] md:tw-p-[30px] tw-overflow-auto">
  4. <div
  5. class="modal-header tw-flex tw-justify-between tw-w-full tw-items-center tw-mb-[30px]"
  6. >
  7. <div
  8. class="tw-grid tw-grid-cols-[24px_auto] tw-gap-[10px] tw-items-center tw-mr-[10px] md:tw-gap-[15px]"
  9. >
  10. <img src="~/assets/svg/deleteWarning.svg" alt="" />
  11. <div class="tw-text-[18px] tw-font-bold md:tw-text-[20px]">
  12. {{ $t("Delete Contact Info") }}
  13. </div>
  14. </div>
  15. <button
  16. class="close tw-transition tw-btn-md"
  17. @click="$modal.hide('delete-contact-modal')"
  18. ></button>
  19. </div>
  20. <div
  21. class="tw-text-[14px] tw-mb-[30px] md:tw-text-[16px] md:tw-mb-[40px]"
  22. >
  23. {{ `"${contactName}" ` + $t("will be removed in your list") }}
  24. </div>
  25. <div class="modal-footer tw-grid tw-grid-cols-2 tw-gap-[15px]">
  26. <button
  27. class="tw-bg-white tw-text-error-default tw-text-[16px] tw-rounded-[12px] tw-py-[10px] md:tw-text-[18px]"
  28. @click="$modal.hide('delete-contact-modal')"
  29. >
  30. {{ $t("Cancel") }}
  31. </button>
  32. <button
  33. class="tw-bg-error-default tw-text-white tw-text-[16px] tw-rounded-[12px] tw-py-[10px] md:tw-text-[18px]"
  34. @click="deleteContactInfo"
  35. >
  36. {{ $t("Delete") }}
  37. </button>
  38. </div>
  39. </div>
  40. </modal>
  41. </template>
  42. <script>
  43. export default {
  44. name: "delete-contact-modal",
  45. props: {
  46. contactId: {
  47. type: String,
  48. },
  49. contactName: {
  50. type: String,
  51. },
  52. },
  53. methods: {
  54. deleteContactInfo() {
  55. this.$axios
  56. .delete(
  57. `/member/contacts/${this.contactId}?jwt=${
  58. this.$auth.$storage.getUniversal("jwt").token
  59. }`
  60. )
  61. .then((result) => {
  62. if (result.status === 200) {
  63. this.$modal.hide("delete-contact-modal");
  64. this.$emit("update");
  65. }
  66. })
  67. .catch((err) => {
  68. console.log(err);
  69. });
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="scss" scoped>
  75. .close {
  76. // position: absolute;
  77. right: 30px;
  78. top: 32px;
  79. background-image: url("~/assets/svg/close.svg");
  80. background-position: center;
  81. background-repeat: no-repeat;
  82. background-size: cover;
  83. width: 14px;
  84. height: 14px;
  85. @media screen and (min-width: 768px) {
  86. right: 40px;
  87. top: 40px;
  88. }
  89. }
  90. .v--modal-overlay::v-deep {
  91. .v--modal {
  92. // max-width: 294px !important;
  93. width: fit-content !important;
  94. height: fit-content !important;
  95. border-radius: 16px;
  96. @media screen and (min-width: 768px) {
  97. width: fit-content !important;
  98. }
  99. }
  100. .v--modal-box {
  101. width: 294px !important;
  102. height: fit-content !important;
  103. @media screen and (min-width: 768px) {
  104. width: fit-content !important;
  105. }
  106. }
  107. .v--modal-background-click {
  108. display: flex;
  109. align-items: center;
  110. }
  111. }
  112. </style>