82 lines
4.5 KiB
TypeScript
82 lines
4.5 KiB
TypeScript
/* Metro module 10056; source: modules/collectibles/native/LimitedTimeBadge.tsx; dependencies: [31, 27, 1949, 1310, 33, 4501, 697, 1244, 566, 4002, 7054, 4573, 2] */
|
|
function _fun78619(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10242:6, offset: 0x01e2e23e, size: 329 bytes, params: 8, frame: 22
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
|
|
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
|
|
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object3 = {};
|
|
const object4 = {'borderRadius': null, 'paddingHorizontal': 8, 'paddingVertical': 2};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object3.root = object4;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
|
|
object3.backgroundDarkMode = {backgroundColor: WHITE};
|
|
const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
|
|
object3.backgroundLightMode = {backgroundColor: BACKGROUND_MOD_STRONG};
|
|
const env0_7 = Reflect.apply(createStyles, createStylesModule, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/collectibles/native/LimitedTimeBadge.tsx');
|
|
exports.default = _default_78620;
|
|
}
|
|
|
|
function _default_78620({unpublishedAt, style}) { // fn#78620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10242:396, offset: 0x01e2e387, size: 814 bytes, params: 2, frame: 25
|
|
var r7;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var value5;
|
|
const styles = useStyles();
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
let useStateFromStores = fluxModule.useStateFromStores;
|
|
const value2 = Reflect.apply(useStateFromStores, fluxModule, [[ThemeStore], function() {
|
|
return require(dependencyMap[9]).isThemeDark(ThemeStore.theme);
|
|
}]);
|
|
const moduleValue2 = fluxModule;
|
|
useStateFromStores = moduleValue2.useStateFromStores;
|
|
const value3 = ['en-US', 'en-GB'].includes(Reflect.apply(useStateFromStores, moduleValue2, [[LocaleStore],
|
|
function() {
|
|
return LocaleStore.locale;
|
|
}]));
|
|
const {days, hours} = (importDefault(7054) /* metro dependency 7054: useCountdown */)(unpublishedAt, 1000,
|
|
undefined, true);
|
|
if (value3) {
|
|
r7 = days > 1 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.DkxLY0,
|
|
{days: days}) : days <= 1 && hours > 0 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.WJieZ2,
|
|
|
|
{hours: hours}) : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.WJieZ2,
|
|
|
|
{hours: 0});
|
|
} else {
|
|
string = intl.string;
|
|
value5 = days + Reflect.apply(string, intl, [t.QJyuxY]);
|
|
string = intl.string;
|
|
r7 = days > 1 ? value5 : days <= 1 && hours > 0 ? hours + Reflect.apply(string, intl,
|
|
[t['1LyF1h']]) : '0' + intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1LyF1h']);
|
|
}
|
|
const items2 = [styles.root];
|
|
items2[1] = value2 ? styles.backgroundDarkMode : styles.backgroundLightMode;
|
|
items2[2] = style;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const r9 = value2 ? 'black' : 'white';
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const TlZULM = (require(1244) /* metro dependency 1244: indexNative */).t.TlZULM;
|
|
return (
|
|
<View style={items2}>
|
|
<Text
|
|
color={r9}
|
|
variant="text-xs/bold"
|
|
accessibilityLabel={Reflect.apply(formatToPlainString, intl, [TlZULM, {daysLeft: days}])}
|
|
allowFontScaling={false}
|
|
>
|
|
{r7}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|