廓形仪rn版本-技术调研
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
916 B

  1. import React from 'react';
  2. import type { VariantProps } from '@gluestack-ui/nativewind-utils';
  3. import { Text as RNText } from 'react-native';
  4. import { textStyle } from './styles';
  5. type ITextProps = React.ComponentProps<typeof RNText> &
  6. VariantProps<typeof textStyle>;
  7. const Text = React.forwardRef<React.ComponentRef<typeof RNText>, ITextProps>(
  8. function Text(
  9. {
  10. className,
  11. isTruncated,
  12. bold,
  13. underline,
  14. strikeThrough,
  15. size = 'md',
  16. sub,
  17. italic,
  18. highlight,
  19. ...props
  20. },
  21. ref
  22. ) {
  23. return (
  24. <RNText
  25. className={textStyle({
  26. isTruncated,
  27. bold,
  28. underline,
  29. strikeThrough,
  30. size,
  31. sub,
  32. italic,
  33. highlight,
  34. class: className,
  35. })}
  36. {...props}
  37. ref={ref}
  38. />
  39. );
  40. }
  41. );
  42. Text.displayName = 'Text';
  43. export { Text };