151 lines
9.2 KiB
TypeScript
151 lines
9.2 KiB
TypeScript
/* Metro module 13412; source: modules/parent_tools/native/FamilyCenterActivitySection.tsx; dependencies: [57, 31, 27, 5117, 33, 4501, 697, 8171, 5187, 13407, 4573, 12624, 1244, 2224, 13413, 5278, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UseIsInAdultAgeGroup from '../hooks/useIsInAdultAgeGroup.tsx'; /* Metro dependency 8171 */
|
|
import FamilyCenterActivityRow from './FamilyCenterActivityRow.tsx'; /* Metro dependency 13413 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as FamilyCenterUtilsModule from '../FamilyCenterUtils.tsx'; /* Metro dependency 5187 */
|
|
import * as UseFamilyCenterActionsModule from '../hooks/useFamilyCenterActions.tsx'; /* Metro dependency 12624 */
|
|
import * as UseFamilyCenterActivitiesModule from '../hooks/useFamilyCenterActivities.tsx'; /* Metro dependency 13407 */
|
|
|
|
function _fun102057(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13602:6, offset: 0x02229cc4, size: 505 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.ActivityIndicator;
|
|
const env0_6 = value.View;
|
|
value = require(5117) /* metro dependency 5117: FamilyCenterConstants */;
|
|
const env0_7 = value.FAMILY_CENTER_ITEMS_SHOWN_INCREMENTS;
|
|
const env0_8 = value.TeenActionDisplayType;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
let createStyles = value.createStyles;
|
|
object = {};
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.header = {marginBottom: PX_4};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.description = {marginBottom: PX_8};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object]);
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
createStyles = value.createStyles;
|
|
const object4 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center'};
|
|
object4.borderBottomRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object4.borderBottomLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
|
|
object4.backgroundColor = BACKGROUND_MOD_SUBTLE;
|
|
object4.width = '60%';
|
|
const env0_12 = Reflect.apply(createStyles, value, [{container: {display: 'flex'},
|
|
loadMoreContainer: {'display': 'flex', 'flexDirection': 'row', 'flex': 1, 'alignItems': 'center',
|
|
'justifyContent': 'center', 'width': '100%'}, loadMore: object4, loadMoreButton: {paddingVertical: 4}}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/native/FamilyCenterActivitySection.tsx');
|
|
exports.default = FamilyCenterActivitySection;
|
|
function FamilyCenterActivitySectionHeader({displayType}) { // fn#102058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13602:374, offset: 0x02229ebd, size: 385 bytes, params: 2, frame: 23
|
|
const Text = (TextModule).Text;
|
|
const styles = useStyles();
|
|
const value3 = (UseIsInAdultAgeGroup)();
|
|
const value5 = (FamilyCenterUtilsModule).getActivityTypeTextConfigs().get(displayType);
|
|
const value6 = (UseFamilyCenterActivitiesModule).useActionsForDisplayType(displayType);
|
|
const value7 = (UseFamilyCenterActivitiesModule).useFormattedTotalForDisplayType(displayType);
|
|
const PURCHASES = TeenActionDisplayType.PURCHASES;
|
|
const r12 = value5?.sectionHeader(displayType !== PURCHASES ? value6.length : value7 !== null ? value7 : value6.length);
|
|
const r9 = value5?.sectionDescription === undefined ? null : value5?.sectionDescription(value3 != null && value3);
|
|
return (
|
|
<View>
|
|
<Text variant="text-sm/semibold" style={styles.header}>
|
|
{r12}
|
|
</Text>
|
|
{
|
|
r9 === null
|
|
? null
|
|
: (
|
|
<Text
|
|
variant="text-sm/medium"
|
|
color="text-muted"
|
|
style={styles.description}
|
|
>
|
|
{r9}
|
|
</Text>
|
|
)
|
|
}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterActivitySection({displayType}) { // fn#102059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13602:1523, offset: 0x0222a03e, size: 655 bytes, params: 2, frame: 28
|
|
const styles = useStyles();
|
|
const value2 = (UseFamilyCenterActivitiesModule).useActionsForDisplayType(displayType);
|
|
const value3 = (UseFamilyCenterActivitiesModule).useActionTotalsForDisplayType(displayType);
|
|
const {loadMore,
|
|
isMoreLoading} = (UseFamilyCenterActionsModule).useFamilyCenterActions({});
|
|
const useState = ReactModule.useState;
|
|
const value6 = Module00057(Reflect.apply(useState, ReactModule, [FAMILY_CENTER_ITEMS_SHOWN_INCREMENTS]), 2);
|
|
let property = value6[0];
|
|
const env0_2 = value6[1];
|
|
const value7 = value2.slice(0, property);
|
|
const value8 = ReactModule.useCallback(_fun102060, [loadMore, displayType]);
|
|
if (value2.length === 0) {
|
|
return null;
|
|
}
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
property = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['7dMmJY'];
|
|
const Math = global.Math;
|
|
const value10 = Reflect.apply(formatToPlainString, intl, [property, {pageSize: Math.min(value3 - value7.length,
|
|
FAMILY_CENTER_ITEMS_SHOWN_INCREMENTS)}]);
|
|
const items2 = [
|
|
<FamilyCenterActivitySectionHeader displayType={displayType} />,
|
|
];
|
|
items2[1] = value7.map(_fun102062);
|
|
items2[2] = (
|
|
value7.length < value3
|
|
? (
|
|
<View style={styles.loadMoreContainer}>
|
|
{
|
|
isMoreLoading
|
|
? (
|
|
<View style={styles.loadMore}>
|
|
<ActivityIndicator
|
|
style={styles.loadMoreButton}
|
|
animating
|
|
color="#fff"
|
|
size="small"
|
|
/>
|
|
</View>
|
|
)
|
|
: ((PressableOpacity) => <PressableOpacity style={styles.loadMore} accessibilityLabel={value10} accessibilityRole="button" onPress={value8}>{((Text) => <Text style={styles.loadMoreButton} variant="text-xs/semibold" color="always-white">{value10}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}</PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)
|
|
}
|
|
</View>
|
|
)
|
|
: null
|
|
);
|
|
return (
|
|
<View style={styles.container}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun102060() { // fn#102060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13602:1808, offset: 0x0222a2cd, size: 38 bytes, params: 1, frame: 12
|
|
env0_2(function(a0) {
|
|
return a0 + FAMILY_CENTER_ITEMS_SHOWN_INCREMENTS;
|
|
});
|
|
loadMore(displayType);
|
|
}
|
|
|
|
function _fun102062(a0) { // fn#102062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13602:2061, offset: 0x0222a303, size: 53 bytes, params: 2, frame: 16
|
|
const value = environment.__proto__;
|
|
return ((Component) => <Component action={a0} key={a0.event_id} />)(FamilyCenterActivityRow);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun102057, 13412, [57, 31, 27, 5117, 33, 4501, 697, 8171, 5187, 13407, 4573, 12624, 1244, 2224, 13413,
|
|
5278,
|
|
2]) /* metro module 13412, dependencies: [57, 31, 27, 5117, 33, 4501, 697, 8171, 5187, 13407, 4573, 12624, 1244, 2224, 13413, 5278, 2] */;
|