Skip to content

Commit

Permalink
change <Errors> to use <Modal> component and fix positioning of modal
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Sep 20, 2019
1 parent 5e102a5 commit e8e0d0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 9 additions & 7 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
v-if="loading"
v-test="'loader'" />

<Errors v-else-if="!hasValidAddress" />

<recursive-form
v-for="option in form.options"
v-else
Expand Down Expand Up @@ -248,11 +246,18 @@ export default {
if (!this.hasValidAddress) {
this.loading = false;
this.$configBus.showModal = true;
this.$configBus.modalData = {
component: Errors,
};
return;
}
this.loading = true;
await fetchAllCarriers();
if (!this.$configBus.carrierData.length) {
this.loading = true;
await fetchAllCarriers();
}
this.createForm();
this.loading = false;
},
Expand All @@ -261,9 +266,6 @@ export default {
* Hide the checkout completely.
*/
hideSelf() {
// This has to stay here until after testing
// eslint-disable-next-line no-console
console.trace('hiding delivery options');
this.showDeliveryOptions = false;
},
Expand Down
5 changes: 0 additions & 5 deletions src/assets/scss/_modal.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
.#{$classBase} {
&__modal {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
padding: $modal-content-padding;
background-color: white;

Expand Down
3 changes: 3 additions & 0 deletions src/components/Errors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export default {
// Send the new values in an event. It's up to the external platform to do handle this event or not.
document.dispatchEvent(new CustomEvent(EVENTS.UPDATED_ADDRESS, { detail: this.values }));
// Hide the modal
this.$configBus.showModal = false;
},
},
};
Expand Down

0 comments on commit e8e0d0d

Please sign in to comment.