Skip to content

Commit

Permalink
Merge pull request #5343 from kiva/MP-267-thanks-page-for-opted-in-users
Browse files Browse the repository at this point in the history
  • Loading branch information
christian14b authored Jun 18, 2024
2 parents c51c2a9 + 3748c49 commit 1658510
Show file tree
Hide file tree
Showing 10 changed files with 846 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .storybook/stories/AnimatedSparkles.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import AnimatedSparkles from '@/components/Thanks/AnimatedSparkles.vue';

export default {
title: 'Components/AnimatedSparkles',
component: AnimatedSparkles,
};

const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { AnimatedSparkles },
template: '<div class="tw-bg-brand"><animated-sparkles v-bind="$props" /></div>',
});

export const Default = Template.bind({});
Default.args = {
// Define your default args here. For example:
// color: 'blue',
// size: 'large',
};
7 changes: 5 additions & 2 deletions server/vue-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ module.exports = function createMiddleware({
const userAgent = req.get('user-agent');
const device = userAgent ? Bowser.getParser(userAgent).parse().parsedResult : null;

// Set the first user visit to the web
req.session.firstPage = !req.session?.firstPage ? req.url : req.session.firstPage;

const context = {
url: req.url,
config: config.app,
config: { ...config.app, firstPage: req.session?.firstPage },
cookies,
user: req.user || {},
locale: req.locale,
device
device,
};

// set html response headers
Expand Down
19 changes: 19 additions & 0 deletions src/assets/images/thanks-page/hi-five.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/images/thanks-page/paper-plane.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/components/Forms/GuestAccountCreation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ export default {
type: Array,
default: () => [],
},
eventCategory: {
type: String,
default: 'post-checkout'
},
eventLabel: {
type: String,
default: 'create-guest-account'
},
},
data() {
return {
Expand All @@ -83,7 +91,7 @@ export default {
this.serverError = false;
this.$v.$touch();
if (!this.$v.$invalid) {
this.$kvTrackEvent('post-checkout', 'click', 'create-guest-account');
this.$kvTrackEvent(this.eventCategory, 'click', this.eventLabel);
// will end up redirecting to password reset page.
this.apollo.mutate({
Expand Down
Loading

0 comments on commit 1658510

Please sign in to comment.