-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpricing.vue
128 lines (121 loc) · 4.69 KB
/
pricing.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { ACCOUNT_ACCESS } from '~~/drizzle/schema';
const accountStore = useAccountStore();
const { activeMembership } = storeToRefs(accountStore);
onMounted(async () => {
await accountStore.init();
});
</script>
<template>
<div
class="flex flex-col items-center max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8">
<div class="text-center mb-12">
<h2
class="text-4xl font-extrabold tracking-tight text-gray-900 sm:text-5xl md:text-6xl mb-4">
Flexible Pricing
</h2>
<p class="text-xl text-gray-500">
SupaNuxt SaaS is completely free and open source but you can price your
own SaaS like this
</p>
</div>
<div class="flex flex-col md:flex-row justify-center items-center">
<!-- Free Plan -->
<div
class="bg-white rounded-lg shadow-lg text-center px-6 py-8 md:mx-4 md:my-4 md:flex-1">
<h3 class="text-2xl font-bold text-gray-900 mb-4">Free Plan</h3>
<p class="text-gray-600 mb-4">Single user, 10 notes</p>
<p class="text-3xl font-bold text-gray-900 mb-4">
$0<span class="text-gray-600 text-lg">/mo</span>
</p>
<button
v-if="!activeMembership"
@click.prevent="navigateTo('/signup')"
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline-blue">
Start for free
</button>
</div>
<!-- Personal Plan -->
<div
class="bg-white rounded-lg shadow-lg text-center px-6 py-8 md:mx-4 md:my-4 md:flex-1">
<h3 class="text-2xl font-bold text-gray-900 mb-4">Personal Plan</h3>
<p class="text-gray-600 mb-4">Single user, 100 notes</p>
<p class="text-3xl font-bold text-gray-900 mb-4">
$15<span class="text-gray-600 text-lg">/mo</span>
</p>
<!-- logged in user gets a subscribe button-->
<form
action="/create-checkout-session"
method="POST"
v-if="
activeMembership &&
(activeMembership.access === ACCOUNT_ACCESS.OWNER ||
activeMembership.access !== ACCOUNT_ACCESS.ADMIN) &&
activeMembership?.account.plan_name !== 'Individual Plan'
">
<input
type="hidden"
name="price_id"
value="price_1MpOiwJfLn4RhYiLqfy6U8ZR" />
<input
type="hidden"
name="account_id"
:value="activeMembership?.account_id" />
<button
type="submit"
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline-blue">
Subscribe
</button>
</form>
<!-- anon user gets a link to sign up -->
<button
v-if="!activeMembership"
@click.prevent="navigateTo('/signup')"
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline-blue">
Get started
</button>
</div>
<!-- Team Plan -->
<div
class="bg-white rounded-lg shadow-lg text-center px-6 py-8 md:mx-4 md:my-4 md:flex-1">
<h3 class="text-2xl font-bold text-gray-900 mb-4">Team Plan</h3>
<p class="text-gray-600 mb-4">10 users, 200 notes</p>
<p class="text-3xl font-bold text-gray-900 mb-4">
$25<span class="text-gray-600 text-lg">/mo</span>
</p>
<!-- logged in user gets a subscribe button-->
<form
action="/create-checkout-session"
method="POST"
v-if="
activeMembership &&
(activeMembership.access === ACCOUNT_ACCESS.OWNER ||
activeMembership.access !== ACCOUNT_ACCESS.ADMIN) &&
activeMembership?.account.plan_name !== 'Team Plan'
">
<input
type="hidden"
name="price_id"
value="price_1MpOjtJfLn4RhYiLsjzAso90" />
<input
type="hidden"
name="account_id"
:value="activeMembership?.account_id" />
<button
type="submit"
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline-blue">
Subscribe
</button>
</form>
<!-- anon user gets a link to sign up -->
<button
v-if="!activeMembership"
@click.prevent="navigateTo('/signup')"
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline-blue">
Get started
</button>
</div>
</div>
</div>
</template>