Skip to content

Commit 3a205f1

Browse files
committed
subscription modal
1 parent 4f1877a commit 3a205f1

File tree

6 files changed

+68
-33
lines changed

6 files changed

+68
-33
lines changed
64.8 KB
Binary file not shown.

src/components/common/SubscriptionBenefits.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<Button
1818
:label="$t('subscription.viewMoreDetails')"
1919
text
20-
severity="secondary"
2120
icon="pi pi-external-link"
2221
icon-pos="left"
2322
size="small"

src/components/dialog/content/SubscriptionRequiredDialogContent.vue

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,51 @@
11
<template>
2-
<div class="subscription-required-dialog flex flex-col gap-4 p-6">
3-
<div class="flex flex-col items-center gap-4 text-center">
4-
<i class="pi pi-lock text-6xl text-primary-400" />
5-
<h2 class="text-2xl font-bold">
6-
{{ $t('subscription.required.title') }}
7-
</h2>
8-
<p class="text-muted">
9-
{{
10-
isPolling
11-
? $t('subscription.required.waitingForSubscription')
12-
: $t('subscription.required.message')
13-
}}
14-
</p>
15-
</div>
16-
2+
<div class="grid h-full grid-cols-5">
173
<div
18-
class="flex flex-col gap-3 rounded-lg border p-4 dark-theme:bg-charcoal-600"
4+
class="relative col-span-2 flex items-center justify-center overflow-hidden"
195
>
20-
<SubscriptionBenefits />
6+
<video
7+
autoplay
8+
loop
9+
muted
10+
playsinline
11+
class="h-full min-w-[125%] object-cover"
12+
style="margin-left: -20%"
13+
>
14+
<source
15+
src="/assets/images/cloud-subscription.webm"
16+
type="video/webm"
17+
/>
18+
</video>
2119
</div>
2220

23-
<Button
24-
:label="$t('subscription.required.subscribe')"
25-
class="w-full"
26-
:loading="isLoading"
27-
:disabled="isPolling"
28-
@click="handleSubscribe"
29-
/>
21+
<div class="col-span-3 flex flex-col p-4">
22+
<div class="flex flex-col gap-4">
23+
<div class="inline-flex items-center gap-2">
24+
<div class="text-sm">
25+
{{ $t('subscription.required.title') }}
26+
</div>
27+
<TopbarBadges />
28+
</div>
29+
30+
<div class="mt-4 mb-10 flex items-baseline gap-2">
31+
<span class="text-3xl font-bold">{{ formattedMonthlyPrice }}</span>
32+
<span class="text-xl">{{ $t('subscription.perMonth') }}</span>
33+
</div>
34+
</div>
35+
36+
<SubscriptionBenefits class="text-muted" />
37+
38+
<div class="mt-10 mb-4 flex flex-col">
39+
<Button
40+
:label="$t('subscription.required.subscribe')"
41+
size="large"
42+
class="w-full"
43+
:loading="isLoading"
44+
:disabled="isPolling"
45+
@click="handleSubscribe"
46+
/>
47+
</div>
48+
</div>
3049
</div>
3150
</template>
3251

@@ -35,13 +54,16 @@ import Button from 'primevue/button'
3554
import { onBeforeUnmount, ref } from 'vue'
3655
3756
import SubscriptionBenefits from '@/components/common/SubscriptionBenefits.vue'
57+
import TopbarBadges from '@/components/topbar/TopbarBadges.vue'
3858
import { useSubscription } from '@/composables/auth/useSubscription'
3959
4060
const emit = defineEmits<{
4161
close: [subscribed: boolean]
4262
}>()
4363
44-
const { subscribe, isActiveSubscription } = useSubscription()
64+
const { subscribe, isActiveSubscription, formattedMonthlyPrice } =
65+
useSubscription()
66+
4567
const isLoading = ref(false)
4668
const isPolling = ref(false)
4769
let pollInterval: number | null = null
@@ -62,7 +84,7 @@ const startPollingSubscriptionStatus = () => {
6284
return
6385
}
6486
65-
if (isActiveSubscription) {
87+
if (isActiveSubscription.value) {
6688
stopPolling()
6789
emit('close', true)
6890
}
@@ -106,3 +128,13 @@ onBeforeUnmount(() => {
106128
stopPolling()
107129
})
108130
</script>
131+
132+
<style scoped>
133+
:deep(.bg-comfy-menu-secondary) {
134+
background-color: transparent;
135+
}
136+
137+
:deep(.p-button) {
138+
color: white;
139+
}
140+
</style>

src/composables/auth/useSubscription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isCloud } from '@/platform/distribution/types'
55
import { useDialogService } from '@/services/dialogService'
66
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
77

8-
export const MONTHLY_SUBSCRIPTION_PRICE = 20
8+
const MONTHLY_SUBSCRIPTION_PRICE = 20
99

1010
export function useSubscription() {
1111
const authStore = useFirebaseAuthStore()

src/locales/en/main.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,10 +1932,9 @@
19321932
"benefit2": "Up to 30 min runtime per job"
19331933
},
19341934
"required": {
1935-
"title": "Subscription Required",
1936-
"message": "You need an active subscription to run workflows on Comfy Cloud.",
1935+
"title": "Subscribe to",
19371936
"waitingForSubscription": "Complete your subscription in the new tab. We'll automatically detect when you're done!",
1938-
"subscribe": "Subscribe Now"
1937+
"subscribe": "Subscribe"
19391938
},
19401939
"subscribeToRun": "Subscribe to Run"
19411940
},

src/services/dialogService.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,14 @@ export const useDialogService = () => {
490490
dialogStore.showDialog({
491491
key: 'subscription-required',
492492
component: SubscriptionRequiredDialogContent,
493-
headerComponent: ComfyOrgHeader,
494493
dialogComponentProps: {
495-
closable: true
494+
closable: true,
495+
style: 'width: 720px; height: 434px;',
496+
pt: {
497+
content: {
498+
class: 'overflow-hidden p-0!'
499+
}
500+
}
496501
}
497502
})
498503
}

0 commit comments

Comments
 (0)