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

102 lines
6.1 KiB
TypeScript

/* Metro module 9788; source: modules/share/native/ShareChatInput.tsx; dependencies: [31, 27, 661, 33, 4501, 697, 477, 7875, 7980, 1244, 5278, 7950, 2] */
import UseMessageMaxLength from '../../messages/useMessageMaxLength.tsx'; /* Metro dependency 7875 */
import FormInput from '../../../design/void/Form/native/FormInput.tsx'; /* Metro dependency 7980 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as ReactionIconModule from '../../../design/components/Icon/native/redesign/generated/ReactionIcon.tsx'; /* Metro dependency 7950 */
function _fun76730(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9974:6, offset: 0x01de27d9, size: 560 bytes, params: 8, frame: 26
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = 0;
importAll(dependencyMap[value]);
const value2 = 2;
const Fonts = require(dependencyMap[value2]).Fonts;
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {'flex': 1, 'flexDirection': 'row', 'backgroundColor': null, 'borderRadius': 20};
const REDESIGN_CHAT_INPUT_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_CHAT_INPUT_BACKGROUND;
object2.backgroundColor = REDESIGN_CHAT_INPUT_BACKGROUND;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.paddingHorizontal = PX_12;
object.container = object2;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.chatInput = {'flex': 1, 'paddingVertical': 0, 'paddingHorizontal': null, 'maxHeight': 80,
paddingHorizontal: PX_4};
const object4 = {'fontSize': 16, 'lineHeight': 20};
const PRIMARY_NORMAL = Fonts.PRIMARY_NORMAL;
object4.fontFamily = PRIMARY_NORMAL;
const TEXT_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_STRONG;
object4.color = TEXT_STRONG;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.paddingTop = PX_8 + (PlatformUtilsModule.isAndroid() ? value : value2);
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.paddingBottom = PX_8;
object.chatText = object4;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object.inputPlaceholder = {color: TEXT_MUTED};
const object6 = {};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.paddingTop = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.paddingBottom = PX_8;
object6.alignSelf = 'flex-end';
object.emojiButton = object6;
const env0_6 = Reflect.apply(createStyles, CreateStylesModule, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/share/native/ShareChatInput.tsx');
exports.default = ShareChatInput;
function ShareChatInput({text, inputRef, onChange, onSelectionChange, onFocus, onBlur, onPressEmoji, onSend, disabled}) { // fn#76731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9974:850, offset: 0x01de2a09, size: 522 bytes, params: 2, frame: 31
disabled = !(disabled === undefined) && disabled;
const styles = useStyles();
const value2 = (UseMessageMaxLength)();
const object2 = {ref: inputRef, maxLength: value2};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const ZroO3G = (require(1244) /* metro dependency 1244: indexNative */).t.ZroO3G;
object2.placeholder = Reflect.apply(string, intl, [ZroO3G]);
object2.placeholderTextColor = styles.inputPlaceholder.color;
object2.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/+MXmw']);
object2.onSubmitEditing = onSend;
object2.onSelectionChange = onSelectionChange;
object2.style = styles.chatInput;
object2.value = text;
object2.onChange = onChange;
object2.onFocus = onFocus;
object2.onBlur = onBlur;
object2.multiline = true;
object2.showBorder = false;
object2.showTopContainer = false;
object2.textAlignVertical = 'center';
object2.inputTextStyle = styles.chatText;
object2.editable = !disabled;
const formInput = <FormInput {...object2} />;
const PressableOpacity = (PressablesModule).PressableOpacity;
string = intl.string;
const iZ7Mz9 = (require(1244) /* metro dependency 1244: indexNative */).t.iZ7Mz9;
const ReactionIcon = (ReactionIconModule).ReactionIcon;
return (
<View style={styles.container}>
{formInput}
<PressableOpacity
accessibilityLabel={Reflect.apply(string, intl, [iZ7Mz9])}
accessibilityRole="button"
onPress={onPressEmoji}
style={styles.emojiButton}
disabled={disabled}
>
<ReactionIcon size="md" />
</PressableOpacity>
</View>
);
}
}
global.__d(_fun76730, 9788, [31, 27, 661, 33, 4501, 697, 477, 7875, 7980, 1244, 5278, 7950,
2]) /* metro module 9788, dependencies: [31, 27, 661, 33, 4501, 697, 477, 7875, 7980, 1244, 5278, 7950, 2] */;