Browse Source

Changed currentStep to boolean

pull/143/head
Jose Olarte III 5 days ago
parent
commit
ea49173885
  1. 20
      src/components/GiftedDialog.vue

20
src/components/GiftedDialog.vue

@ -2,7 +2,7 @@
<div v-if="visible" class="dialog-overlay"> <div v-if="visible" class="dialog-overlay">
<div class="dialog"> <div class="dialog">
<!-- Step 1: Giver --> <!-- Step 1: Giver -->
<div v-show="currentStep === 1" id="sectionGiftedGiver"> <div v-show="firstStep" id="sectionGiftedGiver">
<label class="block font-bold mb-4"> <label class="block font-bold mb-4">
{{ {{
stepType === "recipient" stepType === "recipient"
@ -219,7 +219,7 @@
</div> </div>
<!-- Step 2: Gift --> <!-- Step 2: Gift -->
<div v-show="currentStep === 2" id="sectionGiftedGift"> <div v-show="!firstStep" id="sectionGiftedGift">
<div class="grid grid-cols-2 gap-2 mb-4"> <div class="grid grid-cols-2 gap-2 mb-4">
<!-- Giver Button --> <!-- Giver Button -->
<button <button
@ -558,13 +558,13 @@ export default class GiftedDialog extends Vue {
callbackOnSuccess?: (amount: number) => void = () => {}; callbackOnSuccess?: (amount: number) => void = () => {};
customTitle?: string; customTitle?: string;
description = ""; description = "";
firstStep = true;
giver?: libsUtil.GiverReceiverInputInfo; // undefined means no identified giver agent giver?: libsUtil.GiverReceiverInputInfo; // undefined means no identified giver agent
offerId = ""; offerId = "";
prompt = ""; prompt = "";
receiver?: libsUtil.GiverReceiverInputInfo; receiver?: libsUtil.GiverReceiverInputInfo;
unitCode = "HUR"; unitCode = "HUR";
visible = false; visible = false;
currentStep = 1;
libsUtil = libsUtil; libsUtil = libsUtil;
@ -657,7 +657,7 @@ export default class GiftedDialog extends Vue {
this.amountInput = "0"; this.amountInput = "0";
this.callbackOnSuccess = callbackOnSuccess; this.callbackOnSuccess = callbackOnSuccess;
this.offerId = offerId || ""; this.offerId = offerId || "";
this.currentStep = giver ? 2 : 1; this.firstStep = !giver;
this.stepType = "giver"; this.stepType = "giver";
// Update entity types based on current props // Update entity types based on current props
@ -751,7 +751,7 @@ export default class GiftedDialog extends Vue {
this.amountInput = "0"; this.amountInput = "0";
this.prompt = ""; this.prompt = "";
this.unitCode = "HUR"; this.unitCode = "HUR";
this.currentStep = 1; this.firstStep = true;
} }
async confirm() { async confirm() {
@ -959,12 +959,12 @@ export default class GiftedDialog extends Vue {
name: "", name: "",
}; };
} }
this.currentStep = 2; this.firstStep = false;
} }
goBackToStep1(step: string) { goBackToStep1(step: string) {
this.stepType = step; this.stepType = step;
this.currentStep = 1; this.firstStep = true;
} }
async loadProjects() { async loadProjects() {
@ -1007,7 +1007,7 @@ export default class GiftedDialog extends Vue {
did: this.activeDid, did: this.activeDid,
name: "You", name: "You",
}; };
this.currentStep = 2; this.firstStep = false;
} }
selectRecipient(contact?: Contact) { selectRecipient(contact?: Contact) {
@ -1022,7 +1022,7 @@ export default class GiftedDialog extends Vue {
name: "", name: "",
}; };
} }
this.currentStep = 2; this.firstStep = false;
} }
selectRecipientProject(project: PlanData) { selectRecipientProject(project: PlanData) {
@ -1032,7 +1032,7 @@ export default class GiftedDialog extends Vue {
image: project.image, image: project.image,
handleId: project.handleId, handleId: project.handleId,
}; };
this.currentStep = 2; this.firstStep = false;
} }
// Computed property for the query parameters // Computed property for the query parameters

Loading…
Cancel
Save