PaystackPaymentDialog.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <ui-dialog
  3. class="ng-paystack-payment-dialog"
  4. :title="title"
  5. width="460px"
  6. top="0"
  7. :visible="visible"
  8. :close-on-click-modal="false"
  9. :show-close="!loading"
  10. v-bind="$attrs"
  11. v-on="$listeners"
  12. >
  13. <p class="ng-paystack-payment-note">{{ note }}</p>
  14. <div class="ng-paystack-payment-amount">
  15. <span>Amount</span>
  16. <strong>{{ currency }} {{ amount | toThousandFilter }}</strong>
  17. </div>
  18. <div class="ng-paystack-payment-trigger"><slot /></div>
  19. <el-button
  20. class="ng-paystack-payment-continue"
  21. type="primary"
  22. native-type="button"
  23. :disabled="loading || !visible"
  24. @click="$emit('continue')"
  25. >
  26. {{ continueLabel }}
  27. </el-button>
  28. <template slot="footer"><span /></template>
  29. </ui-dialog>
  30. </template>
  31. <script>
  32. import UiDialog from './UiDialog.vue'
  33. import { toThousandFilter } from '@/filters'
  34. export default {
  35. name: 'PaystackPaymentDialog',
  36. components: { UiDialog },
  37. filters: { toThousandFilter },
  38. inheritAttrs: false,
  39. props: {
  40. visible: { type: Boolean, default: false },
  41. title: { type: String, default: 'Paystack Payment' },
  42. note: {
  43. type: String,
  44. default: 'Continue to the Paystack secure checkout.'
  45. },
  46. continueLabel: { type: String, default: 'Continue to Paystack' },
  47. amount: { type: [Number, String], default: 0 },
  48. currency: { type: String, default: '' },
  49. loading: { type: Boolean, default: false }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .ng-paystack-payment-dialog {
  55. display: flex;
  56. padding: 16px;
  57. }
  58. .ng-paystack-payment-dialog ::v-deep .el-dialog {
  59. flex-shrink: 0;
  60. max-width: 100%;
  61. margin: auto !important;
  62. border-radius: 14px;
  63. }
  64. .ng-paystack-payment-dialog ::v-deep .el-dialog__header {
  65. padding: 24px 40px 0 24px;
  66. }
  67. .ng-paystack-payment-dialog ::v-deep .el-dialog__title {
  68. color: #25292c;
  69. font-size: 24px;
  70. font-weight: 700;
  71. line-height: 1.3;
  72. }
  73. .ng-paystack-payment-dialog ::v-deep .el-dialog__headerbtn {
  74. top: 16px;
  75. right: 16px;
  76. }
  77. .ng-paystack-payment-dialog ::v-deep .el-dialog__body {
  78. padding: 10px 24px 24px;
  79. }
  80. .ng-paystack-payment-dialog ::v-deep .el-dialog__footer,
  81. .ng-paystack-payment-trigger {
  82. display: none;
  83. }
  84. .ng-paystack-payment-note {
  85. margin: 0 0 16px;
  86. color: #6b737a;
  87. font-size: 14px;
  88. line-height: 1.5;
  89. word-break: normal;
  90. overflow-wrap: break-word;
  91. }
  92. .ng-paystack-payment-amount {
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. gap: 8px 16px;
  97. margin: 16px 0;
  98. padding: 12px 16px;
  99. border-radius: 8px;
  100. background: #f8f9fa;
  101. color: #6b737a;
  102. font-size: 14px;
  103. line-height: 1.5;
  104. }
  105. .ng-paystack-payment-amount strong {
  106. min-width: 0;
  107. color: #1f6b3f;
  108. font-size: 18px;
  109. font-variant-numeric: tabular-nums;
  110. text-align: right;
  111. overflow-wrap: anywhere;
  112. }
  113. .ng-paystack-payment-continue.el-button--primary {
  114. width: 100%;
  115. min-height: 50px;
  116. padding: 14px 16px;
  117. border-radius: 8px;
  118. font-size: 16px;
  119. font-weight: 700;
  120. line-height: 1.4;
  121. white-space: normal;
  122. }
  123. @media (max-width: 480px) {
  124. .ng-paystack-payment-dialog ::v-deep .el-dialog__title {
  125. font-size: 22px;
  126. }
  127. }
  128. </style>