174 lines
10 KiB
TypeScript
174 lines
10 KiB
TypeScript
/* Metro module 14921; source: modules/user_profile/native/UserProfileYourFriendsCard.tsx; dependencies: [57, 31, 27, 5221, 3793, 1878, 661, 33, 1305, 4501, 697, 566, 10341, 7693, 22, 1360, 5278, 1244, 4573, 6818, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import UserAffinitiesV2Store from '../../user_affinities/UserAffinitiesV2Store.tsx'; /* Metro dependency 5221 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as GlobalUtilsModule from '../../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as ChevronSmallRightIconModule from '../../../design/components/Icon/native/redesign/generated/ChevronSmallRightIcon.tsx'; /* Metro dependency 6818 */
|
|
import * as UserAffinitiesActionCreatorsModule from '../../user_affinities/UserAffinitiesActionCreators.tsx'; /* Metro dependency 7693 */
|
|
import * as GameRelationshipStoreHooksModule from '../../game_relationships/GameRelationshipStoreHooks.tsx'; /* Metro dependency 10341 */
|
|
|
|
function _fun112883(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:6, offset: 0x023e00df, size: 439 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
Object = global.Object;
|
|
const freeze = Object.freeze;
|
|
const CutoutDirection = (NativeModule).CutoutDirection;
|
|
const RIGHT = CutoutDirection.RIGHT;
|
|
const env0_12 = Reflect.apply(freeze, Object, [{direction: RIGHT, inset: -4}]);
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object2 = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center', 'padding': 16};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const env0_13 = Reflect.apply(createStyles, value, [{pressable: object2, label: {flex: 1},
|
|
facepile: {'flexDirection': 'row', 'alignItems': 'center', 'marginLeft': 'auto', 'marginRight': 8},
|
|
avatars: {flexDirection: 'row'}}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileYourFriendsCard.tsx');
|
|
exports.default = UserProfileYourFriendsCard;
|
|
function UserProfileYourFriendsCard({navigateToFriends, style}) { // fn#112884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:648, offset: 0x023e0296, size: 607 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const [property, env0_2] = Module00057(ReactModule.useState([]), 2);
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([UserAffinitiesV2Store],
|
|
_fun112885);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([RelationshipStore],
|
|
function() {
|
|
return RelationshipStore.getFriendIDs();
|
|
});
|
|
const useGameRelationshipsByType = GameRelationshipStoreHooksModule.useGameRelationshipsByType;
|
|
const FRIEND = RelationshipTypes.FRIEND;
|
|
const value6 = Reflect.apply(useGameRelationshipsByType, GameRelationshipStoreHooksModule, [FRIEND]);
|
|
ReactModule.useEffect(_fun112888, []);
|
|
ReactModule.useEffect(_fun112889, [value4, value5, value6]);
|
|
const value7 = ReactModule.useMemo(_fun112892, [property, styles.avatars, styles.facepile]);
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
object = {accessibilityRole: 'button'};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
let TdEu5X = (require(1244) /* metro dependency 1244: indexNative */).t.TdEu5X;
|
|
object.accessibilityLabel = Reflect.apply(string, intl, [TdEu5X]);
|
|
object.onPress = navigateToFriends;
|
|
object.style = [style, styles.pressable];
|
|
object.activeOpacity = 0.8;
|
|
const Text = (TextModule).Text;
|
|
string = intl.string;
|
|
TdEu5X = (require(1244) /* metro dependency 1244: indexNative */).t.TdEu5X;
|
|
const text = (
|
|
<Text
|
|
accessibilityRole="header"
|
|
variant="text-sm/semibold"
|
|
color="text-default"
|
|
style={styles.label}
|
|
>
|
|
{Reflect.apply(string, intl, [TdEu5X])}
|
|
</Text>
|
|
);
|
|
const ChevronSmallRightIcon = (ChevronSmallRightIconModule).ChevronSmallRightIcon;
|
|
return (
|
|
<PressableOpacity {...object}>
|
|
{text}
|
|
{value7}
|
|
<ChevronSmallRightIcon size="sm" />
|
|
</PressableOpacity>
|
|
);
|
|
function _fun112885() { // fn#112885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:805, offset: 0x023e04f5, size: 38 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return UserAffinitiesV2Store.getUserAffinities().map(function(a0) {
|
|
return a0.otherUserId;
|
|
});
|
|
}
|
|
|
|
function _fun112888() { // fn#112888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:985, offset: 0x023e052e, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(UserAffinitiesActionCreatorsModule).fetchUserAffinitiesV2();
|
|
}
|
|
|
|
function _fun112889() { // fn#112889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:1042, offset: 0x023e0553, size: 334 bytes, params: 1, frame: 21
|
|
var environment;
|
|
var defaultImport2;
|
|
var value12;
|
|
var value13;
|
|
var binding;
|
|
var items2;
|
|
let value = environment.__proto__;
|
|
const value3 = (importDefault(22) /* metro dependency 22 */).chain(Module00057);
|
|
let filter = value3.filter;
|
|
const value5 = Reflect.apply(filter, value3, [_fun112890]).take(5);
|
|
const map = value5.map;
|
|
const getUser = UserStore.getUser;
|
|
const value6 = Reflect.apply(map, value5, [getUser]);
|
|
filter = value6.filter;
|
|
const isNotNullish = (GlobalUtilsModule).isNotNullish;
|
|
const value9 = Reflect.apply(filter, value6, [isNotNullish]).value();
|
|
if (value9.length >= 5) {
|
|
env0_2(value9);
|
|
} else {
|
|
defaultImport2 = importDefault(22) /* metro dependency 22 */;
|
|
value12 = defaultImport2.chain(ReactNativeModule.View).map(function(a0) {
|
|
return a0.id;
|
|
}).uniq();
|
|
value13 = value12.take(5 - value9.length);
|
|
value = value13.map(UserStore.getUser).filter(isNotNullish);
|
|
value = value.value();
|
|
binding = env0_2;
|
|
items2 = [];
|
|
arraySpread(items2, value, arraySpread(items2, value9, 0, defaultImport2), defaultImport2);
|
|
binding(items2);
|
|
}
|
|
function _fun112890(a0) { // fn#112890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:1080, offset: 0x023e06a1, size: 22 bytes, params: 2, frame: 11
|
|
return env1_4.includes(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun112892() { // fn#112892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:1350, offset: 0x023e06b7, size: 89 bytes, params: 1, frame: 16
|
|
const stylesBinding = styles;
|
|
return (
|
|
<View style={stylesBinding.facepile}>
|
|
<View style={stylesBinding.avatars}>
|
|
{env0_1.map(_fun112893)}
|
|
</View>
|
|
</View>
|
|
);
|
|
function _fun112893(a0, a1) { // fn#112893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15118:1422, offset: 0x023e0710, size: 188 bytes, params: 3, frame: 25
|
|
const object2 = {};
|
|
const binding = env1_1;
|
|
object2.transform = [{translateX: 4 * (binding.length - 1 - a1)}];
|
|
const value3 = undefined;
|
|
const CutoutableAvatarImage = (NativeModule).CutoutableAvatarImage;
|
|
const AvatarSizes = (NativeModule).AvatarSizes;
|
|
const XSMALL = AvatarSizes.XSMALL;
|
|
return (
|
|
<View style={object2} key={a0.id}>
|
|
<CutoutableAvatarImage
|
|
user={a0}
|
|
guildId={value3}
|
|
size={XSMALL}
|
|
cutout={a1 < binding.length - 1 ? env2_12 : value3}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun112883, 14921, [57, 31, 27, 5221, 3793, 1878, 661, 33, 1305, 4501, 697, 566, 10341, 7693, 22, 1360,
|
|
5278, 1244, 4573, 6818,
|
|
2]) /* metro module 14921, dependencies: [57, 31, 27, 5221, 3793, 1878, 661, 33, 1305, 4501, 697, 566, 10341, 7693, 22, 1360, 5278, 1244, 4573, 6818, 2] */;
|