141 lines
7.7 KiB
TypeScript
141 lines
7.7 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] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as UseMessageRequestTimestampTextModule from '../hooks/useMessageRequestTimestampText.tsx'; /* Metro dependency 15237 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = JsxRuntimeModule;
|
|
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;
|
|
object = {};
|
|
const object2 = {};
|
|
const AVATAR_SIZE_MAP = (NativeModule).AVATAR_SIZE_MAP;
|
|
const AvatarSizes = (NativeModule).AvatarSizes;
|
|
const NORMAL = AvatarSizes.NORMAL;
|
|
object2.borderRadius = AVATAR_SIZE_MAP[NORMAL] / 2;
|
|
const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH;
|
|
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object.avatar = object2;
|
|
object.avatarContainer = {'marginRight': 16, 'alignItems': 'flex-start', 'height': '100%'};
|
|
object.detailsContainer = {'marginRight': 8, 'justifyContent': 'flex-start', 'alignItems': 'flex-start', 'flex': 1};
|
|
object.messageDetails = {'flexDirection': 'row', 'alignItems': 'center'};
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (Native).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object.username = {flexShrink: 1, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
object.timestampSeparator = {marginHorizontal: 6};
|
|
object.messagePreview = {marginTop: 2};
|
|
object.usernameTextContainer = {flexShrink: 1};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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 = (FluxModule).useStateFromStores([RelationshipStore], _fun116554);
|
|
const value5 = (UseMessageRequestTimestampTextModule).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 = (NativeModule).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 = (TextModule).Text;
|
|
const Text2 = (TextModule).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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun116552, 15236, [31, 27, 3793, 33, 4501, 1305, 697, 566, 3995, 15237, 1426, 4573, 1244, 15238, 15239,
|
|
2]) /* metro module 15236, dependencies: [31, 27, 3793, 33, 4501, 1305, 697, 566, 3995, 15237, 1426, 4573, 1244, 15238, 15239, 2] */;
|