update: add temp button & function for triggering success modal; add comments

This commit is contained in:
CuriousMagpie
2022-08-11 16:39:49 -04:00
parent f487837b4b
commit 0435e3537a
4 changed files with 31 additions and 12 deletions

View File

@@ -89,6 +89,7 @@
class="group-input" class="group-input"
:placeholder="'groupUseDefault'" :placeholder="'groupUseDefault'"
:value="newGroup.demographics" :value="newGroup.demographics"
@select="newGroup.demographics = $event"
/> />
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -102,6 +103,7 @@
</div> </div>
</div> </div>
<!-- PAYMENT --> <!-- PAYMENT -->
<!-- @TODO: Separate payment into a separate modal -->
<div <div
v-if="activePage === PAGES.PAY" v-if="activePage === PAGES.PAY"
class="col-12 payments" class="col-12 payments"
@@ -112,6 +114,13 @@
:amazon-data="pay(PAYMENTS.AMAZON)" :amazon-data="pay(PAYMENTS.AMAZON)"
/> />
</div> </div>
<!-- TEMPORARY BUTTON FOR TESTING -->
<button
class="btn btn-primary btn-payment"
@click="success()"
>
Clicky click click!
</button>
</div> </div>
</b-modal> </b-modal>
</template> </template>
@@ -244,7 +253,7 @@ export default {
amazonPayments: {}, amazonPayments: {},
PAGES: { PAGES: {
CREATE_GROUP: 'create-group', CREATE_GROUP: 'create-group',
UPGRADE_GROUP: 'upgrade-group', // UPGRADE_GROUP: 'upgrade-group',
PAY: 'pay', PAY: 'pay',
}, },
PAYMENTS: { PAYMENTS: {
@@ -262,18 +271,15 @@ export default {
demographics: null, demographics: null,
}, },
activePage: 'create-group', activePage: 'create-group',
type: 'guild', // Guild or Party @TODO enum this type: 'guild',
}; };
}, },
computed: { computed: {
...mapState({ user: 'user.data' }), ...mapState({ user: 'user.data' }),
newGroupIsReady () { newGroupIsReady () {
return Boolean(this.newGroup.name); return Boolean(this.newGroup.name) && Boolean(this.newGroup.demographics);
}, },
}, },
mounted () {
console.log('i am mounted');
},
methods: { methods: {
close () { close () {
this.$root.$emit('bv::hide::modal', 'create-group'); this.$root.$emit('bv::hide::modal', 'create-group');
@@ -282,9 +288,8 @@ export default {
this.activePage = page; this.activePage = page;
}, },
createGroup () { createGroup () {
console.log('i am giving habitica money now');
this.changePage(this.PAGES.PAY);
console.log(this.newGroup); console.log(this.newGroup);
this.changePage(this.PAGES.PAY);
}, },
pay (paymentMethod) { pay (paymentMethod) {
const subscriptionKey = 'group_monthly'; // @TODO: Get from content API? const subscriptionKey = 'group_monthly'; // @TODO: Get from content API?
@@ -313,9 +318,21 @@ export default {
return null; return null;
}, },
// need to figure out where/how to create the event in amplitude
// right now being sent to console in success()
sendAnalytics () {
return this.newGroup.demographics;
},
onHide () { onHide () {
this.sendingInProgress = false; this.sendingInProgress = false;
}, },
// temporary function to go with temporary button
success () {
console.log(this.sendAnalytics());
this.sendAnalytics();
this.$root.$emit('bv::hide::modal', 'create-group');
this.$root.$emit('bv::show::modal', 'payments-success-modal');
},
}, },
}; };
</script> </script>

View File

@@ -52,6 +52,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Upgrading an existing group -->
<div <div
v-if="upgradingGroup._id" v-if="upgradingGroup._id"
id="upgrading-group" id="upgrading-group"
@@ -102,6 +103,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Create a new group -->
<div <div
v-if="!upgradingGroup._id" v-if="!upgradingGroup._id"
class="container col-6 offset-3 create-option" class="container col-6 offset-3 create-option"

View File

@@ -124,14 +124,14 @@
border-bottom: none; border-bottom: none;
h2 { h2 {
color: white; color: $green-1;
} }
.check-container { .check-container {
width: 64px; width: 64px;
height: 64px; height: 64px;
border-radius: 50%; border-radius: 50%;
background: #1CA372; background: $green-1;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16px; margin-bottom: 16px;
} }
@@ -139,7 +139,7 @@
.check { .check {
width: 35.1px; width: 35.1px;
height: 28px; height: 28px;
color: white; color: $white;
} }
} }