120 lines
7.8 KiB
TypeScript
120 lines
7.8 KiB
TypeScript
/* Metro module 13226; source: modules/user_profile/native/UserProfilePrimaryGuildEditButton.tsx; dependencies: [31, 1867, 8187, 33, 4501, 697, 566, 13227, 8400, 8401, 1244, 477, 4573, 13209, 4080, 13228, 1962, 6819, 9299, 2] */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
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 GuildTagConstantsModule from '../../guild_tag/GuildTagConstants.tsx'; /* Metro dependency 8187 */
|
|
import * as UserProfileSettingsActionCreatorsModule from '../UserProfileSettingsActionCreators.tsx'; /* Metro dependency 8400 */
|
|
|
|
function _fun100888(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13416:6, offset: 0x021feb90, size: 249 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const object2 = {'paddingHorizontal': 6, 'paddingVertical': 2, 'columnGap': 4};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const env0_6 = Reflect.apply(createStyles, CreateStylesModule, [{tag: object2}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfilePrimaryGuildEditButton.tsx');
|
|
exports.default = UserProfilePrimaryGuildEditButton;
|
|
function UserProfilePrimaryGuildEditButton({user, disabled, tagStyle, pendingPrimaryGuildId}) { // fn#100889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13416:378, offset: 0x021fec89, size: 880 bytes, params: 2, frame: 32
|
|
var profile;
|
|
var r11;
|
|
var r8;
|
|
var r9;
|
|
var r6;
|
|
var value8;
|
|
var moduleValue3;
|
|
var value10;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var tag;
|
|
var value15;
|
|
var UserProfileEditFormButton;
|
|
var BaseGuildTagChiplet;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const r0 = pendingPrimaryGuildId !== undefined ? pendingPrimaryGuildId : user.primaryGuild != null && user.primaryGuild.identityEnabled ? user.primaryGuild?.identityGuildId : null;
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
const items = [GuildStore];
|
|
const value4 = Reflect.apply(useStateFromStores, FluxModule, [items, _fun100890, [r0]]);
|
|
if (user != null) {
|
|
if ((require(13227) /* metro dependency 13227: useUserAvailableGuildsWithTags */).useUserAvailableGuildsWithTags().length > 0) {
|
|
profile = value4?.profile;
|
|
value8 = value4 != null;
|
|
if (value8) {
|
|
moduleValue3 = require(8401) /* metro dependency 8401: GuildTagUtils */;
|
|
r11 = moduleValue3.getGuildTagBadgeUrl(value4.id, profile?.badge ?? undefined,
|
|
GuildTagBadgeSize.SIZE_24);
|
|
} else {
|
|
r11 = value8;
|
|
}
|
|
value10 = value4 != null;
|
|
r8 = value10 ? value4.name : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ECv270);
|
|
r9 = profile == null ? r8 : '' + r8 + ', ' + profile.tag;
|
|
value15 = (require(4573) /* metro dependency 4573: Text */).TextStyleSheet['text-md/semibold'].fontSize + ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 1 : 4);
|
|
UserProfileEditFormButton = (require(13209) /* metro dependency 13209: UserProfileEditFormControls */).UserProfileEditFormButton;
|
|
var userProfileEditFormButtonProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['DUD+5n']),
|
|
|
|
|
|
buttonText: r8, accessibilityValue: {text: r9}, onPress: onPress_100892};
|
|
r6 = (
|
|
value10
|
|
? ((Component) => <Component guild={value4} size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.LARGE} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */)
|
|
: null
|
|
);
|
|
userProfileEditFormButtonProps.leading = r6;
|
|
if (profile != null) {
|
|
BaseGuildTagChiplet = (require(9299) /* metro dependency 9299: GuildTag */).BaseGuildTagChiplet;
|
|
tag = styles.tag;
|
|
items2 = [tag, tagStyle];
|
|
tag = profile.tag;
|
|
r6 = (
|
|
<BaseGuildTagChiplet
|
|
containerStyles={items2}
|
|
textStyle={{lineHeight: value15}}
|
|
guildTag={tag ?? undefined}
|
|
guildBadge={r11}
|
|
badgeSize={GuildTagBadgeSize.SIZE_16}
|
|
textVariant="text-md/semibold"
|
|
textColor="text-default"
|
|
/>
|
|
);
|
|
} else {
|
|
r6 = null;
|
|
}
|
|
userProfileEditFormButtonProps.trailing = r6;
|
|
userProfileEditFormButtonProps.disabled = disabled;
|
|
return <UserProfileEditFormButton {...userProfileEditFormButtonProps} />;
|
|
}
|
|
}
|
|
return null;
|
|
function _fun100890() { // fn#100890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13416:643, offset: 0x01c08a2c, size: 27 bytes, params: 1, frame: 11
|
|
return GuildStore.getGuild(env0_0);
|
|
}
|
|
|
|
function handleSelectPrimaryGuild(a0) { // fn#100891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13416:748, owner: UserProfilePrimaryGuildEditButton.handleSelectPrimaryGuild, offset: 0x021feff9, size: 48 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(UserProfileSettingsActionCreatorsModule).setPendingChanges({primaryGuildId: a0});
|
|
}
|
|
|
|
function UserProfilePrimaryGuildEditButtonOnPress() { // fn#100892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13416:1275, owner: UserProfilePrimaryGuildEditButton.onPress, offset: 0x021ff029, size: 125 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[14]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[16]);
|
|
value = value(dependencyMap[15], dependencyMap.paths);
|
|
const value3 = null;
|
|
Reflect.apply(openLazy, defaultImport, [value, 'UserPrimaryGuildListBottomSheet', {availableGuilds: env0_2,
|
|
userPrimaryGuild: value3 != env0_1 ? env0_1 : value3, onSelectGuild: handleSelectPrimaryGuild}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100888, 13226, [31, 1867, 8187, 33, 4501, 697, 566, 13227, 8400, 8401, 1244, 477, 4573, 13209, 4080,
|
|
13228, 1962, 6819, 9299,
|
|
2]) /* metro module 13226, dependencies: [31, 1867, 8187, 33, 4501, 697, 566, 13227, 8400, 8401, 1244, 477, 4573, 13209, 4080, 13228, 1962, 6819, 9299, 2] */;
|