Rework all typography

This commit is contained in:
Paul Frazee 2023-01-18 11:15:40 -06:00
parent df4acbd683
commit 77580ab6a4
28 changed files with 355 additions and 162 deletions

View file

@ -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 = {

View file

@ -8,7 +8,7 @@ export type CustomTextProps = TextProps & {
}
export function Text({
type = 'body1',
type = 'md',
children,
style,
...props