Files
SuhailandGitHub 789a435fff refactor: Let user add payment info on upgrading plan for trial site (#2493)
* refactor(signup): let user add payment info on trying to upgrade trial site

* fix(signup): explicitly convey for which account the setup is for

* fix: add a banner asking user to upgrade

* fix: smaller plan dialog

* fix: minor style changes to the check symbol info

* fix: don't add last name if null

* refactor(upsell-banner): make the upsell banner gray

* refactor(first-payment): explain payment modes

- prefill user name in billing details if possible

* refactor(first-payment): add progress bar
2025-03-04 14:59:27 +05:30

63 lines
1.1 KiB
Vue

<template>
<AlertBanner v-if="show" :title="title" :type="type">
<slot></slot>
<Button class="ml-1" variant="ghost" @click="dismiss">
<template #icon>
<i-lucide-x class="h-4 w-4" />
</template>
</Button>
</AlertBanner>
</template>
<script>
import AlertBanner from './AlertBanner.vue';
export default {
props: {
title: String,
id: {
type: String,
required: true,
},
type: {
type: String,
},
},
data() {
return {
_show: true,
};
},
components: { AlertBanner },
computed: {
show: {
get() {
if (!this._show) return false;
const dismissedDate = parseInt(
localStorage.getItem(`dismissed-banner-${this.id}`),
);
if (!dismissedDate) return true;
const currentDate = Date.now();
const diff = currentDate - dismissedDate;
// 7 days
if (diff > 1000 * 60 * 60 * 24 * 7) return true;
return false;
},
set(value) {
this._show = value;
},
},
},
methods: {
dismiss() {
this.show = false;
localStorage.setItem(`dismissed-banner-${this.id}`, Date.now());
},
},
};
</script>