rn-inkpad
Version: 
<img src="https://res.cloudinary.com/fercloudinary/image/upload/v1715452841/packages/inkpad-banner_acl0xl.png" />
39 lines (38 loc) • 1.93 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FloatingActionCard = void 0;
const react_1 = __importDefault(require("react"));
const react_native_1 = require("react-native");
const __1 = require("../");
const colorToRgba_1 = require("../../helpers/colorToRgba");
const theme_1 = require("../../theme");
const FloatingActionCard = ({ backgroundColor: bgColor, bottom = 40, decimals = 1, description, icon, iconColor = '#FFD700', image, onPress, rating, textColor = '#000000', title, width = '90%', }) => {
    const backgroundColor = (0, colorToRgba_1.colorToRgba)(bgColor ?? '#FFFFFF', 0.9);
    return (<react_native_1.Pressable onPress={onPress} style={{
            ...theme_1.ratingCardStyles.container,
            padding: !!image ? 0 : 10,
            bottom,
            width,
            backgroundColor,
        }}>
      {image && <react_native_1.Image style={{ height: 75, width: 75 }} source={image}/>}
      <react_native_1.View style={theme_1.ratingCardStyles.information}>
        <react_native_1.Text style={{ ...theme_1.ratingCardStyles.title, color: textColor }}>
          {title}
        </react_native_1.Text>
        {description && (<react_native_1.Text style={{ ...theme_1.ratingCardStyles.decription, color: textColor }}>
            {description}
          </react_native_1.Text>)}
        <react_native_1.View style={theme_1.ratingCardStyles.rating}>
          {icon && <__1.Icon name={icon} color={iconColor} size={16}/>}
          {rating && (<react_native_1.Text style={{ color: textColor }}>
              {Number(rating).toFixed(decimals)}
            </react_native_1.Text>)}
        </react_native_1.View>
      </react_native_1.View>
    </react_native_1.Pressable>);
};
exports.FloatingActionCard = FloatingActionCard;