138 lines
7.0 KiB
TypeScript
138 lines
7.0 KiB
TypeScript
/* Metro module 6515; source: design/components/Sheet/native/ActionSheetHeaderBar.native.tsx; dependencies: [31, 27, 33, 4501, 697, 1244, 1478, 3860, 4559, 2] */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UseWindowDimensionsNative from '../../../../modules/screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
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 UseTokenModule from '../../../tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
import * as CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UseIsScreenReaderEnabledNativeModule from '../../../../modules/a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
|
|
|
|
function _fun51234(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#51234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6693:6, offset: 0x0122c6d0, size: 237 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ReactNativeModule;
|
|
const env0_3 = value.Pressable;
|
|
const env0_4 = value.StyleSheet;
|
|
const env0_5 = value.TouchableWithoutFeedback;
|
|
const env0_6 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.Fragment;
|
|
const env0_9 = value.jsxs;
|
|
const env0_10 = (CreateStylesModule).createStyles(_fun51235);
|
|
(FileImportTrackerModule).fileFinishedImporting('design/components/Sheet/native/ActionSheetHeaderBar.native.tsx');
|
|
exports.ActionSheetHeaderBar = ActionSheetHeaderBar;
|
|
function _fun51235(a0, a1, a2) { // fn#51235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6693:245, offset: 0x0122c7bd, size: 444 bytes, params: 4, frame: 21
|
|
var r11;
|
|
var r5;
|
|
var object;
|
|
var WHITE;
|
|
var object2;
|
|
var object4;
|
|
const object5 = {};
|
|
const object6 = {marginBottom: a2};
|
|
copyDataProperties(object6, a0 === 'floating' ? {'left': 0, 'right': 0,
|
|
'position': 'absolute'} : a0 !== 'overlay' ? undefined : {'left': 0, 'right': 0, 'position': 'absolute'}, r11);
|
|
object5.header = object6;
|
|
const object7 = {alignSelf: 'center'};
|
|
const value2 = undefined;
|
|
const SHEET_HANDLE_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.SHEET_HANDLE_WIDTH;
|
|
object7.width = SHEET_HANDLE_WIDTH;
|
|
const SHEET_HANDLE_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.SHEET_HANDLE_HEIGHT;
|
|
object7.height = SHEET_HANDLE_HEIGHT;
|
|
const sm = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object7.borderRadius = sm;
|
|
const SHEET_HANDLE_MARGIN_TOP = (importDefault(697) /* metro dependency 697: native */).modules.mobile.SHEET_HANDLE_MARGIN_TOP;
|
|
object7.top = SHEET_HANDLE_MARGIN_TOP;
|
|
if (a0 === 'default') {
|
|
object4 = {};
|
|
object4.backgroundColor = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
|
|
r5 = object4;
|
|
r11 = sm;
|
|
} else if (a0 === 'floating') {
|
|
object2 = {};
|
|
object2.backgroundColor = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
r5 = object2;
|
|
r11 = sm;
|
|
} else if (a0 !== 'overlay') {
|
|
r5 = value2;
|
|
r11 = sm;
|
|
} else {
|
|
object = {};
|
|
WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
object.backgroundColor = WHITE;
|
|
copyDataProperties(object, (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW, WHITE);
|
|
r5 = object;
|
|
r11 = WHITE;
|
|
}
|
|
copyDataProperties(object7, r5, r11);
|
|
object5.indicator = object7;
|
|
const object8 = {};
|
|
copyDataProperties(object8, StyleSheet.absoluteFillObject, r11);
|
|
object8['height'] = a1;
|
|
object8['marginTop'] = -a1 + a2;
|
|
object5.accessibleDismiss = object8;
|
|
return object5;
|
|
}
|
|
|
|
function ActionSheetHeaderBar({accessibilityLabel, style, tabStyle, onPress, variant}) { // fn#51236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6693:1050, offset: 0x0122c979, size: 412 bytes, params: 2, frame: 26
|
|
var r10;
|
|
var r0;
|
|
var value;
|
|
var intl;
|
|
var jsxRuntimeEnv0_8Binding;
|
|
if (accessibilityLabel !== undefined) {
|
|
r10 = accessibilityLabel;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r10 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.WAI6xu);
|
|
}
|
|
variant = variant === undefined ? 'default' : variant;
|
|
const height = (UseWindowDimensionsNative)().height;
|
|
const useToken = UseTokenModule.useToken;
|
|
const SHEET_HANDLE_MARGIN_BOTTOM = (Native).modules.mobile.SHEET_HANDLE_MARGIN_BOTTOM;
|
|
const styles = useStyles(variant, height, Reflect.apply(useToken, UseTokenModule, [SHEET_HANDLE_MARGIN_BOTTOM]));
|
|
const value3 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
|
|
const touchableWithoutFeedback = (
|
|
<TouchableWithoutFeedback
|
|
onPress={onPress}
|
|
onAccessibilityEscape={onPress}
|
|
{...{['aria-hidden']: true}}
|
|
>
|
|
<View style={[styles.header, style]}>
|
|
<View style={[styles.indicator, tabStyle]} />
|
|
</View>
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
if (value3) {
|
|
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
|
|
value = (
|
|
<Pressable
|
|
style={styles.accessibleDismiss}
|
|
accessible
|
|
accessibilityLabel={r10}
|
|
accessibilityRole="button"
|
|
onPress={onPress}
|
|
/>
|
|
);
|
|
value = (
|
|
<>
|
|
{value}
|
|
{touchableWithoutFeedback}
|
|
</>
|
|
);
|
|
r0 = value;
|
|
} else {
|
|
r0 = touchableWithoutFeedback;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun51234, 6515, [31, 27, 33, 4501, 697, 1244, 1478, 3860, 4559,
|
|
2]) /* metro module 6515, dependencies: [31, 27, 33, 4501, 697, 1244, 1478, 3860, 4559, 2] */;
|