Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save GabrielMerigo/693c76ac03e190f505a02d232691fbee to your computer and use it in GitHub Desktop.

Select an option

Save GabrielMerigo/693c76ac03e190f505a02d232691fbee to your computer and use it in GitHub Desktop.
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