mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 00:20:07 +00:00
## Summary Change to just "Subscribe" on mobile breakpoint. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6581-make-subscribe-to-run-button-responsive-2a16d73d365081e3a776cde0290432f3) by [Unito](https://www.unito.io)
59 lines
1.5 KiB
Vue
59 lines
1.5 KiB
Vue
<template>
|
|
<Button
|
|
v-tooltip.bottom="{
|
|
value: $t('subscription.subscribeToRunFull'),
|
|
showDelay: 600
|
|
}"
|
|
class="subscribe-to-run-button"
|
|
:label="buttonLabel"
|
|
icon="pi pi-lock"
|
|
severity="primary"
|
|
size="small"
|
|
:style="{
|
|
background: 'var(--color-subscription-button-gradient)',
|
|
color: 'var(--color-white)'
|
|
}"
|
|
:pt="{
|
|
root: {
|
|
class: 'whitespace-nowrap',
|
|
style: {
|
|
borderColor: 'transparent'
|
|
}
|
|
}
|
|
}"
|
|
data-testid="subscribe-to-run-button"
|
|
@click="handleSubscribeToRun"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
|
import Button from 'primevue/button'
|
|
import { computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
|
|
import { isCloud } from '@/platform/distribution/types'
|
|
import { useTelemetry } from '@/platform/telemetry'
|
|
|
|
const { t } = useI18n()
|
|
const breakpoints = useBreakpoints(breakpointsTailwind)
|
|
const isMdOrLarger = breakpoints.greaterOrEqual('md')
|
|
|
|
const buttonLabel = computed(() =>
|
|
isMdOrLarger.value
|
|
? t('subscription.subscribeToRunFull')
|
|
: t('subscription.subscribeToRun')
|
|
)
|
|
|
|
const { showSubscriptionDialog } = useSubscription()
|
|
|
|
const handleSubscribeToRun = () => {
|
|
if (isCloud) {
|
|
useTelemetry()?.trackRunButton({ subscribe_to_run: true })
|
|
}
|
|
|
|
showSubscriptionDialog()
|
|
}
|
|
</script>
|