140 lines
7.8 KiB
React
140 lines
7.8 KiB
React
/* Metro module 5415; source: unknown; dependencies: [57, 31, 27, 33, 1485, 5404, 5416, 5405, 5418] */
|
|
import Module00057 from './module-00057.js'; /* Metro dependency 57 */
|
|
import Module05418 from './module-05418.jsx'; /* Metro dependency 5418 */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as Module01485Module from './module-01485.js'; /* Metro dependency 1485 */
|
|
|
|
function _fun47724(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#47724, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5593:6, offset: 0x011cab58, size: 539 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = 1;
|
|
const env0_4 = importAll(dependencyMap[value]);
|
|
const I18nManager = ReactNativeModule.I18nManager;
|
|
const Platform = ReactNativeModule.Platform;
|
|
const StyleSheet = ReactNativeModule.StyleSheet;
|
|
object = {'borderless': true, 'foreground': null, 'radius': 20};
|
|
const Version = Platform.Version;
|
|
object.foreground = Version >= 23;
|
|
const create = StyleSheet.create;
|
|
object = {};
|
|
Object = global.Object;
|
|
object.container = Object.assign({'alignItems': 'center', 'flexDirection': 'row',
|
|
minWidth: StyleSheet.hairlineWidth}, {'marginVertical': 3, 'marginHorizontal': 11});
|
|
object.disabled = {opacity: 0.5};
|
|
object.label = {'fontSize': 17, 'letterSpacing': 0.35};
|
|
object.labelWrapper = {'flexDirection': 'row', 'alignItems': 'flex-start'};
|
|
let getConstants = I18nManager.getConstants;
|
|
object.icon = {'height': 24, 'width': 24, 'margin': 3, 'resizeMode': 'contain',
|
|
transform: [{scaleX: Reflect.apply(getConstants, I18nManager, []).isRTL ? -1 : value}]};
|
|
object.iconWithLabel = {};
|
|
object.iconMaskContainer = {'flex': 1, 'flexDirection': 'row', 'justifyContent': 'center'};
|
|
object.iconMaskFillerRect = {'flex': 1, 'backgroundColor': '#000'};
|
|
getConstants = I18nManager.getConstants;
|
|
object.iconMask = {'height': 21, 'width': 13, 'marginLeft': -14.5, 'marginVertical': 12, 'alignSelf': 'center',
|
|
'resizeMode': 'contain', transform: [{scaleX: Reflect.apply(getConstants, I18nManager, []).isRTL ? -1 : value}]};
|
|
const env0_11 = Reflect.apply(create, StyleSheet, [object]);
|
|
exports.default = HeaderBackButton_47725;
|
|
function HeaderBackButton_47725({disabled, allowFontScaling, backImage, label, labelStyle, labelVisible, onLabelLayout, onPress, pressColor, pressOpacity, screenLayout, tintColor, titleLayout, truncatedLabel, accessibilityLabel, testID, style}) { // fn#47725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5593:961, offset: 0x011cad73, size: 678 bytes, params: 2, frame: 28
|
|
var r9;
|
|
var items2;
|
|
var Boolean;
|
|
const r18 = labelVisible !== undefined && labelVisible;
|
|
const env0_3 = r18;
|
|
const value3 = 'Back';
|
|
const env0_8 = truncatedLabel === undefined ? value3 : truncatedLabel;
|
|
const r12 = accessibilityLabel !== undefined ? accessibilityLabel : label ? value3 === label ? 'Go back' : '' + label + ', back' : 'Go back';
|
|
const useTheme = Module01485Module.useTheme;
|
|
const colors = Reflect.apply(useTheme, Module01485Module, []).colors;
|
|
const [env0_9, env0_10] = env0_3(onLabelLayout.useState(undefined), 2);
|
|
const r11 = tintColor !== undefined ? tintColor : colors.text;
|
|
const env0_11 = r11;
|
|
const defaultImport = Module05418;
|
|
const defaultImportProps2 = {'disabled': null, 'accessible': true, 'accessibilityRole': 'button',
|
|
disabled: disabled, accessibilityLabel: r12, testID: testID,
|
|
onPress: disabled ? undefined : HeaderBackButton_47725HandlePress, pressColor: pressColor,
|
|
pressOpacity: pressOpacity, android_ripple: env0_10};
|
|
disabled = disabled && env0_11.disabled;
|
|
defaultImportProps2.style = [env0_11.container, disabled, style];
|
|
defaultImportProps2.hitSlop = {'top': 16, 'right': 16, 'bottom': 16, 'left': 16};
|
|
const Fragment = onLabelLayout.Fragment;
|
|
if (backImage) {
|
|
r9 = backImage({tintColor: r11});
|
|
} else {
|
|
items2 = [env0_11.icon];
|
|
Boolean = global.Boolean;
|
|
items2[1] = Boolean(r18) && env0_11.iconWithLabel;
|
|
Boolean = global.Boolean;
|
|
items2[2] = Boolean(r11) && ({tintColor: r11});
|
|
r9 = (
|
|
<Image
|
|
style={items2}
|
|
source={require(5404) /* metro dependency 5404 */}
|
|
fadeDuration={0}
|
|
/>
|
|
);
|
|
}
|
|
return ((Component) => <Component {...defaultImportProps2}><Fragment>{[r9,
|
|
HeaderBackButton_47725RenderLabel()]}</Fragment></Component>)(defaultImport);
|
|
function HeaderBackButton_47725HandleLabelLayout(a0) { // fn#47726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5593:1442, owner: HeaderBackButton_47725.handleLabelLayout, offset: 0x011b5f5e, size: 78 bytes, params: 2, frame: 12
|
|
if (onLabelLayout != null) {
|
|
onLabelLayout(a0);
|
|
}
|
|
env0_10(a0.nativeEvent.layout.x + a0.nativeEvent.layout.width);
|
|
}
|
|
|
|
function HeaderBackButton_47725HandlePress() { // fn#47727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5593:1657, owner: HeaderBackButton_47725.handlePress, offset: 0x011b5fac, size: 31 bytes, params: 1, frame: 12
|
|
return onPress && global.requestAnimationFrame(onPress);
|
|
}
|
|
|
|
function HeaderBackButton_47725RenderLabel() { // fn#47728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5593:2036, owner: HeaderBackButton_47725.renderLabel, offset: 0x011b5fcb, size: 338 bytes, params: 1, frame: 22
|
|
var r1;
|
|
var r0;
|
|
var screenLayoutBinding;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
const labelBinding = label;
|
|
if (labelBinding) {
|
|
r1 = env0_9 && titleLayout;
|
|
r1 = r1 && screenLayout;
|
|
r1 = r1 && (screenLayout.width - titleLayout.width) / 2 < env0_9 + 26;
|
|
r0 = r1;
|
|
} else {
|
|
r0 = !labelBinding;
|
|
}
|
|
const r7 = r0 ? env0_8 : label;
|
|
if (env0_3) {
|
|
value5 = undefined;
|
|
if (value5 === r7) {
|
|
return null;
|
|
}
|
|
value6 = environment.__proto__;
|
|
screenLayoutBinding = screenLayout;
|
|
value7 = null;
|
|
return (
|
|
<View style={screenLayoutBinding ? [env1_11.labelWrapper,
|
|
{minWidth: screenLayout.width / 2 - 27}] : value7}>
|
|
<Animated.Text
|
|
accessible={false}
|
|
onLayout={r7 !== label ? value5 : HeaderBackButton_47725HandleLabelLayout}
|
|
style={[env1_11.label, env0_11 ? {color: env0_11} : value7, labelStyle]}
|
|
numberOfLines={1}
|
|
allowFontScaling={!!allowFontScaling}
|
|
>
|
|
{r7}
|
|
</Animated.Text>
|
|
</View>
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun47724, 5415, [57, 31, 27, 33, 1485, 5404, 5416, 5405,
|
|
5418]) /* metro module 5415, dependencies: [57, 31, 27, 33, 1485, 5404, 5416, 5405, 5418] */;
|