191 lines
11 KiB
TypeScript
191 lines
11 KiB
TypeScript
/* Metro module 13272; source: modules/safety_hub/native/SafetyHubPage.tsx; dependencies: [31, 27, 11473, 5267, 661, 33, 1244, 4573, 5076, 1305, 566, 4501, 697, 13273, 11503, 11481, 13274, 4594, 11480, 683, 4826, 4831, 4080, 13275, 1962, 13276, 13278, 2] */
|
|
import UseMountEffect from '../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
|
|
import SafetyHubStore from '../SafetyHubStore.tsx'; /* Metro dependency 11473 */
|
|
import UseSafetyHubLoading from '../hooks/useSafetyHubLoading.tsx'; /* Metro dependency 13273 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
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 SafetyHubConstantsModule from '../SafetyHubConstants.tsx'; /* Metro dependency 5267 */
|
|
import * as SafetyHubActionCreatorsModule from '../SafetyHubActionCreators.tsx'; /* Metro dependency 11480 */
|
|
import * as UseSafetyHubAccountStandingModule from '../hooks/useSafetyHubAccountStanding.tsx'; /* Metro dependency 11481 */
|
|
import * as UseSafetyHubInitializedModule from '../hooks/useSafetyHubInitialized.tsx'; /* Metro dependency 11503 */
|
|
import * as UseSafetyHubFetchErrorModule from '../hooks/useSafetyHubFetchError.tsx'; /* Metro dependency 13274 */
|
|
|
|
function _fun101196(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:6, offset: 0x0220b0b2, size: 411 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.View;
|
|
const env0_6 = value.ActivityIndicator;
|
|
const env0_7 = value.ScrollView;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_10 = value.AnalyticEvents;
|
|
const env0_11 = value.Routes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.paddingHorizontal = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.paddingVertical = PX_12;
|
|
object.container = object2;
|
|
object.loadingIndicator = {'display': 'flex', 'justifyContent': 'center', 'alignItems': 'center'};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.body = {gap: PX_8};
|
|
const env0_14 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/safety_hub/native/SafetyHubPage.tsx');
|
|
exports.default = SafetyHubPage;
|
|
function AutomatedUnderageAppealStatus() { // fn#101197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:264, offset: 0x0220b24d, size: 137 bytes, params: 1, frame: 17
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
const {message, type} = getAutomatedAppealStatusMessage(Reflect.apply(useStateFromStores, FluxModule,
|
|
[[SafetyHubStore], function() {
|
|
return SafetyHubStore.getAgeCheckStatus();
|
|
}]));
|
|
const value3 = null;
|
|
if (value3 == type) {
|
|
return value3;
|
|
} else {
|
|
const HelpMessage = (require(1305) /* metro dependency 1305: native */).HelpMessage;
|
|
return (
|
|
<HelpMessage messageType={type}>
|
|
{message}
|
|
</HelpMessage>
|
|
);
|
|
}
|
|
function getAutomatedAppealStatusMessage(a0) { // fn#101198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:311, owner: AutomatedUnderageAppealStatus.getAutomatedAppealStatusMessage, offset: 0x0220b2d6, size: 484 bytes, params: 2, frame: 18
|
|
var object;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const HelpMessageTypes = (NativeModule).HelpMessageTypes;
|
|
const SUCCESS = AgeCheckStatus.SUCCESS;
|
|
if (SUCCESS === a0) {
|
|
return {message: intl.format(t.hyh4ls, {loginHook: loginHook}), type: HelpMessageTypes.SUCCESS};
|
|
}
|
|
const ERROR = AgeCheckStatus.ERROR;
|
|
if (ERROR === a0) {
|
|
object = {};
|
|
object.message = intl.string(t['4sILBU']);
|
|
object.type = HelpMessageTypes.ERROR;
|
|
return object;
|
|
}
|
|
const FAILURE = AgeCheckStatus.FAILURE;
|
|
if (FAILURE === a0) {
|
|
object = {};
|
|
object.message = intl.string(t['40R63o']);
|
|
object.type = HelpMessageTypes.ERROR;
|
|
return object;
|
|
}
|
|
const LOADING = AgeCheckStatus.LOADING;
|
|
if (LOADING === a0) {
|
|
object = {};
|
|
object.message = intl.string(t['nhhy/R']);
|
|
object.type = HelpMessageTypes.INFO;
|
|
return object;
|
|
}
|
|
return {'message': null, 'type': null};
|
|
function loginHook(a0) { // fn#101199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:443, owner: AutomatedUnderageAppealStatus.getAutomatedAppealStatusMessage.loginHook, offset: 0x0220b4ba, size: 76 bytes, params: 2, frame: 14
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<Text
|
|
variant="text-sm/medium"
|
|
color="text-link"
|
|
onPress={function() {
|
|
return importDefault(dependencyMap[8]).logout('safety_hub_page_appeal_success', Routes.LOGIN);
|
|
}}
|
|
>
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function SafetyHubPage({visible}) { // fn#101202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:1459, offset: 0x0220b552, size: 449 bytes, params: 2, frame: 23
|
|
const styles = useStyles();
|
|
const value2 = (UseSafetyHubLoading)();
|
|
const env0_1 = (UseSafetyHubInitializedModule).useSafetyHubInitialized();
|
|
const env0_2 = (UseSafetyHubAccountStandingModule).useSafetyHubAccountStanding();
|
|
const value3 = (UseSafetyHubFetchErrorModule).useSafetyHubFetchError();
|
|
(UseMountEffect)(_fun101203);
|
|
ReactModule.useEffect(_fun101204, [value3, visible]);
|
|
return (
|
|
value2
|
|
? (
|
|
<View style={[styles.container, styles.loadingIndicator]}>
|
|
<ActivityIndicator animating size="large" />
|
|
</View>
|
|
)
|
|
: (
|
|
value3 != null
|
|
? null
|
|
: (
|
|
<ScrollView style={styles.container}>
|
|
<View style={styles.body}>
|
|
<AutomatedUnderageAppealStatus />
|
|
{((Component) => <Component />)(importDefault(13276) /* metro dependency 13276: SafetyHubAccountStanding */)}
|
|
</View>
|
|
{((ConnectedSafetyHubViolationsContainer) => <ConnectedSafetyHubViolationsContainer />)((require(13278) /* metro dependency 13278: SafetyHubViolationsContainer */).ConnectedSafetyHubViolationsContainer)}
|
|
</ScrollView>
|
|
)
|
|
)
|
|
);
|
|
function _fun101203() { // fn#101203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:1649, offset: 0x0220b713, size: 161 bytes, params: 1, frame: 18
|
|
var defaultImport;
|
|
var object;
|
|
var defaultImport2;
|
|
var increment;
|
|
(SafetyHubActionCreatorsModule).getSafetyHubData();
|
|
if (env0_1) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.SAFETY_HUB_VIEWED, {account_standing: env0_2.state});
|
|
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
increment = defaultImport2.increment;
|
|
object = {};
|
|
object.name = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents.SAFETY_HUB_VIEW;
|
|
Reflect.apply(increment, defaultImport2, [object]);
|
|
}
|
|
}
|
|
|
|
function _fun101204() { // fn#101204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13462:1831, offset: 0x0220b7b4, size: 148 bytes, params: 1, frame: 16
|
|
var defaultImport;
|
|
var openLazy;
|
|
var value;
|
|
if (visible) {
|
|
if (env0_3 != null) {
|
|
value = environment.__proto__;
|
|
defaultImport = importDefault(dependencyMap[22]);
|
|
openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[24]);
|
|
value = value(dependencyMap[23], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'SafetyHubErrorActionSheet', {}]);
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = importDefault(dependencyMap[22]);
|
|
value.hideActionSheet('SafetyHubErrorActionSheet');
|
|
}
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = importDefault(dependencyMap[22]);
|
|
value.hideActionSheet('SafetyHubErrorActionSheet');
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun101196, 13272, [31, 27, 11473, 5267, 661, 33, 1244, 4573, 5076, 1305, 566, 4501, 697, 13273, 11503,
|
|
11481, 13274, 4594, 11480, 683, 4826, 4831, 4080, 13275, 1962, 13276, 13278,
|
|
2]) /* metro module 13272, dependencies: [31, 27, 11473, 5267, 661, 33, 1244, 4573, 5076, 1305, 566, 4501, 697, 13273, 11503, 11481, 13274, 4594, 11480, 683, 4826, 4831, 4080, 13275, 1962, 13276, 13278, 2] */;
|