| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <ui-dialog
- class="ng-paystack-payment-dialog"
- :title="title"
- width="460px"
- top="0"
- :visible="visible"
- :close-on-click-modal="false"
- :show-close="!loading"
- v-bind="$attrs"
- v-on="$listeners"
- >
- <p class="ng-paystack-payment-note">{{ note }}</p>
- <el-form
- v-loading="loading"
- class="ng-paystack-payment-form"
- label-position="top"
- :disabled="loading"
- @submit.native.prevent
- >
- <el-form-item label="Email" for="ng-paystack-payment-email">
- <el-input
- id="ng-paystack-payment-email"
- :value="email"
- :readonly="readonlyEmail"
- @input="$emit('update:email', $event)"
- />
- </el-form-item>
- </el-form>
- <div class="ng-paystack-payment-amount">
- <span>Amount</span>
- <strong>{{ currency }} {{ amount | toThousandFilter }}</strong>
- </div>
- <div class="ng-paystack-payment-trigger"><slot /></div>
- <el-button
- class="ng-paystack-payment-continue"
- type="primary"
- native-type="button"
- :disabled="loading || !visible"
- @click="$emit('continue')"
- >
- {{ continueLabel }}
- </el-button>
- <template slot="footer"><span /></template>
- </ui-dialog>
- </template>
- <script>
- import UiDialog from './UiDialog.vue'
- import { toThousandFilter } from '@/filters'
- export default {
- name: 'PaystackPaymentDialog',
- components: { UiDialog },
- filters: { toThousandFilter },
- inheritAttrs: false,
- props: {
- visible: { type: Boolean, default: false },
- title: { type: String, default: 'Paystack Payment' },
- note: {
- type: String,
- default: 'Confirm your email to continue to the Paystack secure checkout.'
- },
- continueLabel: { type: String, default: 'Continue to Paystack' },
- email: { type: String, default: '' },
- amount: { type: [Number, String], default: 0 },
- currency: { type: String, default: '' },
- readonlyEmail: { type: Boolean, default: false },
- loading: { type: Boolean, default: false }
- }
- }
- </script>
- <style lang="scss" scoped>
- .ng-paystack-payment-dialog {
- display: flex;
- padding: 16px;
- }
- .ng-paystack-payment-dialog ::v-deep .el-dialog {
- flex-shrink: 0;
- max-width: 100%;
- margin: auto !important;
- border-radius: 14px;
- }
- .ng-paystack-payment-dialog ::v-deep .el-dialog__header {
- padding: 24px 40px 0 24px;
- }
- .ng-paystack-payment-dialog ::v-deep .el-dialog__title {
- color: #25292c;
- font-size: 24px;
- font-weight: 700;
- line-height: 1.3;
- }
- .ng-paystack-payment-dialog ::v-deep .el-dialog__headerbtn {
- top: 16px;
- right: 16px;
- }
- .ng-paystack-payment-dialog ::v-deep .el-dialog__body {
- padding: 10px 24px 24px;
- }
- .ng-paystack-payment-dialog ::v-deep .el-dialog__footer,
- .ng-paystack-payment-trigger {
- display: none;
- }
- .ng-paystack-payment-note {
- margin: 0 0 16px;
- color: #6b737a;
- font-size: 14px;
- line-height: 1.5;
- word-break: normal;
- overflow-wrap: break-word;
- }
- .ng-paystack-payment-form ::v-deep .el-form-item {
- margin-bottom: 0;
- }
- .ng-paystack-payment-form ::v-deep .el-form-item__label {
- padding-bottom: 8px;
- color: #25292c;
- line-height: 1.5;
- }
- .ng-paystack-payment-form ::v-deep .el-input__inner {
- height: 54px;
- border-radius: 8px;
- font-size: 16px;
- line-height: 54px;
- }
- .ng-paystack-payment-amount {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px 16px;
- margin: 16px 0;
- padding: 12px 16px;
- border-radius: 8px;
- background: #f8f9fa;
- color: #6b737a;
- font-size: 14px;
- line-height: 1.5;
- }
- .ng-paystack-payment-amount strong {
- min-width: 0;
- color: #1f6b3f;
- font-size: 18px;
- font-variant-numeric: tabular-nums;
- text-align: right;
- overflow-wrap: anywhere;
- }
- .ng-paystack-payment-continue.el-button--primary {
- width: 100%;
- min-height: 50px;
- padding: 14px 16px;
- border-radius: 8px;
- font-size: 16px;
- font-weight: 700;
- line-height: 1.4;
- white-space: normal;
- }
- @media (max-width: 480px) {
- .ng-paystack-payment-dialog ::v-deep .el-dialog__title {
- font-size: 22px;
- }
- }
- </style>
|