react-native-modern-elements
Version:
A modern, customizable UI component library for React Native
14 lines (13 loc) • 606 B
JavaScript
import React, { memo } from "react";
import Animated from "react-native-reanimated";
import { verticalScale } from "../utils/styling";
import { colors } from "../constants/theme";
const Typo = ({ size, color = colors.text, fontWeight = "400", children, style, numberOfLines, textProps, }) => {
const textStyle = {
fontSize: size ? verticalScale(size) : verticalScale(18),
color,
fontWeight,
};
return (React.createElement(Animated.Text, Object.assign({ style: [textStyle, style] }, textProps, { numberOfLines: numberOfLines }), children));
};
export default memo(Typo);