SignupDialogs.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="ng-signup-dialogs">
  3. <paystack-payment-dialog
  4. :visible="paymentVisible"
  5. :email="paymentEmail"
  6. :amount="paymentOrder.amount"
  7. :currency="paymentOrder.currency"
  8. readonly-email
  9. :before-close="cancelPayment"
  10. @continue="$refs.paystack.payWithPaystack()"
  11. >
  12. <guest-paystack
  13. v-if="paymentVisible"
  14. ref="paystack"
  15. :access-code="paymentOrder.accessCode"
  16. :reference="paymentOrder.reference"
  17. :amount="Number(paymentOrder.amount)"
  18. :currency="paymentOrder.currency"
  19. :email="paymentEmail"
  20. :paystackkey="paystackKey"
  21. :callback="paid"
  22. :close="cancelPayment"
  23. @error="$emit('payment-error', $event)"
  24. />
  25. </paystack-payment-dialog>
  26. <product-details-dialog
  27. :show-sales-price="false"
  28. :visible="productVisible"
  29. :product="product"
  30. :currency="currency"
  31. @update:visible="$emit('close-product')"
  32. />
  33. </div>
  34. </template>
  35. <script>
  36. import ProductDetailsDialog from '@/ui-refactor/components/ProductDetailsDialog.vue'
  37. import GuestPaystack from './GuestPaystack'
  38. import PaystackPaymentDialog from '@/ui-refactor/components/PaystackPaymentDialog.vue'
  39. export default {
  40. name: 'SignupDialogs',
  41. components: { GuestPaystack, ProductDetailsDialog, PaystackPaymentDialog },
  42. props: {
  43. paymentVisible: { type: Boolean, default: false },
  44. paymentOrder: { type: Object, required: true },
  45. paymentEmail: { type: String, default: '' },
  46. productVisible: { type: Boolean, default: false },
  47. product: { type: Object, required: true },
  48. currency: { type: String, default: '' }
  49. },
  50. data() {
  51. return { paystackKey: process.env.VUE_APP_BASE_PAY_STACK_PUBLIC_KEY || '' }
  52. },
  53. methods: {
  54. cancelPayment() {
  55. this.$emit('cancel-payment')
  56. },
  57. paid(response) {
  58. this.$emit('paid', response)
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .ng-public-layout .ng-signup-dialogs ::v-deep .el-dialog {
  65. max-width: calc(100% - 32px);
  66. }
  67. .ng-public-layout .ng-signup-dialogs ::v-deep .el-dialog__title {
  68. overflow-wrap: anywhere;
  69. }
  70. .ng-public-layout .ng-signup-dialogs ::v-deep .el-dialog__body {
  71. padding: 24px;
  72. }
  73. @media (max-width: 767px) {
  74. .ng-public-layout .ng-signup-dialogs ::v-deep .el-dialog__body {
  75. padding: 16px;
  76. }
  77. }
  78. </style>