116 lines
6.9 KiB
TypeScript
116 lines
6.9 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] */
|
|
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
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = 0;
|
|
const env0_3 = importAll(dependencyMap[value]);
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const value2 = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value2.jsx;
|
|
const env0_6 = value2.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object3 = {};
|
|
const object5 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.paddingHorizontal = PX_16;
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
PX_16 = platformUtilsModule.isAndroid() ? (importDefault(697) /* metro dependency 697: native */).space.PX_16 : value;
|
|
object5.paddingBottom = PX_16;
|
|
object3.contentWrapper = object5;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.gifContainer = {'flexDirection': 'column', 'alignItems': 'center', marginTop: PX_8};
|
|
const object6 = {};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object6.backgroundColor = BORDER_SUBTLE;
|
|
object3.gifImage = object6;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.favoriteButtonContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'stretch', 'width': '100%',
|
|
marginTop: PX_16};
|
|
const env0_7 = Reflect.apply(createStyles, createStylesModule, [object3]);
|
|
(require(2) /* metro dependency 2 */).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 favoriteGIFHooksModule = require(9813) /* metro dependency 9813: FavoriteGIFHooks */;
|
|
const useIsFavoriteGIF = favoriteGIFHooksModule.useIsFavoriteGIF;
|
|
const gifPickerActionCreatorsModule = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
|
|
const value2 = Reflect.apply(useIsFavoriteGIF, favoriteGIFHooksModule,
|
|
[gifPickerActionCreatorsModule.gifUrlKey(item.url)]);
|
|
const {width, height} = (importDefault(1478) /* metro dependency 1478: 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 = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
let value = importDefault(5475) /* metro dependency 5475: 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 = (importDefault(697) /* metro dependency 697: 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__;
|
|
(importDefault(4080) /* metro dependency 4080: 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 = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const GifIcon = (require(9820) /* metro dependency 9820: GifIcon */).GifIcon;
|
|
env0_4();
|
|
const binding = env0_1;
|
|
const gifPickerActionCreatorsModule = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
|
|
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 = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const buttonProps = {variant: env0_1 ? 'destructive' : 'primary', onPress: env0_5};
|
|
const binding = env0_1;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
buttonProps.text = binding ? Reflect.apply(string, intl, [t['5/NS74']]) : Reflect.apply(string, intl, [t.nIH0v8]);
|
|
buttonProps.grow = true;
|
|
return <Button {...buttonProps} />;
|
|
}
|
|
|