react-native-alert-notification
Version:
Toast notification and dialog box notification for react native
40 lines (27 loc) • 2.36 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Color = void 0;
var _reactNative = _interopRequireWildcard(require("react-native"));
var _config = require("../config");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
class Color {}
exports.Color = Color;
_defineProperty(Color, "colorsCustom", void 0);
_defineProperty(Color, "get", (key, isDark) => {
if (Color.colorsCustom) {
const index = isDark && Color.colorsCustom.length === 2 ? 1 : 0;
return Color.colorsCustom[index][key];
}
const color = _config.ENV.COLORS[key];
const index = !isDark ? 0 : 1;
const i_a = _reactNative.Platform.select({
ios: (_reactNative.default === null || _reactNative.default === void 0 ? void 0 : _reactNative.default.PlatformColor(color.ios)) ?? color.default[index],
android: (_reactNative.default === null || _reactNative.default === void 0 ? void 0 : _reactNative.default.PlatformColor(color.android[index])) ?? color.default[index]
});
return i_a ?? color.default[index];
});
//# sourceMappingURL=color.js.map
;