Files
discord-decomp/sources/modules/safety_hub/native/SafetyHubAccountStanding.tsx
T
2026-07-27 16:20:00 +03:00

271 lines
14 KiB
TypeScript

/* Metro module 13276; source: modules/safety_hub/native/SafetyHubAccountStanding.tsx; dependencies: [57, 31, 27, 1878, 11473, 5267, 33, 5268, 13277, 4501, 697, 1244, 4073, 7684, 9149, 6988, 8523, 566, 1423, 7597, 1305, 4573, 2] */
function _fun101214(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:6, offset: 0x0220bd40, size: 1108 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const safetyHubStore = importDefault(11473) /* metro dependency 11473: SafetyHubStore */;
const env0_8 = (require(5267) /* metro dependency 5267: SafetyHubConstants */).SafetyHubLinks;
let value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
object2 = {};
const AccountStandingState = (require(5268) /* metro dependency 5268: SafetyHubModels */).AccountStandingState;
const ALL_GOOD = AccountStandingState.ALL_GOOD;
object2[ALL_GOOD] = {left: '0%'};
const LIMITED = AccountStandingState.LIMITED;
const SUBWAY_MARKER_WIDTH = (require(13277) /* metro dependency 13277: SafetyHubAccountStandingSubwayMarker */).SUBWAY_MARKER_WIDTH;
object2[LIMITED] = {left: '25%', transform: [{translateX: -0.5 * SUBWAY_MARKER_WIDTH}]};
const VERY_LIMITED = AccountStandingState.VERY_LIMITED;
object2[VERY_LIMITED] = {left: '50%', transform: [{translateX: -0.5 * SUBWAY_MARKER_WIDTH}]};
const AT_RISK = AccountStandingState.AT_RISK;
object2[AT_RISK] = {left: '75%', transform: [{translateX: -0.5 * SUBWAY_MARKER_WIDTH}]};
const SUSPENDED = AccountStandingState.SUSPENDED;
object2[SUSPENDED] = {left: '100%', transform: [{translateX: -SUBWAY_MARKER_WIDTH}]};
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const object3 = {'display': 'flex', 'flexDirection': 'column', 'rowGap': 12, 'padding': 24, 'alignItems': 'center',
'justifyContent': 'center'};
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
object3.backgroundColor = CARD_BACKGROUND_DEFAULT;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object2.container = object3;
const object4 = {'position': 'relative', 'justifyContent': 'center', 'alignItems': 'center'};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object4.padding = PX_4;
const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
object4.backgroundColor = BACKGROUND_MOD_STRONG;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object2.avatarBackground = object4;
const STATUS_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_POSITIVE;
object2.good = {color: STATUS_POSITIVE};
const STATUS_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_WARNING;
object2.limited = {color: STATUS_WARNING};
object2.veryLimited = {color: '#FF7A00'};
let ICON_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_CRITICAL;
object2.atRisk = {color: ICON_FEEDBACK_CRITICAL};
ICON_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_CRITICAL;
object2.suspended = {color: ICON_FEEDBACK_CRITICAL};
object2.body = {'display': 'flex', 'rowGap': 40, 'width': '100%'};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.bodyText = {rowGap: PX_8};
object2.health = {'position': 'relative', 'left': 0, 'right': 0, 'marginBottom': 18};
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object2.line = {'height': 3, 'width': '100%', 'position': 'absolute', 'top': 8.5,
backgroundColor: BACKGROUND_BASE_LOWEST};
object2.subwayMarker = {position: 'absolute'};
const object5 = {};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object5.backgroundColor = BACKGROUND_SURFACE_HIGH;
object2.icon = object5;
const env0_12 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/safety_hub/native/SafetyHubAccountStanding.tsx');
exports.default = SafetyHubAccountStanding;
}
function SafetyHubAccountStanding() { // fn#101215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:1846, offset: 0x0220c194, size: 766 bytes, params: 1, frame: 34
const accountStanding = SafetyHubStore.getAccountStanding();
const binding = env0_4;
const value3 = binding.useState(0);
const value4 = undefined;
const value5 = env0_3(value3, 2);
const property = value5[0];
const env0_2 = value5[1];
const styles = useStyles();
const value6 = binding.useMemo(_fun101216, [styles]);
const value7 = binding.useMemo(_fun101217, [accountStanding, value6, property, styles]);
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const r18 = currentUser != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getUserAvatarSource(currentUser) : importDefault(7597) /* metro dependency 7597 */;
const property2 = value6[accountStanding.state];
const title = property2.title;
const description = property2.description;
const env0_5 = property2.style;
const items2 = [styles.container];
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
const object = {source: r18};
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
const XXLARGE = AvatarSizes.XXLARGE;
object.size = XXLARGE;
const username = currentUser == null ? value4 : currentUser.username;
object['aria-label'] = username ?? '';
const view = <View style={styles.avatarBackground}><Avatar {...object} /></View>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let value = <Text variant="heading-lg/medium" color="text-default" style={{textAlign: 'center'}}>{intl.format(title,
{hook: hook})}</Text>;
value = <View style={styles.bodyText}>{value}<Text variant="text-sm/medium" color="text-muted" style={{textAlign: 'center'}}>{description}</Text></View>;
return (
<View style={items2}>
{view}
<View style={styles.body}>
{value}
<View style={[styles.health, {height: property}]}>
<View style={styles.line} />
{value7}
</View>
</View>
</View>
);
}
function _fun101216() { // fn#101216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:1971, offset: 0x0220c492, size: 936 bytes, params: 1, frame: 24
const object3 = {};
const AccountStandingState = (require(5268) /* metro dependency 5268: SafetyHubModels */).AccountStandingState;
const ALL_GOOD = AccountStandingState.ALL_GOOD;
const object8 = {};
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object8.title = t.uaKrRi;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const format = intl.format;
const pEdBD4 = t.pEdBD4;
const TOS_LINK = SafetyHubLinks.TOS_LINK;
const COMMUNITY_GUIDELINES = SafetyHubLinks.COMMUNITY_GUIDELINES;
object8.description = Reflect.apply(format, intl, [pEdBD4, {termsOfService: TOS_LINK,
communityGuidelines: COMMUNITY_GUIDELINES}]);
object8.status = t['/Idfao'];
const stylesBinding = styles;
object8.style = stylesBinding.good;
const CircleCheckIcon = (require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon;
object8.CustomIcon = CircleCheckIcon;
object3[ALL_GOOD] = object8;
const LIMITED = AccountStandingState.LIMITED;
const object9 = {};
object9.title = t.epkcmS;
object9.description = intl.string(t['774juc']);
object9.status = t.umleq4;
object9.style = stylesBinding.limited;
const CircleErrorIcon = (require(7684) /* metro dependency 7684: CircleErrorIcon */).CircleErrorIcon;
object9.CustomIcon = CircleErrorIcon;
object9.iconSource = importDefault(9149) /* metro dependency 9149 */;
object3[LIMITED] = object9;
const VERY_LIMITED = AccountStandingState.VERY_LIMITED;
const object10 = {};
object10.title = t.crzE2X;
object10.description = intl.string(t['T/Ufh9']);
const WBtMHf = t.WBtMHf;
object10.status = WBtMHf;
object10.style = stylesBinding.veryLimited;
object10.CustomIcon = CircleErrorIcon;
object10.iconSource = importDefault(9149) /* metro dependency 9149 */;
object3[VERY_LIMITED] = object10;
const AT_RISK = AccountStandingState.AT_RISK;
const object11 = {};
const XRNVzO = t.XRNVzO;
object11.title = XRNVzO;
object11.description = intl.string(t['hbH+9S']);
object11.status = t['7f+4Lg'];
object11.style = stylesBinding.atRisk;
object11.CustomIcon = CircleErrorIcon;
object11.iconSource = importDefault(9149) /* metro dependency 9149 */;
object3[AT_RISK] = object11;
const SUSPENDED = AccountStandingState.SUSPENDED;
const object12 = {};
const MExFkz = t.MExFkz;
object12.title = MExFkz;
object12.description = intl.string(t['2liUvt']);
object12.status = t['0OONGB'];
object12.style = stylesBinding.suspended;
const CircleXIcon = (require(6988) /* metro dependency 6988: CircleXIcon */).CircleXIcon;
object12.CustomIcon = CircleXIcon;
object12.iconSource = importDefault(8523) /* metro dependency 8523 */;
object3[SUSPENDED] = object12;
return object3;
}
function _fun101217() { // fn#101217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:3146, offset: 0x0220c83a, size: 47 bytes, params: 1, frame: 11
const Object = global.Object;
return Object.entries(env0_4).map(_fun101218);
}
function SafetyHubAccountStandingHook(a0, a1) { // fn#101221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:4112, owner: SafetyHubAccountStanding.hook, offset: 0x0220c9f3, size: 76 bytes, params: 3, frame: 15
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
style={style}
variant="heading-lg/bold"
key={a1}
>
{a0}
</Text>
);
}
function _fun101218(a0, a1) { // fn#101218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:3173, offset: 0x0220c869, size: 331 bytes, params: 3, frame: 26
var r0;
var r1;
var r11;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r2 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r11 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r11 = value;
} else {
r0 = item3;
r1 = value3;
r11 = item;
}
}
if (!r1) {
r0.return();
}
const int = global.parseInt(r2);
const Object = global.Object;
const length = Object.keys(env1_4).length;
const CustomIcon = r11.CustomIcon;
const stylesBinding = styles;
const items2 = [stylesBinding.subwayMarker, env2_11[int]];
const SafetyHubAccountStandingSubwayMarker = importDefault(13277) /* metro dependency 13277: SafetyHubAccountStandingSubwayMarker */;
const object = {};
copyDataProperties(object, stylesBinding.icon, undefined);
object['width'] = 20;
object['height'] = 20;
return (
<View style={items2} key={a1}>
<SafetyHubAccountStandingSubwayMarker
selectedIcon={<CustomIcon style={object} color={r11.style.color} />}
style={r11.style}
status={r11.status}
isSelected={int === env1_0.state}
index={a1}
onLayout={onLayout_101219}
size={20}
numOptions={length}
key={a1}
/>
</View>
);
}
function onLayout_101219(a0) { // fn#101219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13466:3449, offset: 0x0220c9b4, size: 63 bytes, params: 2, frame: 12
if (a0.nativeEvent.layout.height > env2_1) {
env2_2(a0.nativeEvent.layout.height);
}
}