|
1 | 1 | <script lang="ts"> |
2 | 2 | import type { PageData } from './$types'; |
3 | 3 | export let data: PageData; |
4 | | -
|
5 | | - import { openStripePortal } from '$lib/client/firebase'; |
6 | | - import { ProgressCircle } from '@codingcatdev/blackcatui'; |
7 | 4 | import LayoutWrapper from '../../(layout-partials)/LayoutWrapper.svelte'; |
8 | | - import LogoutButton from '../../login/LogoutButton.svelte'; |
9 | | - import ProButton from '../ProButton.svelte'; |
10 | | -
|
11 | | - import { Icon } from '@steeze-ui/svelte-icon'; |
12 | | - import { ArrowTopRightOnSquare } from '@steeze-ui/heroicons'; |
13 | | -
|
14 | | - let redirecting = false; |
15 | | -
|
16 | | - const onOpenMembership = async () => { |
17 | | - redirecting = true; |
18 | | - await openStripePortal(); |
19 | | - }; |
| 5 | + import AccountCard from './AccountCard.svelte'; |
| 6 | + import MembershipCard from './MembershipCard.svelte'; |
| 7 | + import SupportCard from './SupportCard.svelte'; |
20 | 8 | </script> |
21 | 9 |
|
22 | 10 | <LayoutWrapper> |
23 | | - <h1>{data.user?.email}</h1> |
24 | | - <LogoutButton /> |
25 | | - |
26 | | - {#if data?.user?.stripeRole} |
27 | | - <div class="bcu-card p-8 flex flex-col gap-2 md:gap-8"> |
28 | | - <h2>Membership</h2> |
29 | | - |
30 | | - Current Membership: {data?.user?.stripeRole} |
31 | | - |
32 | | - {#if redirecting} |
33 | | - <button class="bcu-button variant-filled-surface flex gap-2"> |
34 | | - Redirecting |
35 | | - <ProgressCircle |
36 | | - stroke={100} |
37 | | - meter="stroke-primary-50" |
38 | | - track="stroke-primary-500/30" |
39 | | - class="w-8" |
40 | | - /> |
41 | | - </button> |
42 | | - {:else} |
43 | | - <button |
44 | | - class="bcu-button variant-filled-surface flex gap-2" |
45 | | - on:click|once={onOpenMembership} |
46 | | - > |
47 | | - Open Membership |
48 | | - <Icon src={ArrowTopRightOnSquare} theme="mini" class="w-8" /> |
49 | | - </button> |
50 | | - {/if} |
| 11 | + <div class="flex justify-center p-4 w-full"> |
| 12 | + <div class="xl:max-w-7xl w-full flex-1"> |
| 13 | + <div class="flex justify-between mb-4"> |
| 14 | + <h1>Account and Settings</h1> |
| 15 | + <a class="bcu-button variant-filled" href="/dashboard">Dashboard</a> |
| 16 | + </div> |
| 17 | + <div class="flex flex-col w-full jSustify-center items-start gap-4"> |
| 18 | + <AccountCard {data} /> |
| 19 | + <MembershipCard {data} /> |
| 20 | + <SupportCard /> |
| 21 | + </div> |
51 | 22 | </div> |
52 | | - {:else} |
53 | | - <ProButton products={data.products} uid={data.user?.uid} /> |
54 | | - {/if} |
| 23 | + </div> |
55 | 24 | </LayoutWrapper> |
0 commit comments