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

117 lines
7.0 KiB
TypeScript

/* Metro module 13445; source: modules/parent_tools/native/FamilyCenterParentalControlsScreenTime.tsx; dependencies: [27, 661, 33, 4501, 697, 10909, 6238, 4573, 1244, 2224, 13406, 1484, 6231, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import FamilyCenterMessages from '../FamilyCenter.messages.js'; /* Metro dependency 2224 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as FamilyCenterRestrictedHoursUtilsModule from '../FamilyCenterRestrictedHoursUtils.tsx'; /* Metro dependency 10909 */
import * as UseSelectedTeenUserModule from '../hooks/useSelectedTeenUser.tsx'; /* Metro dependency 13406 */
function _fun102238(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13635:6, offset: 0x02233b31, size: 300 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = JsxRuntimeModule;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const PX_24 = (Native).space.PX_24;
object.header = {paddingTop: PX_24};
const object3 = {};
const PX_16 = (Native).space.PX_16;
object3.paddingHorizontal = PX_16;
const PX_8 = (Native).space.PX_8;
object3.gap = PX_8;
object.container = object3;
const env0_7 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/native/FamilyCenterParentalControlsScreenTime.tsx');
exports.default = FamilyCenterParentalControlsScreenTime;
function ScheduleRuleRow({rule, teenId, navigation, readOnly}) { // fn#102239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13635:308, offset: 0x02233c5d, size: 302 bytes, params: 2, frame: 24
readOnly = !(readOnly === undefined) && readOnly;
const scheduleRuleDateRange = (FamilyCenterRestrictedHoursUtilsModule).getScheduleRuleDateRange(rule);
const value5 = FamilyCenterRestrictedHoursUtilsModule.formatDays(rule.days);
const TableRow = (TableRowNativeModule).TableRow;
const Text = (TextModule).Text;
const enabled = rule.enabled;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const defaultImport = FamilyCenterMessages;
return (
<TableRow
label={scheduleRuleDateRange}
subLabel={value5}
trailing={<Text variant="text-sm/medium" color="text-subtle">
{enabled ? Reflect.apply(string, intl, [defaultImport['8vDHRq']]) : Reflect.apply(string, intl,
[defaultImport['4z9fN+']])}
</Text>}
arrow={!readOnly}
onPress={readOnly ? undefined : _fun102240}
/>
);
function _fun102240() { // fn#102240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13635:691, offset: 0x02233d8b, size: 63 bytes, params: 1, frame: 15
const value = environment;
const navigationBinding = navigation;
const navigate = navigationBinding.navigate;
const FAMILY_CENTER_SCHEDULE_DOWNTIME = UserSettingsSections.FAMILY_CENTER_SCHEDULE_DOWNTIME;
const object = {};
object.teenId = teenId;
const object2 = {};
copyDataProperties(object2, rule, value);
object.rule = object2;
return Reflect.apply(navigate, navigationBinding, [FAMILY_CENTER_SCHEDULE_DOWNTIME, object]);
}
}
function FamilyCenterParentalControlsScreenTime({readOnly}) { // fn#102241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13635:881, offset: 0x02233dca, size: 413 bytes, params: 2, frame: 26
var r0;
var Text;
var intl;
if (readOnly !== undefined) {
}
const styles = useStyles();
const value4 = (UseSelectedTeenUserModule).useSelectedTeenUser();
const env0_1 = (UseNavigationNativeModule).useNavigation();
if (value4?.id == null) {
r0 = null;
} else {
var viewBindingProps = {style: styles.container};
Text = (require(4573) /* metro dependency 4573: Text */).Text;
var textProps = {'variant': 'text-sm/semibold', 'color': 'text-subtle', style: styles.header};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = (
<View {...viewBindingProps}>
<Text {...textProps}>
{intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['72CmJd'])}
</Text>
{((TableRowGroup) => <TableRowGroup hasIcons={false}>{(require(10909) /* metro dependency 10909: FamilyCenterRestrictedHoursUtils */).sortRulesByStartTime((value4 == null || value4.restrictedSchedule == null ? undefined : value4.restrictedSchedule.rules) ?? []).map(_fun102242)}</TableRowGroup>)((require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup)}
</View>
);
}
return r0;
function _fun102242(a0) { // fn#102242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13635:1383, offset: 0x02233f67, size: 68 bytes, params: 2, frame: 16
return (
<ScheduleRuleRow
rule={a0}
teenId={id}
navigation={env0_1}
readOnly={readOnly}
key={a0.ruleId}
/>
);
}
}
}
global.__d(_fun102238, 13445, [27, 661, 33, 4501, 697, 10909, 6238, 4573, 1244, 2224, 13406, 1484, 6231,
2]) /* metro module 13445, dependencies: [27, 661, 33, 4501, 697, 10909, 6238, 4573, 1244, 2224, 13406, 1484, 6231, 2] */;