Files
discord-decomp/sources/modules/app_icons/native/AppIconRows.tsx
T
2026-07-27 16:20:00 +03:00

106 lines
5.6 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] */
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_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_7 = (require(31) /* metro dependency 31 */).createElement;
const value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.Fragment;
const env0_10 = value.jsxs;
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {padding: 16},
bottomUpsellPadding: {paddingBottom: 56}});
(require(2) /* metro dependency 2 */).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(env0_4.useState(false), 2);
const icons = value.icons;
const title = value.title;
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const N4YDao = (require(1244) /* metro dependency 1244: indexNative */).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 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 object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles();
const {officialAppIcons, limitedTimeAppIcons,
currentAppIcon} = (require(12187) /* metro dependency 12187: AppIconUtils */).useAppIcons();
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const isPremium2 = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).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>
</>
);
}
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 = (require(7903) /* metro dependency 7903: AppIconTypes */).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 object2 = {};
copyDataProperties(object2, env0_0, undefined);
object2['key'] = a0.id;
object2['icon'] = a0;
object2['showEasterEgg'] = env0_1;
object2['onLongPress'] = BackwardsCompatibleAppIconRowsOnLongPress;
return createElementBinding(value, object2);
}