diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-18 11:15:40 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-01-18 11:15:40 -0600 |
commit | 77580ab6a4df8e233e5b1a9b166eebbca9bdc80f (patch) | |
tree | 964991f62d70de001c2f7ba08c0a6c135181bc3b /src/view/com/util/text | |
parent | df4acbd683fb66c469c25915e875a8bcd2d83971 (diff) | |
download | voidsky-77580ab6a4df8e233e5b1a9b166eebbca9bdc80f.tar.zst |
Rework all typography
Diffstat (limited to 'src/view/com/util/text')
-rw-r--r-- | src/view/com/util/text/RichText.tsx | 6 | ||||
-rw-r--r-- | src/view/com/util/text/Text.tsx | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/view/com/util/text/RichText.tsx b/src/view/com/util/text/RichText.tsx index 2a42d26ae..a7bc92a45 100644 --- a/src/view/com/util/text/RichText.tsx +++ b/src/view/com/util/text/RichText.tsx @@ -15,21 +15,23 @@ type Entity = { } export function RichText({ - type = 'body1', + type = 'md', text, entities, + lineHeight = 1.2, style, numberOfLines, }: { type?: TypographyVariant text: string entities?: Entity[] + lineHeight?: number style?: StyleProp<TextStyle> numberOfLines?: number }) { const theme = useTheme() const pal = usePalette('default') - const lineHeightStyle = lh(theme, type, 1.2) + const lineHeightStyle = lh(theme, type, lineHeight) if (!entities?.length) { if (/^\p{Extended_Pictographic}+$/u.test(text) && text.length <= 5) { style = { diff --git a/src/view/com/util/text/Text.tsx b/src/view/com/util/text/Text.tsx index 549eb2901..c3a8a2194 100644 --- a/src/view/com/util/text/Text.tsx +++ b/src/view/com/util/text/Text.tsx @@ -8,7 +8,7 @@ export type CustomTextProps = TextProps & { } export function Text({ - type = 'body1', + type = 'md', children, style, ...props |