120 lines
6.8 KiB
TypeScript
120 lines
6.8 KiB
TypeScript
/* Metro module 13925; source: modules/app_icons/native/AppIconRows.tsx; dependencies: [57, 31, 27, 1878, 33, 4501, 7903, 6231, 1244, 13926, 12187, 566, 1900, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumTypeUtilsModule from '../../../utils/PremiumTypeUtils.tsx'; /* Metro dependency 1900 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TableRowGroupNativeModule from '../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
|
|
import * as AppIconTypesModule from '../AppIconTypes.tsx'; /* Metro dependency 7903 */
|
|
import * as AppIconUtilsModule from './AppIconUtils.tsx'; /* Metro dependency 12187 */
|
|
|
|
function _fun105701(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#105701, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14122:6, offset: 0x022c09b9, size: 300 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_11 = (CreateStylesModule).createStyles({container: {padding: 16},
|
|
bottomUpsellPadding: {paddingBottom: 56}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/app_icons/native/AppIconRows.tsx');
|
|
exports.default = AppIconRows;
|
|
function BackwardsCompatibleAppIconRows(a0) { // fn#105702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14122:293, offset: 0x022c0ae5, size: 305 bytes, params: 2, frame: 25
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", undefined);
|
|
throw undefined;
|
|
}
|
|
const value = copyDataProperties({}, a0, undefined, undefined);
|
|
const env0_3 = undefined;
|
|
const styles = useStyles();
|
|
const [env0_1, env0_2] = env0_3(ReactModule.useState(false), 2);
|
|
const icons = value.icons;
|
|
const title = value.title;
|
|
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const N4YDao = (IndexNativeModule).t.N4YDao;
|
|
return (
|
|
<View style={styles.container}>
|
|
<TableRowGroup
|
|
title={title}
|
|
accessibilityRole="radiogroup"
|
|
accessibilityLabel={Reflect.apply(string, intl, [N4YDao])}
|
|
hasIcons
|
|
>
|
|
{icons.map(_fun105704)}
|
|
</TableRowGroup>
|
|
</View>
|
|
);
|
|
function BackwardsCompatibleAppIconRowsOnLongPress(a0) { // fn#105703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14122:423, owner: BackwardsCompatibleAppIconRows.onLongPress, offset: 0x022c0c16, size: 62 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
const FreemiumAppIconIds = (AppIconTypesModule).FreemiumAppIconIds;
|
|
const DEFAULT = FreemiumAppIconIds.DEFAULT;
|
|
return a0 !== DEFAULT ? null : env0_2(true);
|
|
}
|
|
|
|
function _fun105704(a0) { // fn#105704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14122:664, offset: 0x022c0c54, size: 107 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
const createElementBinding = createElement;
|
|
value = importDefault(13926) /* metro dependency 13926: AppIconRow */;
|
|
const object = {};
|
|
copyDataProperties(object, env0_0, undefined);
|
|
object['key'] = a0.id;
|
|
object['icon'] = a0;
|
|
object['showEasterEgg'] = env0_1;
|
|
object['onLongPress'] = BackwardsCompatibleAppIconRowsOnLongPress;
|
|
return createElementBinding(value, object);
|
|
}
|
|
|
|
}
|
|
|
|
function AppIconRows({onSelect}) { // fn#105705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14122:832, offset: 0x022c0cbf, size: 449 bytes, params: 2, frame: 29
|
|
var r5;
|
|
var object;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const styles = useStyles();
|
|
const {officialAppIcons, limitedTimeAppIcons,
|
|
currentAppIcon} = (AppIconUtilsModule).useAppIcons();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const isPremium2 = (PremiumTypeUtilsModule).isPremium(currentUser);
|
|
const r14 = limitedTimeAppIcons.length > 0 && limitedTimeAppIcons.filter(function(a0) {
|
|
return !a0.isHidden;
|
|
}).length > 0;
|
|
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
|
|
if (r14) {
|
|
r5 = (
|
|
<BackwardsCompatibleAppIconRows
|
|
hasNitro={isPremium2}
|
|
icons={limitedTimeAppIcons}
|
|
currentAppIcon={currentAppIcon}
|
|
title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.anqaFd)}
|
|
onSelect={onSelect}
|
|
/>
|
|
);
|
|
} else {
|
|
r5 = null;
|
|
}
|
|
return (
|
|
<>
|
|
{r5}
|
|
<View style={!isPremium2 && styles.bottomUpsellPadding}>
|
|
<BackwardsCompatibleAppIconRows
|
|
hasNitro={isPremium2}
|
|
icons={officialAppIcons}
|
|
currentAppIcon={currentAppIcon}
|
|
title={r14 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ipxkog) : undefined}
|
|
onSelect={onSelect}
|
|
/>
|
|
</View>
|
|
</>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun105701, 13925, [57, 31, 27, 1878, 33, 4501, 7903, 6231, 1244, 13926, 12187, 566, 1900,
|
|
2]) /* metro module 13925, dependencies: [57, 31, 27, 1878, 33, 4501, 7903, 6231, 1244, 13926, 12187, 566, 1900, 2] */;
|