124 lines
7.4 KiB
TypeScript
124 lines
7.4 KiB
TypeScript
/* Metro module 12140; source: modules/guild_settings/native/DetailedGuildIdentityUserRow.tsx; dependencies: [31, 27, 1878, 33, 4501, 697, 4617, 3995, 9210, 1305, 566, 7972, 6238, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
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 CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
|
|
function _fun93182(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12326:6, offset: 0x020a9e86, size: 344 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {mainIdentity: {'flexDirection': 'row', 'alignItems': 'center'}};
|
|
const PX_4 = (Native).space.PX_4;
|
|
object.primaryAvatar = {marginRight: PX_4};
|
|
const INTERACTIVE_TEXT_DEFAULT = (Native).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
object.mainTag = {color: INTERACTIVE_TEXT_DEFAULT, fontSize: 12};
|
|
const env0_7 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
const value4 = value.memo(_fun93183);
|
|
value = value.memo(DetailedGuildIdentityUserRow);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_settings/native/DetailedGuildIdentityUserRow.tsx');
|
|
exports.default = value;
|
|
exports.DetailedGuildIdentityUser = value4;
|
|
function _fun93183({contentHeight, guildId, user}) { // fn#93183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12326:364, offset: 0x020a9fde, size: 392 bytes, params: 2, frame: 30
|
|
var items2;
|
|
var value;
|
|
const styles = useStyles();
|
|
let r5 = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getNickname(guildId, undefined,
|
|
user) ?? (importDefault(3995) /* metro dependency 3995: UserUtils */).getGlobalName(user);
|
|
const hasAvatarForGuild2 = user.hasAvatarForGuild(guildId);
|
|
const object2 = {height: contentHeight};
|
|
const value5 = ((Component) => <Component user={user} nick={r5} />)(importDefault(9210) /* metro dependency 9210: DiscordTag */);
|
|
if (hasAvatarForGuild2) {
|
|
var viewBinding2Props = {style: styles.mainIdentity};
|
|
items2 = [
|
|
hasAvatarForGuild2
|
|
? ((Avatar) => <Avatar size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.SIZE_16} style={styles.primaryAvatar} user={user} guildId={undefined} />)((require(1305) /* metro dependency 1305: native */).Avatar)
|
|
: null,
|
|
];
|
|
value = importDefault(9210) /* metro dependency 9210: DiscordTag */;
|
|
items2[1] = ((Component) => <Component user={user} usernameStyle={styles.mainTag} hideBotTag />)(value);
|
|
value = (
|
|
<View {...viewBinding2Props}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
r5 = value;
|
|
} else if (r5 != null) {
|
|
var viewBinding2Props = {style: styles.mainIdentity};
|
|
items2 = [
|
|
hasAvatarForGuild2
|
|
? ((Avatar) => <Avatar size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.SIZE_16} style={styles.primaryAvatar} user={user} guildId={undefined} />)((require(1305) /* metro dependency 1305: native */).Avatar)
|
|
: null,
|
|
];
|
|
value = importDefault(9210) /* metro dependency 9210: DiscordTag */;
|
|
items2[1] = ((Component) => <Component user={user} usernameStyle={styles.mainTag} hideBotTag />)(value);
|
|
value = (
|
|
<View {...viewBinding2Props}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
r5 = value;
|
|
} else {
|
|
r5 = null;
|
|
}
|
|
return (
|
|
<View style={object2}>
|
|
{value5}
|
|
{r5}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function DetailedGuildIdentityUserRow({accessibilityLabel, arrow, contentHeight, deprecatedFormRow, disabled, end, guildId, leading, onPress, trailing, userId, subLabel, start, accessibilityRole, accessibilityState}) { // fn#93184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12326:820, offset: 0x020aa166, size: 565 bytes, params: 2, frame: 38
|
|
deprecatedFormRow = !(deprecatedFormRow === undefined) && deprecatedFormRow;
|
|
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getUser(userId);
|
|
});
|
|
if (user == null) {
|
|
return null;
|
|
} else if (deprecatedFormRow) {
|
|
const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
|
|
return (
|
|
<FormRow
|
|
accessibilityLabel={accessibilityLabel}
|
|
disabled={disabled}
|
|
leading={leading ?? ((Avatar) => <Avatar source={user.getAvatarSource(guildId)} size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.SMALL} />)((require(1305) /* metro dependency 1305: native */).Avatar)}
|
|
label={((Component) => <Component contentHeight={contentHeight} user={user} guildId={guildId} />)(env0_8)}
|
|
onPress={onPress}
|
|
subLabel={subLabel}
|
|
trailing={trailing}
|
|
accessibilityRole={accessibilityRole}
|
|
accessibilityState={accessibilityState}
|
|
/>
|
|
);
|
|
} else {
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
return (
|
|
<TableRow
|
|
accessibilityLabel={accessibilityLabel}
|
|
arrow={arrow}
|
|
disabled={disabled}
|
|
end={end}
|
|
icon={leading ?? ((Avatar) => <Avatar source={user.getAvatarSource(guildId)} size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.SMALL} />)((require(1305) /* metro dependency 1305: native */).Avatar)}
|
|
label={((Component) => <Component contentHeight={contentHeight} user={user} guildId={guildId} />)(env0_8)}
|
|
onPress={onPress}
|
|
start={start}
|
|
subLabel={subLabel}
|
|
trailing={trailing}
|
|
accessibilityRole={accessibilityRole}
|
|
accessibilityState={accessibilityState}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun93182, 12140, [31, 27, 1878, 33, 4501, 697, 4617, 3995, 9210, 1305, 566, 7972, 6238,
|
|
2]) /* metro module 12140, dependencies: [31, 27, 1878, 33, 4501, 697, 4617, 3995, 9210, 1305, 566, 7972, 6238, 2] */;
|