mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix: move reissue button to standalone block outside device_limit guard
The reissue button was inside the Additional Options card which is gated by device_limit !== 0, so it was hidden when device_limit was 0. Move it to its own card block with independent visibility condition.
This commit is contained in:
@@ -2292,53 +2292,65 @@ export default function Subscription() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Reissue Subscription */}
|
{/* Reissue Subscription — standalone block, not dependent on device_limit */}
|
||||||
<div className="mt-4">
|
{subscription &&
|
||||||
<button
|
(subscription.is_active || subscription.is_limited) &&
|
||||||
onClick={handleRevoke}
|
!subscription.is_trial && (
|
||||||
disabled={revokeMutation.isPending || revokeCooldown > 0}
|
<div
|
||||||
className="w-full rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-left transition-colors hover:bg-amber-500/20 disabled:opacity-50"
|
className="relative overflow-hidden rounded-3xl"
|
||||||
>
|
style={{
|
||||||
<div className="flex items-center justify-between">
|
background: g.cardBg,
|
||||||
<div>
|
border: `1px solid ${g.cardBorder}`,
|
||||||
<div className="font-medium text-amber-400">
|
boxShadow: g.shadow,
|
||||||
{t('subscription.revoke.button')}
|
padding: '16px 20px',
|
||||||
</div>
|
}}
|
||||||
<div className="mt-1 text-sm text-dark-400">
|
>
|
||||||
{revokeCooldown > 0
|
<button
|
||||||
? t('subscription.revoke.cooldown', {
|
onClick={handleRevoke}
|
||||||
minutes: Math.floor(revokeCooldown / 60),
|
disabled={revokeMutation.isPending || revokeCooldown > 0}
|
||||||
seconds: revokeCooldown % 60,
|
className="w-full rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-left transition-colors hover:bg-amber-500/20 disabled:opacity-50"
|
||||||
})
|
>
|
||||||
: t('subscription.revoke.description')}
|
<div className="flex items-center justify-between">
|
||||||
</div>
|
<div>
|
||||||
|
<div className="font-medium text-amber-400">
|
||||||
|
{t('subscription.revoke.button')}
|
||||||
</div>
|
</div>
|
||||||
<div className="text-amber-400">
|
<div className="mt-1 text-sm text-dark-400">
|
||||||
{revokeMutation.isPending ? (
|
{revokeCooldown > 0
|
||||||
<div className="h-5 w-5 animate-spin rounded-full border-2 border-amber-400/30 border-t-amber-400" />
|
? t('subscription.revoke.cooldown', {
|
||||||
) : (
|
minutes: Math.floor(revokeCooldown / 60),
|
||||||
<svg
|
seconds: revokeCooldown % 60,
|
||||||
className="h-5 w-5"
|
})
|
||||||
fill="none"
|
: t('subscription.revoke.description')}
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth={1.5}
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
<div className="text-amber-400">
|
||||||
{revokeMutation.error && (
|
{revokeMutation.isPending ? (
|
||||||
<p className="mt-2 text-sm text-red-400">{getErrorMessage(revokeMutation.error)}</p>
|
<div className="h-5 w-5 animate-spin rounded-full border-2 border-amber-400/30 border-t-amber-400" />
|
||||||
)}
|
) : (
|
||||||
</div>
|
<svg
|
||||||
|
className="h-5 w-5"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth={1.5}
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
{revokeMutation.error && (
|
||||||
|
<p className="mt-2 text-sm text-red-400">{getErrorMessage(revokeMutation.error)}</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user