Files
discord-decomp/sources/modules/custom_status/native/CustomStatusPreview.tsx
T
2026-07-28 01:06:53 +03:00

130 lines
8.4 KiB
TypeScript

/* Metro module 8691; source: modules/custom_status/native/CustomStatusPreview.tsx; dependencies: [31, 27, 6816, 33, 4501, 697, 8490, 8501, 8494, 8496, 8497, 4015, 4080, 8692, 1962, 3868, 8507, 8510, 8511, 8513, 8695, 8474, 2] */
import UseDisplayProfile from '../../user_profile/hooks/useDisplayProfile.tsx'; /* Metro dependency 8490 */
import UseProfileTheme from '../../user_profile/hooks/useProfileTheme.tsx'; /* Metro dependency 8494 */
import UserProfileSharedStyles from '../../user_profile/native/UserProfileSharedStyles.tsx'; /* Metro dependency 8496 */
import UseBadges from '../../user_profile/hooks/useBadges.tsx'; /* Metro dependency 8501 */
import UserProfileBanner from '../../user_profile/native/UserProfileBanner.tsx'; /* Metro dependency 8507 */
import UserProfileAvatar from '../../user_profile/native/UserProfileAvatar.tsx'; /* Metro dependency 8510 */
import UserProfileGradientContainer from '../../user_profile/native/UserProfileGradientContainer.tsx'; /* Metro dependency 8511 */
import UserProfileCustomStatusBubble from '../../user_profile/native/UserProfileCustomStatusBubble.tsx'; /* Metro dependency 8513 */
import UserProfilePrimaryInfo from '../../user_profile/native/UserProfilePrimaryInfo.tsx'; /* Metro dependency 8695 */
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 NativeModule from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as ConstantsModule from '../../user_profile/native/Constants.tsx'; /* Metro dependency 6816 */
import * as UseUserProfileColorsModule from '../../user_profile/hooks/native/useUserProfileColors.tsx'; /* Metro dependency 8497 */
function _fun68302(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8876:6, offset: 0x01c47e2c, size: 237 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ConstantsModule;
const env0_5 = value.PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING;
const env0_6 = value.UserProfileThemeTypes;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
const env0_9 = (CreateStylesModule).createStyles(_fun68303);
(FileImportTrackerModule).fileFinishedImporting('modules/custom_status/native/CustomStatusPreview.tsx');
exports.default = CustomStatusPreview;
function _fun68303(a0) { // fn#68303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8876:255, offset: 0x01c47f19, size: 166 bytes, params: 2, frame: 18
const object2 = {'flex': 1, 'position': 'relative', 'overflow': 'hidden', 'width': 323, 'maxHeight': 301};
const value = 1;
object2.borderWidth = a0 ? undefined : value;
const colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderColor = a0 ? colors.BORDER_MUTED : colors.BACKGROUND_SURFACE_HIGH;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const SHADOW_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_HIGH;
copyDataProperties(object2, SHADOW_HIGH, importDefault);
return {profileContainer: object2, profileEffect: {zIndex: value}};
}
function CustomStatusPreview({user, pendingStatusText, pendingStatusEmoji, placeholderText}) { // fn#68304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8876:639, offset: 0x01c47fbf, size: 843 bytes, params: 2, frame: 40
var r8;
var value;
const value3 = (UseDisplayProfile)(user.id);
const value4 = (UseBadges)(value3);
const {theme, primaryColor,
secondaryColor} = (UseProfileTheme)({user: user,
displayProfile: value3});
const value6 = primaryColor != null;
const styles = useStyles(value6);
const value7 = (UserProfileSharedStyles)();
const {gradientFallbackBackground, avatarBackground,
containerBackground} = (UseUserProfileColorsModule).useUserProfileColors({theme: theme,
primaryColor: primaryColor, secondaryColor: secondaryColor});
const value9 = ReactModule.useCallback(_fun68305, [user, pendingStatusText, pendingStatusEmoji]);
const ThemeContextProvider = (NativeModule).ThemeContextProvider;
const items3 = [styles.profileContainer];
const items2 = [
((Component) => <Component user={user} displayProfile={value3} bannerHeight={132} disableInteraction />)(UserProfileBanner),
];
const value11 = ((Component) => <Component user={user} backgroundColor={avatarBackground} disableStatus />)(UserProfileAvatar);
const items4 = [value7.profileContentWrapper];
items4[1] = value7.profileContent;
let r18 = pendingStatusText !== '' || pendingStatusEmoji !== null;
r18 = !r18 ? placeholderText !== '' : r18;
items4[2] = !r18 && ({paddingTop: PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING});
const value16 = ((Component) => <Component hasCustomProfileTheme={value6} style={value7.customStatusBubble} emojiOnlyStyle={value7.emojiOnlyCustomStatusBubble} onPressTruncatedStatus={value9} previewEmoji={pendingStatusEmoji} previewText={pendingStatusText} placeholderText={placeholderText} />)(UserProfileCustomStatusBubble);
const PREVIEW = UserProfileThemeTypes.PREVIEW;
items2[1] = (
<View>
{value11}
<UserProfileGradientContainer
fallbackBackground={gradientFallbackBackground}
primaryColor={primaryColor}
secondaryColor={primaryColor}
containerStyle={items4}
>
{value16}
<UserProfilePrimaryInfo
user={user}
themeType={PREVIEW}
pronouns={value3?.pronouns}
badges={value4}
badgeContainerBackground={containerBackground}
showBadgeToastOnPress={false}
/>
</UserProfileGradientContainer>
</View>
);
const value17 = value3?.profileEffect != null;
if (value17) {
value = importDefault(8474) /* metro dependency 8474: ProfileEffect */;
value = ((Component) => <Component skuId={value3 == null ? undefined : value3.profileEffect.skuId} style={styles.profileEffect} />)(value);
r8 = value;
} else {
r8 = value17;
}
items2[2] = r8;
return (
<ThemeContextProvider
theme={theme}
primaryColor={primaryColor}
secondaryColor={secondaryColor}
>
<View style={items3}>
{items2}
</View>
</ThemeContextProvider>
);
function _fun68305() { // fn#68305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8876:1050, offset: 0x01c4830a, size: 140 bytes, params: 1, frame: 18
let value = environment.__proto__;
require(dependencyMap[11]).dismissKeyboard();
value = importDefault(dependencyMap[12]);
value.openLazy(require(dependencyMap[14])(dependencyMap[13], dependencyMap.paths),
'UserProfileCustomStatusActionSheet', {user: user, previewText: pendingStatusText,
previewEmoji: pendingStatusEmoji}, 'stack');
}
}
}
global.__d(_fun68302, 8691, [31, 27, 6816, 33, 4501, 697, 8490, 8501, 8494, 8496, 8497, 4015, 4080, 8692, 1962,
3868, 8507, 8510, 8511, 8513, 8695, 8474,
2]) /* metro module 8691, dependencies: [31, 27, 6816, 33, 4501, 697, 8490, 8501, 8494, 8496, 8497, 4015, 4080, 8692, 1962, 3868, 8507, 8510, 8511, 8513, 8695, 8474, 2] */;