Skip to content

Commit

Permalink
feat: added optional label showing and submit text on payment form
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Apr 19, 2024
1 parent 8ad471c commit 06c5da2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/forms/AddPaymentMethod.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ import { getCssVarForStripe } from "@/helpers/cssVariables";
import { useI18n } from "vue-i18n";
import BaseForm from "@/forms/BaseForm.vue";
defineProps({
showLabel: {
type: Boolean,
default: true,
},
submitText: {
type: String,
},
});
const success = ref(false);
const elementReady = ref(false);
Expand Down Expand Up @@ -182,8 +192,11 @@ const focusOnInput = () => {
"
:is-loading="form.processing || !stripeLoaded"
data-cy="add-payment-form"
:submitText="submitText"
>
<label @click="focusOnInput()">{{ $t("Add a payment method") }}</label>
<label v-if="showLabel" @click="focusOnInput()">{{
$t("Add a payment method")
}}</label>
<stripe-elements
@click="focusOnInput()"
class="input"
Expand Down

0 comments on commit 06c5da2

Please sign in to comment.