459 lines
22 KiB
TypeScript
459 lines
22 KiB
TypeScript
// Metro module 10278 (f10279).
|
|
import * as Module19 from "react";
|
|
import { useMemo, useCallback, useEffect } from "react";
|
|
import { View } from "react-native";
|
|
import AccessibilityStore from "../../a11y/AccessibilityStore";
|
|
import { DEFAULT_ANIMATION_TIMING, IN_APP_NOTIFICATION_MAX_HEIGHT, NOTIFICATION_PREVIEW_LINE_CLAMP, RIGHT_ACCESSORY_LEFT_MARGIN } from "./InAppNotificationConstants";
|
|
import { MessageEmbedTypes } from "../../../Constants";
|
|
import * as _PlatformUtils from "../../../utils/PlatformUtils";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import MessagePreviewText from "./MessagePreviewText";
|
|
import useTruncatedGradientColors from "./hooks/useTruncatedGradientColors";
|
|
import { useStateFromStores } from "../../../_bundle/Module589";
|
|
import { useHasPreviewableMedia } from "./InAppNotificationUtils";
|
|
import useWindowDimensions_native from "../../screen/useWindowDimensions.native";
|
|
import ReanimatedRexport, { useSharedValue, useAnimatedStyle, useDerivedValue } from "../../reanimated/ReanimatedRexport";
|
|
import { NativeChannelRowPreview } from "../../main_tabs_v2/native/shared_components/ChannelRowPreview";
|
|
import { RoleDot, Avatar, AvatarSizes } from "../../../design/void/native";
|
|
import { useInAppNotificationContext } from "./InAppNotificationContext";
|
|
import { triggerHapticFeedback, HapticFeedbackTypes } from "../../haptics/HapticUtils.native";
|
|
import { addReaction, ReactionLocations } from "../../reactions/ReactionActionCreators";
|
|
import { toReactionEmoji } from "../../reactions/ReactionUtils";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { getUserAuthor, useNullableMessageAuthor } from "../../messages/useMessageAuthor";
|
|
import { useIsScreenReaderEnabled } from "../../a11y/native/useIsScreenReaderEnabled.native";
|
|
import MessageParser from "../../messages/MessageParser";
|
|
import { AccessibilityAnnouncer } from "../../../_bundle/Module3902";
|
|
import ModalActionCreators from "../../../actions/ModalActionCreators";
|
|
import { transitionToMessage } from "../../routing/transitionToChannel";
|
|
import * as _MediaPreviewRightAccessory from "./MediaPreviewRightAccessory";
|
|
import { MediaPreviewRightAccessory } from "./MediaPreviewRightAccessory";
|
|
import * as _timing from "../../../design/animation/reanimated/timing/timing";
|
|
import { NotificationPressable } from "./Notification";
|
|
import { MessageNotificationReactBar } from "./MessageNotificationReactBar";
|
|
function $mk84317($env) {
|
|
return (a0) => {
|
|
const height = a0.nativeEvent.layout.height;
|
|
if (height > 0) {
|
|
$env[0].set(height);
|
|
}
|
|
};
|
|
}
|
|
let __initData, __initData2, Component, __initData3, Component2, __initData4, __initData5, __initData6, Component4, __initData7, __initData8, __initData9, __initData10;
|
|
const ACCESSORY_EXIT_THRESHOLD = 20;
|
|
const isAndroid = _PlatformUtils.isAndroid();
|
|
const PX_12 = Module712.space.PX_12;
|
|
const PX_8 = Module712.space.PX_8;
|
|
const useStyles = createStyles({
|
|
newContainerRoleDot: {
|
|
paddingRight: 4,
|
|
paddingTop: 0
|
|
},
|
|
initialPreviewOverlay: {
|
|
position: "absolute",
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
overflow: "hidden"
|
|
},
|
|
expandedPreviewOverlay: {
|
|
position: "absolute",
|
|
top: 0,
|
|
left: 0,
|
|
right: 0
|
|
}
|
|
});
|
|
let Component3 = Module19.memo(function(a0) {
|
|
return <MessagePreviewText message={a0.message} lineClamp={NOTIFICATION_PREVIEW_LINE_CLAMP} maxHeight={IN_APP_NOTIFICATION_MAX_HEIGHT} />;
|
|
});
|
|
__initData = {
|
|
code: "function MessageNotificationTsx1(){const{contentHeight,EXPANDED_MAX_HEIGHT,TRUNCATED_MESSAGE_HEIGHT_OFFSET,EXPANDED_SHORT_PREVIEW_PADDING}=this.__closure;const isGradientShown=contentHeight.get()>=EXPANDED_MAX_HEIGHT-TRUNCATED_MESSAGE_HEIGHT_OFFSET;const isShortPreview=contentHeight.get()>0&&!isGradientShown;return{paddingBottom:isShortPreview?EXPANDED_SHORT_PREVIEW_PADDING:0};}"
|
|
};
|
|
__initData2 = {
|
|
code: "function MessageNotificationTsx2(){const{IS_ANDROID,hasPreviewableMedia,hasTextContent,hasEmbedMedia,fadeProgress,ACCESSORY_EXIT_THRESHOLD}=this.__closure;if(IS_ANDROID&&hasPreviewableMedia&&hasTextContent&&!hasEmbedMedia){return{opacity:fadeProgress.get()};}if(!hasTextContent||hasEmbedMedia){return{opacity:fadeProgress.get(),transform:[{translateY:(1-fadeProgress.get())*ACCESSORY_EXIT_THRESHOLD}]};}return{opacity:1};}"
|
|
};
|
|
Component = Module19.memo(function({ message, expandedPreviewHeight, fadeProgress }) {
|
|
let hasPreviewableMedia, memo, c17830_4, c17830_5, sharedValue;
|
|
let env17831;
|
|
let env17832;
|
|
hasPreviewableMedia = void 0;
|
|
memo = void 0;
|
|
c17830_4 = void 0;
|
|
c17830_5 = void 0;
|
|
sharedValue = void 0;
|
|
const styles = useStyles();
|
|
const truncatedGradientColors = useTruncatedGradientColors();
|
|
const { gradientColors, gradientStyles } = truncatedGradientColors;
|
|
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
|
|
hasPreviewableMedia = useHasPreviewableMedia(message);
|
|
memo = useMemo(() => message.embeds.some((embed) => embed.image != null || embed.thumbnail != null || embed.type === MessageEmbedTypes.GIFV), [message.embeds]);
|
|
const memo2 = useMemo(() => {
|
|
let r1 = hasPreviewableMedia;
|
|
if (!hasPreviewableMedia) {
|
|
r1 = message.poll != null;
|
|
}
|
|
if (!r1) {
|
|
r1 = memo;
|
|
}
|
|
return r1;
|
|
}, [hasPreviewableMedia, message.poll, memo]);
|
|
const hasTextContent = message.content.length > 0;
|
|
c17830_4 = hasTextContent;
|
|
const EXPANDED_MAX_HEIGHT = 0.24 * useWindowDimensions_native({
|
|
ignoreKeyboard: true
|
|
}).height;
|
|
c17830_5 = EXPANDED_MAX_HEIGHT;
|
|
const r52 = env17831 = {};
|
|
env17831[0] = expandedPreviewHeight;
|
|
const callback2 = useCallback($mk84317(r52), [expandedPreviewHeight]);
|
|
sharedValue = useSharedValue(0);
|
|
const r60 = env17832 = {};
|
|
env17832[0] = sharedValue;
|
|
const callback3 = useCallback($mk84317(r60), [sharedValue]);
|
|
const r68 = function h() {
|
|
const r9 = sharedValue.get() >= c17830_5 - PX_8;
|
|
return {
|
|
paddingBottom: sharedValue.get() > 0 ? r9 ? 0 : PX_12 : 0
|
|
};
|
|
};
|
|
r68.__closure = {
|
|
contentHeight: sharedValue,
|
|
EXPANDED_MAX_HEIGHT,
|
|
TRUNCATED_MESSAGE_HEIGHT_OFFSET: PX_8,
|
|
EXPANDED_SHORT_PREVIEW_PADDING: PX_12
|
|
};
|
|
r68.__workletHash = 4300216170219;
|
|
r68.__initData = __initData;
|
|
const animatedStyle = useAnimatedStyle(r68);
|
|
const r77 = function u() {
|
|
return isAndroid && (hasPreviewableMedia && (c17830_4 && !memo)) ? {
|
|
opacity: fadeProgress.get()
|
|
} : c17830_4 && !memo ? {
|
|
opacity: 1
|
|
} : {
|
|
opacity: fadeProgress.get(),
|
|
transform: [{
|
|
translateY: (1 - fadeProgress.get()) * ACCESSORY_EXIT_THRESHOLD
|
|
}]
|
|
};
|
|
};
|
|
r77.__closure = {
|
|
IS_ANDROID: isAndroid,
|
|
hasPreviewableMedia,
|
|
hasTextContent,
|
|
hasEmbedMedia: memo,
|
|
fadeProgress,
|
|
ACCESSORY_EXIT_THRESHOLD
|
|
};
|
|
r77.__workletHash = 9879198032662;
|
|
r77.__initData = __initData2;
|
|
const animatedStyle2 = useAnimatedStyle(r77);
|
|
return <ReanimatedRexport.View style={[styles.expandedPreviewOverlay, memo2 ? animatedStyle2 : null, animatedStyle]} onLayout={callback2}>
|
|
<View onLayout={callback3}>
|
|
<NativeChannelRowPreview message={message} lineClamp={memo2 ? 6 : void 0} maxHeight={EXPANDED_MAX_HEIGHT} gifAutoPlay={!stateFromStores} gradientStyles={gradientStyles} gradientColors={gradientColors} />
|
|
</View>
|
|
</ReanimatedRexport.View>;
|
|
});
|
|
__initData3 = {
|
|
code: "function MessageNotificationTsx3(){const{shouldHandlePreviewableMediaExpand,fadeProgress,accessoryWidthSV}=this.__closure;return shouldHandlePreviewableMediaExpand?{opacity:Math.max(0,1-fadeProgress.get()*2),right:accessoryWidthSV.get()}:{opacity:Math.max(0,1-fadeProgress.get()*2)};}"
|
|
};
|
|
Component2 = Module19.memo(function({ initialPreviewHeight: initialPreviewHeight2, fadeProgress: fadeProgress2, initialPreviewContent, accessoryWidthSV, shouldHandlePreviewableMediaExpand }) {
|
|
let env17834;
|
|
const styles = useStyles();
|
|
const r15 = env17834 = {};
|
|
env17834[0] = initialPreviewHeight2;
|
|
const callback2 = useCallback($mk84317(r15), [initialPreviewHeight2]);
|
|
const r23 = () => shouldHandlePreviewableMediaExpand ? {
|
|
opacity: Math.max(0, 1 - 2 * fadeProgress2.get()),
|
|
right: accessoryWidthSV.get()
|
|
} : {
|
|
opacity: Math.max(0, 1 - 2 * fadeProgress2.get())
|
|
};
|
|
r23.__closure = {
|
|
shouldHandlePreviewableMediaExpand,
|
|
fadeProgress: fadeProgress2,
|
|
accessoryWidthSV
|
|
};
|
|
r23.__workletHash = 15466459240148;
|
|
r23.__initData = __initData3;
|
|
return <ReanimatedRexport.View style={[styles.initialPreviewOverlay, useAnimatedStyle(r23)]}>
|
|
<View onLayout={callback2}>{initialPreviewContent}</View>
|
|
</ReanimatedRexport.View>;
|
|
});
|
|
__initData4 = {
|
|
code: "function MessageNotificationTsx4(){const{expandedPreviewHeight,EXPANDED_MAX_HEIGHT,expandedSV,notificationGestureY,initialPreviewHeight}=this.__closure;const maxExpandedHeight=Math.min(expandedPreviewHeight.get(),EXPANDED_MAX_HEIGHT);if(expandedSV.get()){return maxExpandedHeight;}const dragDistance=Math.max(0,notificationGestureY.get());const maxHeight=Math.max(maxExpandedHeight,initialPreviewHeight.get());return Math.min(initialPreviewHeight.get()+dragDistance,maxHeight);}"
|
|
};
|
|
__initData5 = {
|
|
code: "function MessageNotificationTsx5(){const{expandedSV,expandedPreviewHeight,EXPANDED_MAX_HEIGHT,initialPreviewHeight,notificationGestureY,ACCESSORY_EXIT_THRESHOLD,currentHeight}=this.__closure;if(expandedSV.get()){return 1;}const maxExpandedHeight=Math.min(expandedPreviewHeight.get(),EXPANDED_MAX_HEIGHT);const heightDifference=maxExpandedHeight-initialPreviewHeight.get();const dragDistance=Math.max(0,notificationGestureY.get());if(heightDifference<=0){return Math.min(1,dragDistance/ACCESSORY_EXIT_THRESHOLD);}return Math.min(1,(currentHeight.get()-initialPreviewHeight.get())/heightDifference);}"
|
|
};
|
|
__initData6 = {
|
|
code: "function MessageNotificationTsx6(){const{shouldHandlePreviewableMediaExpand,currentHeight,accessoryWidthSV}=this.__closure;return shouldHandlePreviewableMediaExpand?{overflow:'hidden',height:currentHeight.get(),marginRight:-accessoryWidthSV.get()}:{overflow:'hidden',height:currentHeight.get()};}"
|
|
};
|
|
Component4 = Module19.memo(function({ message: message3, expandedSV, notificationGestureY, initialPreviewContent, initialPreviewHeight, accessoryWidthSV: accessoryWidthSV2 }) {
|
|
let derivedValue;
|
|
derivedValue = void 0;
|
|
const EXPANDED_MAX_HEIGHT = 0.24 * useWindowDimensions_native({
|
|
ignoreKeyboard: true
|
|
}).height;
|
|
let c17835_4 = EXPANDED_MAX_HEIGHT;
|
|
const sharedValue2 = useSharedValue(EXPANDED_MAX_HEIGHT);
|
|
const hasPreviewableMedia4 = useHasPreviewableMedia(message3);
|
|
let r11 = isAndroid;
|
|
if (isAndroid) {
|
|
r11 = hasPreviewableMedia4;
|
|
}
|
|
const hasPreviewableMedia2 = r11;
|
|
const r36 = function h() {
|
|
const r10 = Math.min(sharedValue2.get(), c17835_4);
|
|
if (expandedSV.get()) {
|
|
return r10;
|
|
}
|
|
const r18 = Math.max(0, notificationGestureY.get());
|
|
const r24 = Math.max(r10, initialPreviewHeight.get());
|
|
return Math.min(initialPreviewHeight.get() + r18, r24);
|
|
};
|
|
r36.__closure = {
|
|
expandedPreviewHeight: sharedValue2,
|
|
EXPANDED_MAX_HEIGHT,
|
|
expandedSV,
|
|
notificationGestureY,
|
|
initialPreviewHeight
|
|
};
|
|
r36.__workletHash = 10745028098653;
|
|
r36.__initData = __initData4;
|
|
derivedValue = useDerivedValue(r36);
|
|
const r42 = function u() {
|
|
if (expandedSV.get()) {
|
|
return 1;
|
|
}
|
|
const r18 = Math.min(sharedValue2.get(), c17835_4) - initialPreviewHeight.get();
|
|
const r23 = Math.max(0, notificationGestureY.get());
|
|
return r18 <= 0 ? Math.min(1, r23 / ACCESSORY_EXIT_THRESHOLD) : Math.min(1, (derivedValue.get() - initialPreviewHeight.get()) / r18);
|
|
};
|
|
r42.__closure = {
|
|
expandedSV,
|
|
expandedPreviewHeight: sharedValue2,
|
|
EXPANDED_MAX_HEIGHT,
|
|
initialPreviewHeight,
|
|
notificationGestureY,
|
|
ACCESSORY_EXIT_THRESHOLD,
|
|
currentHeight: derivedValue
|
|
};
|
|
r42.__workletHash = 7693825745292;
|
|
r42.__initData = __initData5;
|
|
const derivedValue4 = useDerivedValue(r42);
|
|
const _ = () => hasPreviewableMedia2 ? {
|
|
overflow: "hidden",
|
|
height: derivedValue.get(),
|
|
marginRight: -accessoryWidthSV2.get()
|
|
} : {
|
|
overflow: "hidden",
|
|
height: derivedValue.get()
|
|
};
|
|
_.__closure = {
|
|
shouldHandlePreviewableMediaExpand: hasPreviewableMedia2,
|
|
currentHeight: derivedValue,
|
|
accessoryWidthSV: accessoryWidthSV2
|
|
};
|
|
_.__workletHash = 9399498954959;
|
|
_.__initData = __initData6;
|
|
return <ReanimatedRexport.View style={useAnimatedStyle(_)}>
|
|
<Component message={message3} expandedPreviewHeight={sharedValue2} fadeProgress={derivedValue4} />
|
|
<Component2 initialPreviewHeight={initialPreviewHeight} fadeProgress={derivedValue4} initialPreviewContent={initialPreviewContent} accessoryWidthSV={accessoryWidthSV2} shouldHandlePreviewableMediaExpand={hasPreviewableMedia2} />
|
|
</ReanimatedRexport.View>;
|
|
});
|
|
__initData7 = {
|
|
code: "function MessageNotificationTsx7(){const{isExpandableNotification,expandedSV,notificationGestureY,ACCESSORY_EXIT_THRESHOLD}=this.__closure;if(!isExpandableNotification){return 0;}if(expandedSV.get()){return 1;}const dragDistance=Math.max(0,notificationGestureY.get());return Math.min(1,dragDistance/ACCESSORY_EXIT_THRESHOLD);}"
|
|
};
|
|
__initData8 = {
|
|
code: "function MessageNotificationTsx8(){const{PREVIEW_SIZE,RIGHT_ACCESSORY_LEFT_MARGIN,accessoryExitProgressSV}=this.__closure;return(PREVIEW_SIZE+RIGHT_ACCESSORY_LEFT_MARGIN)*(1-accessoryExitProgressSV.get());}"
|
|
};
|
|
__initData9 = {
|
|
code: "function MessageNotificationTsx9(){const{isExpandableNotification,hasPreviewableMedia,accessoryWidthSV,PREVIEW_SIZE}=this.__closure;if(!isExpandableNotification||!hasPreviewableMedia){return{};}return{marginRight:accessoryWidthSV.get(),minHeight:PREVIEW_SIZE};}"
|
|
};
|
|
__initData10 = {
|
|
code: "function MessageNotificationTsx10(){const{withTiming,expandedSV,DEFAULT_ANIMATION_TIMING}=this.__closure;return{opacity:withTiming(expandedSV.get()?1:0,DEFAULT_ANIMATION_TIMING),maxHeight:withTiming(expandedSV.get()?60:0,DEFAULT_ANIMATION_TIMING)};}"
|
|
};
|
|
const r78 = Module19.memo(function MessageNotification(props) {
|
|
let isExpanded, expandedSV2, notificationGestureY2, handleDismissNotification, isExpandableNotification, callback, hasPreviewableMedia3, derivedValue2, derivedValue3;
|
|
const notification = props.notification;
|
|
isExpanded = void 0;
|
|
expandedSV2 = void 0;
|
|
notificationGestureY2 = void 0;
|
|
handleDismissNotification = void 0;
|
|
isExpandableNotification = void 0;
|
|
callback = void 0;
|
|
hasPreviewableMedia3 = void 0;
|
|
derivedValue2 = void 0;
|
|
derivedValue3 = void 0;
|
|
const styles = useStyles();
|
|
const { message: message2, channel, parentChannel, guild } = notification;
|
|
if (message2.content.length === 0 && message2.interaction !== null && message2.interaction !== void 0 && message2.activityInstance !== null && message2.activityInstance !== void 0) {
|
|
message2.content = intl.formatToPlainString(t["7eikg1"], {
|
|
username: getUserAuthor(message2.interaction?.user, channel).nick
|
|
});
|
|
}
|
|
const nullableMessageAuthor = useNullableMessageAuthor(message2);
|
|
const newContainerRoleDot = styles.newContainerRoleDot;
|
|
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.roleStyle);
|
|
let color = nullableMessageAuthor?.colorString;
|
|
if (color == null) {
|
|
color = void 0;
|
|
}
|
|
const accessoryLabelNode = stateFromStores === "dot" ? color !== void 0 ? <RoleDot color={color} colors={nullableMessageAuthor?.colorStrings} containerStyles={newContainerRoleDot} /> : void 0 : void 0;
|
|
const inAppNotificationContext = useInAppNotificationContext();
|
|
isExpanded = inAppNotificationContext.isExpanded;
|
|
expandedSV2 = inAppNotificationContext.expandedSV;
|
|
notificationGestureY2 = inAppNotificationContext.notificationGestureY;
|
|
handleDismissNotification = inAppNotificationContext.handleDismissNotification;
|
|
let isExpandableNotification2 = inAppNotificationContext.isExpandableNotification;
|
|
isExpandableNotification = isExpandableNotification2;
|
|
const showReactionBar = inAppNotificationContext.showReactionBar;
|
|
const inAppNotificationContext2 = useInAppNotificationContext();
|
|
const { setExpanded, setAutoDismissing, setActionTaken, isExpanded: isExpanded2, setConfirmation } = inAppNotificationContext2;
|
|
const callback2 = useCallback((a0, a1, a2) => {
|
|
triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
|
|
addReaction(a0.channel.id, a0.message.id, toReactionEmoji(a1), ReactionLocations.IN_APP_NOTIFICATION, {
|
|
burst: a2
|
|
});
|
|
setActionTaken(true);
|
|
setExpanded(false);
|
|
setConfirmation({
|
|
type: "message",
|
|
reaction: a1,
|
|
message: intl.string(t.UjTvrz)
|
|
});
|
|
setAutoDismissing(true);
|
|
}, [setActionTaken, setExpanded, setAutoDismissing, setConfirmation]);
|
|
const accessibilityActions = isExpandableNotification ? [{
|
|
name: "expand_toggle",
|
|
label: intl.string(t["PbxI/x"])
|
|
}] : void 0;
|
|
callback = callback2;
|
|
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
useEffect(() => {
|
|
AccessibilityAnnouncer.announce(intl.formatToPlainString(t.Hjp1LH, {
|
|
userName: nullableMessageAuthor.nick,
|
|
message: MessageParser.unparse(message2.content, channel.id, true)
|
|
}));
|
|
}, [nullableMessageAuthor.nick, channel.id, message2.content]);
|
|
const callback3 = useCallback(() => {
|
|
ModalActionCreators.popAll();
|
|
transitionToMessage(channel.id, message2.id, {
|
|
navigationReplace: true
|
|
});
|
|
}, [channel.id, message2.id]);
|
|
const callback4 = useCallback(() => ModalActionCreators.pushLazy(import("../../../components_native/InAppNotificationSettingsModal"), {
|
|
channelId: channel.id
|
|
}, "in-app-notification-settings-modal"), [channel.id]);
|
|
hasPreviewableMedia3 = useHasPreviewableMedia(message2);
|
|
const sharedValue3 = useSharedValue(IN_APP_NOTIFICATION_MAX_HEIGHT);
|
|
const F = function F() {
|
|
if (isExpandableNotification) {
|
|
if (expandedSV2.get()) {
|
|
return 1;
|
|
}
|
|
return Math.min(1, Math.max(0, notificationGestureY2.get()) / ACCESSORY_EXIT_THRESHOLD);
|
|
}
|
|
return 0;
|
|
};
|
|
F.__closure = {
|
|
isExpandableNotification,
|
|
expandedSV: expandedSV2,
|
|
notificationGestureY: notificationGestureY2,
|
|
ACCESSORY_EXIT_THRESHOLD
|
|
};
|
|
F.__workletHash = 10189805207166;
|
|
F.__initData = __initData7;
|
|
derivedValue2 = useDerivedValue(F);
|
|
const k = () => (_MediaPreviewRightAccessory.PREVIEW_SIZE + RIGHT_ACCESSORY_LEFT_MARGIN) * (1 - derivedValue2.get());
|
|
k.__closure = {
|
|
PREVIEW_SIZE: _MediaPreviewRightAccessory.PREVIEW_SIZE,
|
|
RIGHT_ACCESSORY_LEFT_MARGIN,
|
|
accessoryExitProgressSV: derivedValue2
|
|
};
|
|
k.__workletHash = 12027019053130;
|
|
k.__initData = __initData8;
|
|
derivedValue3 = useDerivedValue(k);
|
|
const U = function U() {
|
|
return isExpandableNotification && hasPreviewableMedia3 ? {
|
|
marginRight: derivedValue3.get(),
|
|
minHeight: _MediaPreviewRightAccessory.PREVIEW_SIZE
|
|
} : {};
|
|
};
|
|
U.__closure = {
|
|
isExpandableNotification,
|
|
hasPreviewableMedia: hasPreviewableMedia3,
|
|
accessoryWidthSV: derivedValue3,
|
|
PREVIEW_SIZE: _MediaPreviewRightAccessory.PREVIEW_SIZE
|
|
};
|
|
U.__workletHash = 2118539495108;
|
|
U.__initData = __initData9;
|
|
const animatedStyle = useAnimatedStyle(U);
|
|
const memo2 = useMemo(() => ({
|
|
type: "message",
|
|
channel,
|
|
parentChannel,
|
|
guild,
|
|
author: nullableMessageAuthor,
|
|
expanded: isExpanded,
|
|
onDismiss: handleDismissNotification
|
|
}), [channel, parentChannel, guild, nullableMessageAuthor, isExpanded, handleDismissNotification]);
|
|
const initialPreviewContent = <Component3 message={message2} />;
|
|
const children = isExpandableNotification ? <Component4 message={message2} expandedSV={expandedSV2} notificationGestureY={notificationGestureY2} initialPreviewContent={initialPreviewContent} initialPreviewHeight={sharedValue3} accessoryWidthSV={derivedValue3} /> : initialPreviewContent;
|
|
const Z = function Z() {
|
|
return {
|
|
opacity: _timing.withTiming(expandedSV2.get() ? 1 : 0, DEFAULT_ANIMATION_TIMING),
|
|
maxHeight: _timing.withTiming(expandedSV2.get() ? 60 : 0, DEFAULT_ANIMATION_TIMING)
|
|
};
|
|
};
|
|
Z.__closure = {
|
|
withTiming: _timing.withTiming,
|
|
expandedSV: expandedSV2,
|
|
DEFAULT_ANIMATION_TIMING
|
|
};
|
|
Z.__workletHash = 2035414692485;
|
|
Z.__initData = __initData10;
|
|
const animatedStyle2 = useAnimatedStyle(Z);
|
|
const props2 = {
|
|
icon: <Avatar user={message2.author} guildId={notification.guild?.id} size={AvatarSizes.NORMAL} />,
|
|
accessoryLabelNode,
|
|
bodyStyle: animatedStyle,
|
|
rightAccessory: isExpandableNotification ? isExpanded ? null : <MediaPreviewRightAccessory message={message2} accessoryExitProgressSV={isExpandableNotification ? derivedValue2 : void 0} /> : <MediaPreviewRightAccessory message={message2} accessoryExitProgressSV={isExpandableNotification ? derivedValue2 : void 0} />,
|
|
children,
|
|
header: memo2,
|
|
showDragHandle: null,
|
|
onAccessibilityExpand: null,
|
|
expandedContentVisible: null,
|
|
notification: null,
|
|
onPress: null,
|
|
onSettingsPress: null,
|
|
accessibilityActions: null,
|
|
onAccessibilityAction: null,
|
|
expandableContent: null
|
|
};
|
|
if (isExpandableNotification) {
|
|
isExpandableNotification2 = isExpanded ? isScreenReaderEnabled : !isExpanded;
|
|
}
|
|
const onAccessibilityExpand = function onAccessibilityExpand() {
|
|
setExpanded(!isExpanded2, "accessibility_expand");
|
|
};
|
|
const onAccessibilityAction = function onAccessibilityAction(a0) {
|
|
if (a0.nativeEvent.actionName === "expand_toggle") {
|
|
setExpanded(!isExpanded2, "accessibility_expand");
|
|
}
|
|
};
|
|
props2.showDragHandle = isExpandableNotification2;
|
|
props2.onAccessibilityExpand = onAccessibilityExpand;
|
|
props2.expandedContentVisible = isExpanded;
|
|
props2.notification = notification;
|
|
props2.onPress = callback3;
|
|
props2.onSettingsPress = callback4;
|
|
props2.accessibilityActions = accessibilityActions;
|
|
props2.onAccessibilityAction = onAccessibilityAction;
|
|
props2.expandableContent = showReactionBar ? <MessageNotificationReactBar notification={notification} onReactionPress={(event, a1) => callback(notification, event, a1)} animationStyle={animatedStyle2} /> : void 0;
|
|
return <NotificationPressable {...props2} />;
|
|
});
|
|
export default r78;
|