Skip to content

Instantly share code, notes, and snippets.

@jasurkurbanov
Created July 22, 2020 13:14
Show Gist options
  • Save jasurkurbanov/6ac4941a202a683369e55c6caf52e9c9 to your computer and use it in GitHub Desktop.
Save jasurkurbanov/6ac4941a202a683369e55c6caf52e9c9 to your computer and use it in GitHub Desktop.

import * as React from 'react'; import { Text } from 'react-native'; import adjust from "../../adjust";

const MyText = ({ h1, h2, h3, h4, h5, p, bold, italic, title, style, ...rest })=> { return ( <Text style={[ h1 && { fontSize: adjust(48) }, h2 && { fontSize: adjust(32) }, h3 && { fontSize: adjust(20) }, h4 && { fontSize: adjust(18) }, h5 && { fontSize: adjust(16) }, p && { fontSize: adjust(12) }, bold && { fontWeight: 'bold' }, italic && { fontStyle: 'italic'}, style ]}{...rest}>{title} ); };

export { MyText }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment