Created
April 18, 2024 16:35
-
-
Save GabrielMerigo/693c76ac03e190f505a02d232691fbee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { TextProps } from "react-native"; | |
| import { FontTypes } from "@theme/typography"; | |
| import S from "./styles"; | |
| export interface TypographyProps extends TextProps { | |
| variation?: keyof typeof FontTypes; | |
| } | |
| /** | |
| * | |
| * @param variation default is `TextBodyRegular` | |
| */ | |
| export function Typography({ | |
| children, | |
| variation = "TextBodyRegular", | |
| style, | |
| ...props | |
| }: TypographyProps) { | |
| return ( | |
| <S.Label {...props} style={[style, FontTypes[variation]]}> | |
| {children} | |
| </S.Label> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment