@arpitbhalla/rneui-base-dev
Version:
Cross Platform React Native UI Toolkit
61 lines (60 loc) • 2.83 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardBase = void 0;
var react_1 = __importDefault(require("react"));
var react_native_1 = require("react-native");
var helpers_1 = require("../helpers");
var CardBase = function (_a) {
var _b, _c;
var children = _a.children, containerStyle = _a.containerStyle, wrapperStyle = _a.wrapperStyle, _d = _a.theme, theme = _d === void 0 ? helpers_1.defaultTheme : _d, rest = __rest(_a, ["children", "containerStyle", "wrapperStyle", "theme"]);
return (react_1.default.createElement(react_native_1.View, __assign({}, rest, { style: react_native_1.StyleSheet.flatten([
__assign({ backgroundColor: (_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b.white, borderWidth: 1, padding: 15, margin: 15, marginBottom: 0, borderColor: (_c = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _c === void 0 ? void 0 : _c.grey5 }, react_native_1.Platform.select({
android: {
elevation: 1,
},
default: {
shadowColor: 'rgba(0,0,0, .2)',
shadowOffset: { height: 0, width: 0 },
shadowOpacity: 1,
shadowRadius: 1,
},
})),
containerStyle && containerStyle,
]) }),
react_1.default.createElement(react_native_1.View, { style: react_native_1.StyleSheet.flatten([
styles.wrapper,
wrapperStyle && wrapperStyle,
]) }, children)));
};
exports.CardBase = CardBase;
var styles = react_native_1.StyleSheet.create({
wrapper: {
backgroundColor: 'transparent',
},
});
exports.CardBase.displayName = 'Card';