87 lines
5.3 KiB
TypeScript
87 lines
5.3 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] */
|
|
import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
|
|
import LocaleStore from '../../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
|
|
import UseCountdown from '../../../hooks/useCountdown.tsx'; /* Metro dependency 7054 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const object2 = {'borderRadius': null, 'paddingHorizontal': 8, 'paddingVertical': 2};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object.root = object2;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
|
|
object.backgroundDarkMode = {backgroundColor: WHITE};
|
|
const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
|
|
object.backgroundLightMode = {backgroundColor: BACKGROUND_MOD_STRONG};
|
|
const env0_7 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
(FileImportTrackerModule).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();
|
|
let useStateFromStores = FluxModule.useStateFromStores;
|
|
const value2 = Reflect.apply(useStateFromStores, FluxModule, [[ThemeStore], function() {
|
|
return require(dependencyMap[9]).isThemeDark(ThemeStore.theme);
|
|
}]);
|
|
useStateFromStores = FluxModule.useStateFromStores;
|
|
const value3 = ['en-US', 'en-GB'].includes(Reflect.apply(useStateFromStores, FluxModule, [[LocaleStore],
|
|
function() {
|
|
return LocaleStore.locale;
|
|
}]));
|
|
const {days, hours} = (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 = (TextModule).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>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun78619, 10056, [31, 27, 1949, 1310, 33, 4501, 697, 1244, 566, 4002, 7054, 4573,
|
|
2]) /* metro module 10056, dependencies: [31, 27, 1949, 1310, 33, 4501, 697, 1244, 566, 4002, 7054, 4573, 2] */;
|