Files
discord-decomp/sources/design/void/Status/native/Status.tsx
T
2026-07-28 01:06:53 +03:00

206 lines
13 KiB
TypeScript

/* Metro module 12736; source: design/void/Status/native/Status.tsx; dependencies: [57, 31, 27, 1306, 661, 10253, 33, 4501, 12734, 697, 12737, 12738, 12739, 12740, 12741, 12742, 12743, 12735, 12744, 4017, 4577, 12721, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import GetStatusContainerStyle from './getStatusContainerStyle.tsx'; /* Metro dependency 12735 */
import Module12743 from '../../../../by-id/module-12743.js'; /* Metro dependency 12743 */
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 ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as StatusConstantsModule from './StatusConstants.tsx'; /* Metro dependency 1306 */
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as SpringModule from '../../../animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
import * as StatusUtilsModule from './StatusUtils.tsx'; /* Metro dependency 12734 */
import * as UseFlashListAnimationDisablerModule from '../../../../modules/main_tabs_v2/native/shared_components/guild_channels/useFlashListAnimationDisabler.tsx'; /* Metro dependency 12744 */
function _fun97466(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:6, offset: 0x021827b1, size: 413 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
let value = ReactNativeModule;
const env0_4 = value.Image;
const env0_5 = value.View;
value = require(10253) /* metro dependency 10253: ChannelAnimationConstants */;
const env0_8 = value.TYPING_ENTERING;
const env0_9 = value.TYPING_EXITING;
const env0_10 = value.CHANNEL_SPRING_CONFIG;
value = require(33) /* metro dependency 33 */;
const env0_11 = value.jsx;
const env0_12 = value.jsxs;
const env0_13 = (CreateStylesModule).createStyles({statusIcon: {'width': '100%',
'height': '100%'}});
const env0_14 = (CreateStylesModule).createStyles(_fun97468);
object = {code: "function StatusTsx1(){const{enableAnimation,withSpring,width,CHANNEL_SPRING_CONFIG,height,onAnimationFinished,borderRadius,translateX}=this.__closure;const shouldAnimate=enableAnimation.get()?'respect-motion-settings':'animate-never';return{width:withSpring(width,CHANNEL_SPRING_CONFIG,shouldAnimate),height:withSpring(height,CHANNEL_SPRING_CONFIG,shouldAnimate,onAnimationFinished),borderRadius:withSpring(borderRadius,CHANNEL_SPRING_CONFIG,shouldAnimate),transform:[{translateX:withSpring(translateX,CHANNEL_SPRING_CONFIG,shouldAnimate)}]};}"};
object = {code: 'function StatusTsx2(){const{withSpring,statusOpacity,CHANNEL_SPRING_CONFIG}=this.__closure;return{opacity:withSpring(statusOpacity,CHANNEL_SPRING_CONFIG)};}'};
(FileImportTrackerModule).fileFinishedImporting('design/void/Status/native/Status.tsx');
exports.default = Status;
exports.StatusWithTyping = StatusWithTyping;
function getStatusSource(a0, a1, a2, a3) { // fn#97467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:995, offset: 0x0218294e, size: 270 bytes, params: 5, frame: 12
if (a1) {
return importDefault(12737) /* metro dependency 12737 */;
}
if (a3) {
return importDefault(12738) /* metro dependency 12738 */;
}
if (a2) {
return importDefault(12739) /* metro dependency 12739 */;
}
const IDLE = StatusTypes.IDLE;
if (IDLE === a0) {
return importDefault(12740) /* metro dependency 12740 */;
}
const DND = StatusTypes.DND;
if (DND === a0) {
return importDefault(12741) /* metro dependency 12741 */;
}
const OFFLINE = StatusTypes.OFFLINE;
if (OFFLINE === a0) {
return importDefault(12742) /* metro dependency 12742 */;
}
const INVISIBLE = StatusTypes.INVISIBLE;
if (INVISIBLE === a0) {
return importDefault(12742) /* metro dependency 12742 */;
}
StatusTypes.ONLINE;
return Module12743;
}
function _fun97468(a0, a1) { // fn#97468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:384, offset: 0x02182a5c, size: 423 bytes, params: 3, frame: 20
var r8;
const {width, height,
dotSize} = (StatusUtilsModule).getStatusTypingDimensions(a0);
const object = {};
const ONLINE = StatusTypes.ONLINE;
if (ONLINE === a1) {
r8 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
} else if (StatusTypes.IDLE === a1) {
r8 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300;
} else if (StatusTypes.DND === a1) {
r8 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
} else if (StatusTypes.STREAMING === a1) {
r8 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PLATFORM_TWITCH;
} else {
if (StatusTypes.INVISIBLE !== a1) {
if (StatusTypes.UNKNOWN !== a1) {
StatusTypes.OFFLINE;
}
}
r8 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_400;
}
object.ellipsis = {backgroundColor: r8, borderRadius: height, height: height, width: width, paddingStart: 4,
paddingEnd: 2, marginRight: 0};
const object3 = {width: dotSize, height: dotSize};
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object3.backgroundColor = WHITE;
object.ellipsisDot = object3;
return object;
}
function Status({isMobileOnline, isVROnline, style, status, size, streaming}) { // fn#97469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:2052, offset: 0x02182c03, size: 188 bytes, params: 2, frame: 26
isMobileOnline = !(isMobileOnline === undefined) && isMobileOnline;
isVROnline = !(isVROnline === undefined) && isVROnline;
streaming = !(streaming === undefined) && streaming;
const styles = useStyles();
return (
<View
style={[(GetStatusContainerStyle)(size, isMobileOnline,
isVROnline), style]}
>
<Image
style={styles.statusIcon}
source={getStatusSource(status, streaming, isMobileOnline, isVROnline)}
resizeMode="stretch"
/>
</View>
);
}
function StatusWithTyping({isMobileOnline, isVROnline, style, status, size, streaming, typing, userId}) { // fn#97470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:2304, offset: 0x02182cbf, size: 922 bytes, params: 2, frame: 38
var r20;
var moduleValue2;
isMobileOnline = !(isMobileOnline === undefined) && isMobileOnline;
isVROnline = !(isVROnline === undefined) && isVROnline;
streaming = !(streaming === undefined) && streaming;
const styles = useStyles();
const styles2 = useStyles(size, status);
const value2 = (GetStatusContainerStyle)(size, isMobileOnline,
isVROnline);
const useFlashListAnimationDisabler = UseFlashListAnimationDisablerModule.useFlashListAnimationDisabler;
const value5 = undefined(Reflect.apply(useFlashListAnimationDisabler, UseFlashListAnimationDisablerModule,
[userId ?? '']), 2);
const property = value5[0];
const property2 = value5[1];
const r24 = typing ? styles2.ellipsis.width + 2 * STATUS_PADDING : value2.width;
const r23 = typing ? styles2.ellipsis.height + 2 * STATUS_PADDING : value2.height;
const r21 = typing ? r24 / 2 : value2.borderRadius;
if (typing) {
moduleValue2 = require(12734) /* metro dependency 12734: StatusUtils */;
r20 = moduleValue2.getAnimatedTypingTranslateX(value2.width);
} else {
r20 = 0;
}
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
let closure = StatusWithTypingO;
const object = {enableAnimation: property};
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.width = r24;
object.CHANNEL_SPRING_CONFIG = CHANNEL_SPRING_CONFIG;
object.height = r23;
object.onAnimationFinished = property2;
object.borderRadius = r21;
object.translateX = r20;
closure.__closure = object;
closure.__workletHash = 2188820017597;
closure.__initData = env0_15;
const value12 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const r17 = typing ? 0 : 1;
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = StatusWithTypingF;
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, statusOpacity: r17,
CHANNEL_SPRING_CONFIG: CHANNEL_SPRING_CONFIG};
closure.__workletHash = 7224613224414;
closure.__initData = env0_16;
const value13 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [value2, value12, style];
const r5 = typing && ((View) => <View collapsable={false} entering={TYPING_ENTERING} exiting={TYPING_EXITING} style={[{position: 'absolute',
left: STATUS_PADDING,
top: STATUS_PADDING}]}>{((Component) => <Component style={styles2.ellipsis} dotStyle={styles2.ellipsisDot} disableScale />)(importDefault(12721) /* metro dependency 12721: Ellipsis */)}</View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
const View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View style={items2} collapsable={false}>
{r5}
<View3 style={value13}>
<Image
style={styles.statusIcon}
source={getStatusSource(status, streaming, isMobileOnline, isVROnline)}
resizeMode="stretch"
/>
</View3>
</View>
);
function StatusWithTypingO() { // fn#97471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:2719, owner: StatusWithTyping.O, offset: 0x02183059, size: 196 bytes, params: 1, frame: 23
const r6 = env0_0.get() ? 'respect-motion-settings' : 'animate-never';
const object = {};
object.width = SpringModule.withSpring(env0_2, CHANNEL_SPRING_CONFIG, r6);
object.height = SpringModule.withSpring(Module00057, CHANNEL_SPRING_CONFIG, r6, env0_1);
object.borderRadius = SpringModule.withSpring(env0_4, CHANNEL_SPRING_CONFIG, r6);
const object2 = {};
object2.translateX = SpringModule.withSpring(env0_5, CHANNEL_SPRING_CONFIG, r6);
object.transform = [object2];
return object;
}
function StatusWithTypingF() { // fn#97472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12926:3198, owner: StatusWithTyping.f, offset: 0x0218311d, size: 55 bytes, params: 1, frame: 14
return {opacity: SpringModule.withSpring(StatusConstantsModule.STATUS_PADDING, CHANNEL_SPRING_CONFIG)};
}
}
}
global.__d(_fun97466, 12736, [57, 31, 27, 1306, 661, 10253, 33, 4501, 12734, 697, 12737, 12738, 12739, 12740, 12741,
12742, 12743, 12735, 12744, 4017, 4577, 12721,
2]) /* metro module 12736, dependencies: [57, 31, 27, 1306, 661, 10253, 33, 4501, 12734, 697, 12737, 12738, 12739, 12740, 12741, 12742, 12743, 12735, 12744, 4017, 4577, 12721, 2] */;