97 lines
6.2 KiB
TypeScript
97 lines
6.2 KiB
TypeScript
/* Metro module 15236; source: modules/message_request/native/MessageRequestRowSenderDetails.tsx; dependencies: [31, 27, 3793, 33, 4501, 1305, 697, 566, 3995, 15237, 1426, 4573, 1244, 15238, 15239, 2] */
|
|
function _fun116552(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15433:6, offset: 0x0248e126, size: 435 bytes, params: 8, frame: 24
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value.jsx;
|
|
const env0_6 = value.jsxs;
|
|
const env0_7 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object3 = {};
|
|
const object4 = {};
|
|
const AVATAR_SIZE_MAP = (require(1305) /* metro dependency 1305: native */).AVATAR_SIZE_MAP;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
const NORMAL = AvatarSizes.NORMAL;
|
|
object4.borderRadius = AVATAR_SIZE_MAP[NORMAL] / 2;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object3.avatar = object4;
|
|
object3.avatarContainer = {'marginRight': 16, 'alignItems': 'flex-start', 'height': '100%'};
|
|
object3.detailsContainer = {'marginRight': 8, 'justifyContent': 'flex-start', 'alignItems': 'flex-start', 'flex': 1};
|
|
object3.messageDetails = {'flexDirection': 'row', 'alignItems': 'center'};
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object3.username = {flexShrink: 1, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
object3.timestampSeparator = {marginHorizontal: 6};
|
|
object3.messagePreview = {marginTop: 2};
|
|
object3.usernameTextContainer = {flexShrink: 1};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/message_request/native/MessageRequestRowSenderDetails.tsx');
|
|
exports.default = MessageRequestRowSenderDetails;
|
|
}
|
|
|
|
function MessageRequestRowSenderDetails({channel, otherUser, isRestricted}) { // fn#116553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15433:835, offset: 0x0248e2d9, size: 953 bytes, params: 2, frame: 38
|
|
var intl;
|
|
isRestricted = !(isRestricted === undefined) && isRestricted;
|
|
const styles = useStyles();
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([RelationshipStore], _fun116554);
|
|
const value5 = (require(15237) /* metro dependency 15237: useMessageRequestTimestampText */).useMessageRequestRelativeTimestampText(channel);
|
|
const Math = global.Math;
|
|
const floor = Math.floor;
|
|
const Math2 = global.Math;
|
|
const value6 = Math2.random();
|
|
let DEFAULT_AVATARS = (importDefault(1426) /* metro dependency 1426: AvatarUtils */).DEFAULT_AVATARS;
|
|
const value7 = Reflect.apply(floor, Math, [value6 * DEFAULT_AVATARS.length]);
|
|
DEFAULT_AVATARS = (importDefault(1426) /* metro dependency 1426: AvatarUtils */).DEFAULT_AVATARS;
|
|
const property = DEFAULT_AVATARS[value7];
|
|
const jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
const view = <View style={styles.avatarContainer}><Avatar {...otherUser != null ? {avatarStyle: styles.avatar,
|
|
user: otherUser, guildId: undefined, disablePlaceholder: true,
|
|
avatarDecoration: otherUser?.avatarDecoration} : {avatarStyle: styles.avatar, source: property}} /></View>;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const Text2 = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
let r23 = value4 ?? otherUser?.username;
|
|
if (r23 == null) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r23 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['30mdIx']);
|
|
}
|
|
const items4 = [<Text lineClamp={1} variant="text-md/semibold" color="mobile-text-heading-primary" style={styles.usernameTextContainer}><Text2 variant="text-md/semibold" color="mobile-text-heading-primary" style={styles.username}>{r23}</Text2>{value4 != null && <Text variant="text-md/medium" color="text-muted">{' '}{(require(3995) /* metro dependency 3995: UserUtils */).getUserTag(otherUser)}</Text>}</Text>];
|
|
items4[1] = <Text style={styles.timestampSeparator} variant="text-xs/medium" color="text-muted">{'·'}</Text>;
|
|
items4[2] = <Text variant="text-xs/semibold" color="text-muted">{value5}</Text>;
|
|
return (
|
|
<>
|
|
{view}
|
|
<View style={styles.detailsContainer}>
|
|
<View style={styles.messageDetails}>
|
|
{items4}
|
|
</View>
|
|
{!isRestricted && ((Component) => <Component style={styles.messagePreview} channel={channel} />)(importDefault(15238) /* metro dependency 15238: MessageRequestPreview */)}
|
|
{isRestricted && otherUser != null && ((Component) => <Component style={styles.messagePreview} userId={otherUser.id} />)(importDefault(15239) /* metro dependency 15239: MessageRequestMutualServers */)}
|
|
</View>
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _fun116554() { // fn#116554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15433:964, offset: 0x0248e692, size: 85 bytes, params: 1, frame: 14
|
|
var r1;
|
|
var defaultImport;
|
|
if (otherUser == null) {
|
|
return null;
|
|
}
|
|
const nickname = RelationshipStore.getNickname(otherUser.id);
|
|
if (nickname != null) {
|
|
r1 = nickname;
|
|
} else {
|
|
defaultImport = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
r1 = defaultImport.getGlobalName(otherUser);
|
|
}
|
|
return r1;
|
|
}
|
|
|