Text.js 720 B

1234567891011121314151617181920212223242526
  1. import * as WebBrowser from "expo-web-browser";
  2. import * as React from "react";
  3. import { Text } from "react-native";
  4. const FreeText = React.memo((props) => {
  5. function getTextProps(props) {
  6. let _props = {
  7. color: "#000000",
  8. fontSize: 16,
  9. };
  10. if (props.fontSize) {
  11. _props.fontSize = props.fontSize;
  12. }
  13. if (props.color) {
  14. _props.color = props.color;
  15. }
  16. if (props.textAlign) {
  17. _props.align = props.textAlign;
  18. }
  19. return _props;
  20. }
  21. const textProps = getTextProps(props);
  22. return <Text {...textProps}>{props.label || ""}</Text>;
  23. });
  24. export default FreeText;