From bbbdff6c60b761396579b1b237b2d994d3869c56 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Fri, 7 Jul 2023 14:52:15 -0700 Subject: [PATCH] refactor: trial copy --- components/Modals.ce.vue | 4 +-- components/UserProfile/Trial.vue | 29 ++++--------------- store/trial.ts | 49 +++++++++++++++++++++++--------- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/components/Modals.ce.vue b/components/Modals.ce.vue index 55061c845..5e2466cde 100644 --- a/components/Modals.ce.vue +++ b/components/Modals.ce.vue @@ -9,14 +9,14 @@ import { useTrialStore } from '~/store/trial'; const { callbackStatus } = storeToRefs(useCallbackActionsStore()); const { promoVisible } = storeToRefs(usePromoStore()); -const { showModal } = storeToRefs(useTrialStore()); +const { trialModalVisible } = storeToRefs(useTrialStore()); diff --git a/components/UserProfile/Trial.vue b/components/UserProfile/Trial.vue index 554b119be..4b233f967 100644 --- a/components/UserProfile/Trial.vue +++ b/components/UserProfile/Trial.vue @@ -11,24 +11,7 @@ withDefaults(defineProps(), { }); const trialStore = useTrialStore(); -const { trialStatus } = storeToRefs(trialStore); - -const heading = computed(() => { - if (trialStatus.value === 'failed') return 'Failed to start your free 30 day trial'; - if (trialStatus.value === 'trialExtend') return 'Extending your free trial by 15 days'; - if (trialStatus.value === 'trialStart') return 'Starting your free 30 day trial…'; - if (trialStatus.value === 'success') return 'Free 30 Day Trial Created'; - return ''; -}); -const subheading = computed(() => { - /** @todo show response error */ - if (trialStatus.value === 'failed') return 'Key server did not return a trial key. Please try again later.'; - if (trialStatus.value === 'trialExtend' || trialStatus.value === 'trialStart') return 'Please keep this window open'; - if (trialStatus.value === 'success') return 'Please wait while the page reloads to install your trial key'; - return ''; -}); - -const loading = computed(() => trialStatus.value === 'trialExtend' || trialStatus.value === 'trialStart'); +const { trialModalLoading, trialStatus, trialStatusCopy } = storeToRefs(trialStore); const close = () => { if (trialStatus.value === 'trialStart') return console.debug("[close] not allowed"); @@ -40,16 +23,16 @@ const close = () => { -