97 lines
3.6 KiB
TypeScript
97 lines
3.6 KiB
TypeScript
// Metro module 6134 (f6135).
|
|
import { View, StyleSheet } from "react-native";
|
|
import { createStyles } from "../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../_bundle/Module712";
|
|
import ActionSheetActionCreators from "../../modules/action_sheet/native/ActionSheetActionCreators";
|
|
import { getDeviceSpecificString } from "../../modules/intl/overrides/getDeviceSpecificString";
|
|
import { t, intl } from "../../intl/index.native";
|
|
import { BottomSheet } from "../../design/components/Sheet/native/BottomSheet.native";
|
|
import { BACKDROP_OPACITY } from "../../modules/messages/native/burst_reactions/BurstReactionEffectUtils";
|
|
import BurstReactionAnimationPreview from "../../modules/messages/native/burst_reactions/BurstReactionAnimationPreview";
|
|
import { ReactionTypes } from "../../modules/messages/MessageReactionsTypes";
|
|
import { NitroWheel } from "../../design/void/native";
|
|
import { Text } from "../../design/components/Text/native/Text";
|
|
import { Button } from "../../design/components/Button/native/Button.native";
|
|
import { UNSAFE_isDismissibleContentDismissed, UNSAFE_markDismissibleContentAsDismissed } from "../../modules/dismissible_content/DismissibleContentUnsafeUtils";
|
|
import { DismissibleContent } from "../../_bundle/Module1358";
|
|
import Dispatcher from "../../Dispatcher";
|
|
let useStyles;
|
|
const onDismiss = function onDismiss() {
|
|
ActionSheetActionCreators.hideActionSheet();
|
|
};
|
|
useStyles = createStyles({
|
|
container: {
|
|
paddingTop: 24,
|
|
paddingBottom: 24,
|
|
paddingLeft: 12,
|
|
paddingRight: 12
|
|
},
|
|
fill: {
|
|
...StyleSheet.absoluteFillObject,
|
|
flex: 1,
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
top: -120
|
|
},
|
|
nitroWheel: {
|
|
tintColor: Module712.colors.TEXT_SUBTLE,
|
|
width: 37.5,
|
|
height: 37.5
|
|
},
|
|
textContainer: {
|
|
flexDirection: "row",
|
|
flexShrink: 1,
|
|
alignItems: "center",
|
|
alignSelf: "center",
|
|
textAlign: "center"
|
|
},
|
|
body: {
|
|
paddingTop: 8,
|
|
paddingBottom: 18
|
|
},
|
|
content: {
|
|
paddingHorizontal: 16
|
|
}
|
|
});
|
|
export default function BurstReactionFirstSendActionSheet(props) {
|
|
const { emoji, channelId, messageId } = props;
|
|
const styles = useStyles();
|
|
const deviceSpecificString = getDeviceSpecificString({
|
|
quest: t["5TpPli"]
|
|
}, t["2Yp7dF"]);
|
|
return <BottomSheet backdropOpacity={BACKDROP_OPACITY} contentStyles={styles.content} backdropChildren={<View style={styles.fill}>
|
|
<BurstReactionAnimationPreview channelId={channelId} emoji={emoji} messageId={messageId} reactionType={ReactionTypes.BURST} />
|
|
</View>} onDismiss={onDismiss}>
|
|
<View style={styles.container}>
|
|
<View style={styles.textContainer}>
|
|
<NitroWheel style={styles.nitroWheel} />
|
|
<Text variant="heading-xl/bold">
|
|
{intl.string(t.NX7HI7)}
|
|
</Text>
|
|
</View>
|
|
<View style={styles.body}>
|
|
<Text style={styles.textContainer} variant="text-md/normal">{deviceSpecificString}</Text>
|
|
</View>
|
|
<Button text={intl.string(t["+IrDzN"])} onPress={onDismiss} />
|
|
</View>
|
|
</BottomSheet>;
|
|
};
|
|
export function openBurstReactionFirstSendActionSheet({ channelId, messageId, emoji }) {
|
|
ActionSheetActionCreators.hideActionSheet();
|
|
if (UNSAFE_isDismissibleContentDismissed(DismissibleContent.SUPER_REACTIONS_FIRST_SENT)) {
|
|
Dispatcher.dispatch({
|
|
type: "BURST_REACTION_EFFECT_SEND",
|
|
channelId,
|
|
messageId,
|
|
emoji
|
|
});
|
|
} else {
|
|
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.SUPER_REACTIONS_FIRST_SENT);
|
|
ActionSheetActionCreators.openLazy(import("./BurstReactionFirstSendActionSheet"), "BurstReactionFirstSendActionSheet", {
|
|
channelId,
|
|
messageId,
|
|
emoji
|
|
});
|
|
}
|
|
}
|