148 lines
8.4 KiB
TypeScript
148 lines
8.4 KiB
TypeScript
/* Metro module 11771; source: modules/premium/native/gifting/PremiumAnimatedGiftButton.tsx; dependencies: [31, 4502, 33, 4501, 697, 1357, 3860, 566, 477, 4017, 5278, 6760, 2] */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import ReanimatedRexport from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import LottieAnimationView from '../../../../components_native/common/LottieAnimationView.tsx'; /* Metro dependency 6760 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
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 */
|
|
import * as MobileVisualRefreshExperimentModule from '../../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
|
|
import * as UseTokenModule from '../../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
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 */
|
|
|
|
function _fun90148(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:6, offset: 0x0202dada, size: 209 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_7 = (CreateStylesModule).createStyles(_fun90149);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/gifting/PremiumAnimatedGiftButton.tsx');
|
|
exports.PremiumAnimatedGiftButton = PremiumAnimatedGiftButton;
|
|
function _fun90149(a0, a1) { // fn#90149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:171, offset: 0x0202dbab, size: 204 bytes, params: 3, frame: 19
|
|
const object = {};
|
|
const object2 = {};
|
|
const REDESIGN_BUTTON_TERTIARY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND;
|
|
object2.backgroundColor = REDESIGN_BUTTON_TERTIARY_BACKGROUND;
|
|
object2.width = a0;
|
|
object2.height = a0;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object2.marginHorizontal = a1;
|
|
object2.display = 'flex';
|
|
object2.alignItems = 'center';
|
|
object2.justifyContent = 'center';
|
|
object.container = object2;
|
|
const object3 = {width: a0, height: a0};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object3.marginHorizontal = a1;
|
|
object3.display = 'flex';
|
|
object3.alignItems = 'center';
|
|
object3.justifyContent = 'center';
|
|
object.containerRefresh = object3;
|
|
object.animation = {'width': 30, 'height': 30};
|
|
object.animationRefresh = {'width': 24, 'height': 24};
|
|
return object;
|
|
}
|
|
|
|
function PremiumAnimatedGiftButton(a0) { // fn#90150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:727, offset: 0x0202dc77, size: 698 bytes, params: 2, frame: 33
|
|
const active = a0.active;
|
|
const style = a0.style;
|
|
const activeStyle = a0.activeStyle;
|
|
const disabled = a0.disabled;
|
|
const accessibilityState = a0.accessibilityState;
|
|
const channelId = a0.channelId;
|
|
const animationDataUrl = a0.animationDataUrl;
|
|
const onAnimationFinished = a0.onAnimationFinished;
|
|
const loop = a0.loop;
|
|
const value2 = undefined;
|
|
const useMobileVisualRefreshConfig = MobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig;
|
|
const enabled = Reflect.apply(useMobileVisualRefreshConfig, MobileVisualRefreshExperimentModule,
|
|
[{location: 'PremiumAnimatedGiftButton'}]).enabled;
|
|
let useToken = UseTokenModule.useToken;
|
|
const CHAT_INPUT_ACTION_BUTTON_SIZE = (Native).modules.mobile.CHAT_INPUT_ACTION_BUTTON_SIZE;
|
|
const value3 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_ACTION_BUTTON_SIZE]);
|
|
useToken = UseTokenModule.useToken;
|
|
const CHAT_INPUT_ACTION_BUTTON_MARGIN = (Native).modules.mobile.CHAT_INPUT_ACTION_BUTTON_MARGIN;
|
|
const value4 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_ACTION_BUTTON_MARGIN]);
|
|
useToken = UseTokenModule.useToken;
|
|
const CHAT_INPUT_ACTION_BUTTON_MIN_TOUCH_TARGET_SIZE = (Native).modules.mobile.CHAT_INPUT_ACTION_BUTTON_MIN_TOUCH_TARGET_SIZE;
|
|
const value5 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_ACTION_BUTTON_MIN_TOUCH_TARGET_SIZE]);
|
|
const styles = useStyles(value3, value4);
|
|
const Math = global.Math;
|
|
const value6 = Math.max(0, (value5 - value3) / 2);
|
|
const value7 = useRef(null);
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
ReactModule.useEffect(_fun90152, [channelId, useReducedMotion]);
|
|
const View = (ReanimatedRexport).View;
|
|
const FadeOut = useReducedMotion ? value2 : (require(4017) /* metro dependency 4017: ReanimatedRexport */).FadeOut;
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const object2 = {};
|
|
const r23 = enabled ? styles.containerRefresh : styles.container;
|
|
object2.style = [r23, style, active && !disabled && activeStyle];
|
|
object2.hitSlop = value6 > 0 ? value6 : value2;
|
|
object2.accessibilityRole = 'button';
|
|
const object3 = {disabled: disabled};
|
|
copyDataProperties(object3, accessibilityState, r23);
|
|
object2.accessibilityState = object3;
|
|
copyDataProperties(object2, a0, r23);
|
|
let value = LottieAnimationView;
|
|
value = ((Component) => <Component ref={value7} style={enabled ? styles.animationRefresh : styles.animation} source={{uri: animationDataUrl}} loop={loop} autoPlay={false} onAnimationFinish={onAnimationFinished} />)(value);
|
|
return (
|
|
<View exiting={FadeOut}>
|
|
<PressableOpacity {...object2}>
|
|
{value}
|
|
</PressableOpacity>
|
|
</View>
|
|
);
|
|
function _fun90152() { // fn#90152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11957:1355, offset: 0x0202df31, size: 143 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var r3;
|
|
var r1;
|
|
var value2;
|
|
var value3;
|
|
var moduleValue;
|
|
var value4;
|
|
var current;
|
|
var value6;
|
|
if (!useReducedMotion) {
|
|
value2 = environment.__proto__;
|
|
value3 = undefined;
|
|
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (moduleValue.isIOS()) {
|
|
value4 = env0_0 == null;
|
|
if (value4) {
|
|
r0 = value4;
|
|
r3 = value3;
|
|
} else {
|
|
current = env0_0.current;
|
|
r0 = current == null;
|
|
r3 = current;
|
|
}
|
|
if (!r0) {
|
|
r3.reset();
|
|
}
|
|
}
|
|
value6 = env0_0 == null;
|
|
if (value6) {
|
|
r0 = value6;
|
|
r1 = value3;
|
|
} else {
|
|
current = env0_0.current;
|
|
r0 = current == null;
|
|
r1 = current;
|
|
}
|
|
if (!r0) {
|
|
r1.play();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun90148, 11771, [31, 4502, 33, 4501, 697, 1357, 3860, 566, 477, 4017, 5278, 6760,
|
|
2]) /* metro module 11771, dependencies: [31, 4502, 33, 4501, 697, 1357, 3860, 566, 477, 4017, 5278, 6760, 2] */;
|