74 lines
4.4 KiB
TypeScript
74 lines
4.4 KiB
TypeScript
/* Metro module 6808; source: design/components/TableRow/native/TableSwitchRow.native.tsx; dependencies: [57, 31, 27, 33, 4501, 477, 3862, 6238, 4573, 6809, 2] */
|
|
function _fun53559(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6986:6, offset: 0x0134ef06, size: 213 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value.jsx;
|
|
const env0_6 = value.jsxs;
|
|
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function() {
|
|
return {labelWithTrailing: {'flexDirection': 'row', 'alignItems': 'center', 'gap': 8}};
|
|
});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/TableRow/native/TableSwitchRow.native.tsx');
|
|
exports.TableSwitchRow = TableSwitchRow;
|
|
}
|
|
|
|
function TableSwitchRow(a0) { // fn#53561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6986:369, offset: 0x0134eff2, size: 699 bytes, params: 2, frame: 39
|
|
const value = a0.value;
|
|
const env0_1 = a0.onValueChange;
|
|
const label = a0.label;
|
|
const subLabel = a0.subLabel;
|
|
const trailing = a0.trailing;
|
|
let disabled = a0.disabled;
|
|
const value2 = undefined;
|
|
disabled = !(disabled === value2) && disabled;
|
|
const accessibilityHint = a0.accessibilityHint;
|
|
const variant = a0.variant;
|
|
const object2 = {'value': 0, 'onValueChange': 0, 'label': 0, 'subLabel': 0, 'trailing': 0, 'disabled': 0,
|
|
'accessibilityHint': 0, 'variant': 0};
|
|
silentSetPrototypeOf(object2, null, undefined);
|
|
const value4 = copyDataProperties({}, a0, object2, variant);
|
|
var env0_2Binding = value2;
|
|
const closure = function() {
|
|
return onValueChange?.(!value);
|
|
};
|
|
const styles = useStyles();
|
|
const isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
|
|
const nodeText = (require(3862) /* metro dependency 3862: native */).getNodeText(label);
|
|
const nodeText2 = (require(3862) /* metro dependency 3862: native */).getNodeText(subLabel);
|
|
const binding = env0_3;
|
|
var [property, env0_2] = env0_2Binding(binding.useState(value), 2);
|
|
binding.useEffect(_fun53563, [value]);
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const tableRowProps = {...value4};
|
|
tableRowProps['variant'] = variant;
|
|
tableRowProps['arrow'] = false;
|
|
tableRowProps['label'] = trailing == null ? label : <View style={styles.labelWithTrailing}>{env0_3.isValidElement(label) ? label : ((Text) => <Text variant="text-md/semibold" color={variant !== 'danger' ? 'mobile-text-heading-primary' : 'text-feedback-critical'}>{label}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}{trailing}</View>;
|
|
tableRowProps['subLabel'] = subLabel;
|
|
tableRowProps['disabled'] = disabled;
|
|
tableRowProps['accessibilityState'] = {disabled: disabled, checked: property};
|
|
tableRowProps['accessible'] = true;
|
|
tableRowProps['accessibilityRole'] = 'switch';
|
|
const value14 = '';
|
|
tableRowProps['accessibilityLabel'] = value14 + nodeText + ', ' + (nodeText2 ?? value14);
|
|
tableRowProps['accessibilityHint'] = accessibilityHint;
|
|
tableRowProps['onPress'] = isAndroid2 ? closure : value2;
|
|
tableRowProps['onAccessibilityTap'] = TableSwitchRowOnAccessibilityTap;
|
|
const FormSwitch = (require(6809) /* metro dependency 6809: FormSwitchNative */).FormSwitch;
|
|
tableRowProps['trailing'] = <FormSwitch {...{['aria-hidden']: true}} value={value} onValueChange={closure} disabled={disabled} />;
|
|
return <TableRow {...tableRowProps} />;
|
|
}
|
|
|
|
function TableSwitchRowOnAccessibilityTap() { // fn#53564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6986:1190, owner: TableSwitchRow.onAccessibilityTap, offset: 0x0134f2d3, size: 43 bytes, params: 1, frame: 11
|
|
env0_2(!value);
|
|
global.setTimeout(function() {
|
|
if (onValueChange != null) {
|
|
onValueChange(!value);
|
|
}
|
|
});
|
|
}
|
|
|