alert-toast-react-native
Version:
## Example Dialog Box
28 lines (21 loc) • 1.31 kB
JavaScript
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; }
import ReactNative, { Platform } from 'react-native';
import ENV from '../config/ENV';
class Color {}
_defineProperty(Color, "colorsCustom", void 0);
_defineProperty(Color, "get", (key, isDark) => {
var _ReactNative$Platform, _ReactNative$Platform2;
if (Color.colorsCustom) {
const index = isDark && Color.colorsCustom.length === 2 ? 1 : 0;
return Color.colorsCustom[index][key];
}
const color = ENV.COLORS[key];
const index = !isDark ? 0 : 1;
const i_a = Platform.select({
ios: (_ReactNative$Platform = ReactNative === null || ReactNative === void 0 ? void 0 : ReactNative.PlatformColor(color.ios)) !== null && _ReactNative$Platform !== void 0 ? _ReactNative$Platform : color.default[index],
android: (_ReactNative$Platform2 = ReactNative === null || ReactNative === void 0 ? void 0 : ReactNative.PlatformColor(color.android[index])) !== null && _ReactNative$Platform2 !== void 0 ? _ReactNative$Platform2 : color.default[index]
});
return i_a !== null && i_a !== void 0 ? i_a : color.default[index];
});
export default Color;
//# sourceMappingURL=color.js.map