disable font scaling on fixed-height chat invite cards
thread a hasFixedHeight flag through ChatInvite.Root and its context so the card, join button, and profile badges disable font scaling when they live in a fixed-height container, preventing text from overflowing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ export function Text({
|
||||
title,
|
||||
dataSet,
|
||||
numberOfLines,
|
||||
allowFontScaling = true,
|
||||
...rest
|
||||
}: TextProps) {
|
||||
const {fonts, flags} = useAlf()
|
||||
@@ -36,7 +37,7 @@ export function Text({
|
||||
style,
|
||||
],
|
||||
{
|
||||
fontScale: fonts.scaleMultiplier,
|
||||
fontScale: allowFontScaling ? fonts.scaleMultiplier : 1,
|
||||
fontFamily: fonts.family,
|
||||
flags,
|
||||
},
|
||||
@@ -57,6 +58,7 @@ export function Text({
|
||||
numberOfLines,
|
||||
style: s,
|
||||
dataSet: Object.assign({tooltip: title}, dataSet || {}),
|
||||
allowFontScaling,
|
||||
...rest,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user