廓形仪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.

26 lines
641 B

  1. import React from 'react';
  2. import type { VariantProps } from '@gluestack-ui/nativewind-utils';
  3. import { View, ViewProps } from 'react-native';
  4. import { cardStyle } from './styles';
  5. type ICardProps = ViewProps &
  6. VariantProps<typeof cardStyle> & { className?: string };
  7. const Card = React.forwardRef<React.ComponentRef<typeof View>, ICardProps>(
  8. function Card(
  9. { className, size = 'md', variant = 'elevated', ...props },
  10. ref
  11. ) {
  12. return (
  13. <View
  14. className={cardStyle({ size, variant, class: className })}
  15. {...props}
  16. ref={ref}
  17. />
  18. );
  19. }
  20. );
  21. Card.displayName = 'Card';
  22. export { Card };