Skip to content

Commit 8cfc50d

Browse files
committed
code improve
1 parent 0badb4f commit 8cfc50d

File tree

6 files changed

+69
-24
lines changed

6 files changed

+69
-24
lines changed
Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,39 @@
11
<template>
2-
<div class="flex items-center gap-2 bg-comfy-menu-secondary px-3">
2+
<div
3+
class="flex items-center gap-2 bg-comfy-menu-secondary"
4+
:class="[{ 'flex-row-reverse': reverseOrder }, noPadding ? '' : 'px-3']"
5+
>
36
<div
47
v-if="badge.label"
58
class="rounded-full bg-white px-1.5 py-0.5 text-xxxs font-semibold text-black"
9+
:class="labelClass"
610
>
711
{{ badge.label }}
812
</div>
9-
<div class="font-inter text-sm font-extrabold text-slate-100">
13+
<div
14+
class="font-inter text-sm font-extrabold text-slate-100"
15+
:class="textClass"
16+
>
1017
{{ badge.text }}
1118
</div>
1219
</div>
1320
</template>
1421
<script setup lang="ts">
1522
import type { TopbarBadge } from '@/types/comfy'
1623
17-
defineProps<{
18-
badge: TopbarBadge
19-
}>()
24+
withDefaults(
25+
defineProps<{
26+
badge: TopbarBadge
27+
reverseOrder?: boolean
28+
noPadding?: boolean
29+
labelClass?: string
30+
textClass?: string
31+
}>(),
32+
{
33+
reverseOrder: false,
34+
noPadding: false,
35+
labelClass: '',
36+
textClass: ''
37+
}
38+
)
2039
</script>

src/components/topbar/TopbarBadges.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
v-for="badge in topbarBadgeStore.badges"
55
:key="badge.text"
66
:badge
7+
:reverse-order="reverseOrder"
8+
:no-padding="noPadding"
9+
:label-class="labelClass"
10+
:text-class="textClass"
711
/>
812
</div>
913
</template>
@@ -13,5 +17,20 @@ import { useTopbarBadgeStore } from '@/stores/topbarBadgeStore'
1317
1418
import TopbarBadge from './TopbarBadge.vue'
1519
20+
withDefaults(
21+
defineProps<{
22+
reverseOrder?: boolean
23+
noPadding?: boolean
24+
labelClass?: string
25+
textClass?: string
26+
}>(),
27+
{
28+
reverseOrder: false,
29+
noPadding: false,
30+
labelClass: '',
31+
textClass: ''
32+
}
33+
)
34+
1635
const topbarBadgeStore = useTopbarBadgeStore()
1736
</script>

src/locales/en/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@
19141914
"title": "Subscription",
19151915
"comfyCloud": "Comfy Cloud",
19161916
"beta": "BETA",
1917-
"perMonth": "/ month",
1917+
"perMonth": "USD / month",
19181918
"renewsDate": "Renews {date}",
19191919
"manageSubscription": "Manage subscription",
19201920
"apiNodesBalance": "\"API Nodes\" Credit Balance",

src/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="grid h-full grid-cols-5">
2+
<div class="grid h-full grid-cols-5 px-10 pb-10">
33
<div
44
class="relative col-span-2 flex items-center justify-center overflow-hidden"
55
>
@@ -18,28 +18,34 @@
1818
</video>
1919
</div>
2020

21-
<div class="col-span-3 flex flex-col p-8">
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') }}
21+
<div class="col-span-3 flex flex-col justify-between pl-8">
22+
<div>
23+
<div class="flex flex-col gap-4">
24+
<div class="inline-flex items-center gap-2">
25+
<div class="text-sm text-muted">
26+
{{ $t('subscription.required.title') }}
27+
</div>
28+
<TopbarBadges
29+
reverse-order
30+
no-padding
31+
text-class="!text-sm !font-normal"
32+
/>
2633
</div>
27-
<TopbarBadges />
28-
</div>
2934

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>
35+
<div class="flex items-baseline gap-2">
36+
<span class="text-4xl font-bold">{{ formattedMonthlyPrice }}</span>
37+
<span class="text-xl">{{ $t('subscription.perMonth') }}</span>
38+
</div>
3339
</div>
34-
</div>
3540

36-
<SubscriptionBenefits class="text-muted" />
41+
<SubscriptionBenefits class="mt-6 text-muted" />
42+
</div>
3743

38-
<div class="mt-10 mb-4 flex flex-col">
44+
<div class="flex flex-col">
3945
<Button
4046
:label="$t('subscription.required.subscribe')"
4147
size="large"
42-
class="w-full"
48+
class="w-full font-bold"
4349
:loading="isLoading"
4450
:disabled="isPolling"
4551
@click="handleSubscribe"

src/platform/cloud/subscription/composables/useSubscription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function useSubscription() {
5656
})
5757

5858
const formattedMonthlyPrice = computed(
59-
() => `$${MONTHLY_SUBSCRIPTION_PRICE.toFixed(2)}`
59+
() => `$${MONTHLY_SUBSCRIPTION_PRICE.toFixed(0)}`
6060
)
6161

6262
const fetchStatus = wrapWithErrorHandlingAsync(async () => {

src/services/dialogService.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,11 @@ export const useDialogService = () => {
502502
),
503503
dialogComponentProps: {
504504
closable: true,
505-
style: 'width: 720px; height: 434px;',
505+
style: 'width: 700px;',
506506
pt: {
507+
header: { class: '!p-0 !m-0' },
507508
content: {
508-
class: 'overflow-hidden p-0!'
509+
class: 'overflow-hidden !p-0 !m-0'
509510
}
510511
}
511512
}

0 commit comments

Comments
 (0)