Skip to content

Commit 1142b81

Browse files
author
monster
committed
fix: stabilize subscription plan dialog height
1 parent b24f9d7 commit 1142b81

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

frontend/src/components/console/nav/subscription-plan-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export default function SubscriptionPlanDialog({ open, onOpenChange }: Subscript
281281
return (
282282
<>
283283
<Dialog open={open} onOpenChange={onOpenChange}>
284-
<DialogContent className="flex h-[40vh] max-h-[80vh] max-w-[80vw] flex-col gap-0 overflow-hidden p-0 md:max-w-4xl">
284+
<DialogContent className="flex h-120 max-h-[calc(100dvh-2rem)] max-w-[80vw] flex-col gap-0 overflow-hidden p-0 md:max-w-4xl">
285285
<DialogHeader className="px-5 py-4">
286286
<DialogTitle>{t("subscriptionPlan.dialog.title")}</DialogTitle>
287287
</DialogHeader>

frontend/test/subscription-plan-dialog-i18n.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ test("套餐弹窗提供中英文资源", () => {
2525
assert.equal(cn.subscriptionPlan.actions.subscribePlan, "开通{{plan}}");
2626
assert.equal(en.subscriptionPlan.actions.subscribePlan, "Subscribe to {{plan}}");
2727
});
28+
29+
test("套餐弹窗使用固定设计高度并限制极小视口", () => {
30+
assert.match(source, /h-120/);
31+
assert.match(source, /max-h-\[calc\(100dvh-2rem\)\]/);
32+
assert.doesNotMatch(source, /h-\[40vh\]|max-h-\[80vh\]/);
33+
});

0 commit comments

Comments
 (0)