124 lines
6.2 KiB
TypeScript
124 lines
6.2 KiB
TypeScript
/* Metro module 15309; source: modules/toast/native/Toast.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 3860, 1305, 4573, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
|
|
function _fun117044(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15506:6, offset: 0x024a145d, size: 470 bytes, params: 8, frame: 23
|
|
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.Fragment;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {'flexDirection': 'row', 'alignItems': 'center'};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.padding = PX_8;
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.paddingRight = PX_12;
|
|
const MOBILE_TOAST_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TOAST_BACKGROUND_DEFAULT;
|
|
object2.backgroundColor = MOBILE_TOAST_BACKGROUND_DEFAULT;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.borderColor = BORDER_SUBTLE;
|
|
object2.borderWidth = 1;
|
|
const SHADOW_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_HIGH;
|
|
copyDataProperties(object2, SHADOW_HIGH, undefined);
|
|
object.container = object2;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.multilineContainer = {paddingLeft: PX_12};
|
|
object.contentContainer = {'marginLeft': 8, 'flexShrink': 1};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/toast/native/Toast.tsx');
|
|
exports.default = Toast_117047;
|
|
function ToastIcon({icon, IconComponent, iconColor, recolorLegacyIcon}) { // fn#117045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15506:589, offset: 0x024a1633, size: 240 bytes, params: 2, frame: 20
|
|
const value4 = (require(3860) /* metro dependency 3860: useToken */).useToken(iconColor ?? 'mobile-text-heading-primary');
|
|
const object = {};
|
|
if (recolorLegacyIcon) {
|
|
object.color = value4;
|
|
} else {
|
|
object.disableColor = true;
|
|
}
|
|
if (IconComponent != null) {
|
|
return <IconComponent size="sm" color={value4} />;
|
|
} else if (typeof icon === 'function') {
|
|
return (
|
|
<>
|
|
{icon()}
|
|
</>
|
|
);
|
|
} else if (icon != null) {
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
return (
|
|
<Icon
|
|
resizeMode="contain"
|
|
source={icon}
|
|
{...object}
|
|
/>
|
|
);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
function ToastContent({content, onTextLayout}) { // fn#117046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15506:909, offset: 0x024a1723, size: 147 bytes, params: 2, frame: 18
|
|
const styles = useStyles();
|
|
if (typeof content === 'function') {
|
|
return (
|
|
<View style={styles.contentContainer}>
|
|
{content()}
|
|
</View>
|
|
);
|
|
} else {
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text
|
|
onTextLayout={onTextLayout}
|
|
style={styles.contentContainer}
|
|
lineClamp={3}
|
|
variant="text-sm/semibold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{content}
|
|
</Text>
|
|
);
|
|
}
|
|
}
|
|
|
|
function Toast_117047({icon, iconColor, IconComponent, content, containerStyle, recolorLegacyIcon}) { // fn#117047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15506:1260, offset: 0x024a17b6, size: 269 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const [property, env0_0] = Module00057(ReactModule.useState(false), 2);
|
|
const env0_1 = ReactModule.useRef(false);
|
|
return (
|
|
<View
|
|
style={[styles.container, property ? styles.multilineContainer : null, containerStyle]}
|
|
accessibilityElementsHidden
|
|
>
|
|
<ToastIcon
|
|
icon={icon}
|
|
iconColor={iconColor}
|
|
IconComponent={IconComponent}
|
|
recolorLegacyIcon={recolorLegacyIcon}
|
|
/>
|
|
<ToastContent content={content} onTextLayout={ReactModule.useCallback(_fun117048, [])} />
|
|
</View>
|
|
);
|
|
function _fun117048(a0) { // fn#117048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15506:1442, offset: 0x024a18c3, size: 69 bytes, params: 2, frame: 11
|
|
if (!env0_1.current) {
|
|
env0_1.current = true;
|
|
env0_0(a0.nativeEvent.lines.length > 1);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117044, 15309, [57, 31, 27, 33, 4501, 697, 3860, 1305, 4573,
|
|
2]) /* metro module 15309, dependencies: [57, 31, 27, 33, 4501, 697, 3860, 1305, 4573, 2] */;
|