Files
2026-07-28 01:06:53 +03:00

125 lines
8.2 KiB
TypeScript

/* Metro module 11043; source: modules/gif_picker/native/GIFPickerItemActionSheet.tsx; dependencies: [31, 27, 33, 4501, 697, 477, 9813, 9814, 1478, 4080, 3857, 1244, 9820, 4578, 6275, 5475, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import FastImage from '../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as FavoriteGIFHooksModule from '../FavoriteGIFHooks.tsx'; /* Metro dependency 9813 */
import * as GIFPickerActionCreatorsModule from '../../../actions/GIFPickerActionCreators.tsx'; /* Metro dependency 9814 */
import * as GifIconModule from '../../../design/components/Icon/native/redesign/generated/GifIcon.tsx'; /* Metro dependency 9820 */
function _fun84523(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11229:6, offset: 0x01f4de54, size: 421 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = 0;
const env0_3 = importAll(dependencyMap[value]);
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.paddingHorizontal = PX_16;
PX_16 = PlatformUtilsModule.isAndroid() ? (importDefault(697) /* metro dependency 697: native */).space.PX_16 : value;
object2.paddingBottom = PX_16;
object.contentWrapper = object2;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.gifContainer = {'flexDirection': 'column', 'alignItems': 'center', marginTop: PX_8};
const object4 = {};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object4.backgroundColor = BORDER_SUBTLE;
object.gifImage = object4;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.favoriteButtonContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'stretch', 'width': '100%',
marginTop: PX_16};
const env0_7 = Reflect.apply(createStyles, CreateStylesModule, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/gif_picker/native/GIFPickerItemActionSheet.tsx');
exports.default = _default_84524;
function _default_84524({item}) { // fn#84524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11229:584, offset: 0x01f4dff9, size: 465 bytes, params: 2, frame: 25
const styles = useStyles();
const useIsFavoriteGIF = FavoriteGIFHooksModule.useIsFavoriteGIF;
const value2 = Reflect.apply(useIsFavoriteGIF, FavoriteGIFHooksModule,
[GIFPickerActionCreatorsModule.gifUrlKey(item.url)]);
const {width, height} = (UseWindowDimensionsNative)();
const binding = height;
const value4 = binding.useMemo(_fun84525, [item.width, item.height, width, height]);
const value7 = binding.useCallback(_fun84528, [binding.useCallback(_fun84527, [binding.useCallback(_fun84526, []),
value2, item]), value2]);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
let value = FastImage;
value = ((Component) => <Component style={[styles.gifImage, value4]} source={{uri: item.src}} />)(value);
return (
<BottomSheet startExpanded>
<View style={styles.contentWrapper}>
<View style={styles.gifContainer}>
{value}
<View style={styles.favoriteButtonContainer}>
{value7()}
</View>
</View>
</View>
</BottomSheet>
);
function _fun84525() { // fn#84525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11229:706, offset: 0x01f4e1ca, size: 142 bytes, params: 1, frame: 14
const widthBinding = width;
const PX_16 = (Native).space.PX_16;
const value3 = widthBinding - 2 * PX_16;
const itemBinding = item;
const value4 = value3 / itemBinding.width;
let value = 0.5 * height;
value /= itemBinding.height;
const Math = global.Math;
value = Math.min(value4, value);
return {width: itemBinding.width * value, height: itemBinding.height * value};
}
function _fun84526() { // fn#84526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11229:868, offset: 0x01f4e258, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
}
function _fun84527() { // fn#84527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11229:922, offset: 0x01f4e27d, size: 312 bytes, params: 1, frame: 20
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const GifIcon = (GifIconModule).GifIcon;
(0, ReactNativeModule.View)();
const binding = env0_1;
if (binding) {
GIFPickerActionCreatorsModule.removeFavoriteGIF(item.url);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'REMOVED_FROM_FAVORITES',
content: intl.string(t.in1rga), IconComponent: GifIcon});
} else {
GIFPickerActionCreatorsModule.addFavoriteGIF(item);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'ADDED_TO_FAVORITES',
content: intl.string(t.okQonm), IconComponent: GifIcon});
}
}
function _fun84528() { // fn#84528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11229:1270, offset: 0x01f4e3b5, size: 162 bytes, params: 1, frame: 19
const value = environment.__proto__;
const Button = (ButtonNativeModule).Button;
const buttonProps = {variant: env0_1 ? 'destructive' : 'primary', onPress: JsxRuntimeModule.jsx};
const binding = env0_1;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
buttonProps.text = binding ? Reflect.apply(string, intl, [t['5/NS74']]) : Reflect.apply(string, intl, [t.nIH0v8]);
buttonProps.grow = true;
return <Button {...buttonProps} />;
}
}
}
global.__d(_fun84523, 11043, [31, 27, 33, 4501, 697, 477, 9813, 9814, 1478, 4080, 3857, 1244, 9820, 4578, 6275,
5475,
2]) /* metro module 11043, dependencies: [31, 27, 33, 4501, 697, 477, 9813, 9814, 1478, 4080, 3857, 1244, 9820, 4578, 6275, 5475, 2] */;