// Metro module 10932 (f10933). import { useRef, useCallback } from "react"; import { View } from "react-native"; import ChannelStore from "../../../stores/ChannelStore"; import MessageStore from "../../../stores/MessageStore"; import SummaryStore from "../SummaryStore"; import { AnalyticsSections, MessageFlags } from "../../../Constants"; import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import { computeCanStartPublicThread } from "../../threads/ThreadHooks"; import { presentFailedToast, presentError } from "../../toast/native/ToastUtils"; import { intl, t } from "../../../intl/index.native"; import { getChannelPermalink } from "../../../utils/ChannelUtils"; import { showShareActionSheet } from "../../action_sheet/native/showShareActionSheet"; import ThreadActionCreators from "../../threads/ThreadActionCreators"; import DraftActionCreators from "../../../actions/DraftActionCreators"; import { navigateToCreateThread } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native"; import SnowflakeUtils from "../../../utils/SnowflakeUtils"; import { transitionToGuild } from "../../routing/router_utils"; import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native"; import { SafeAreaPaddingView } from "../../../components_native/common/SafeAreaView"; import { TopicsIcon } from "../../../design/components/Icon/native/redesign/generated/TopicsIcon"; import { Text } from "../../../design/components/Text/native/Text"; import { SummaryActionSheetButton } from "./SummaryActionSheetButton"; import Share from "../../icons/native/Share"; import Module10122 from "../../../_bundle/Module10122"; import Module7732 from "../../../_bundle/Module7732"; const useStyles = createStyles({ summaryContainer: { padding: 16, margin: 16, marginBottom: 24, justifyContent: "center", alignItems: "center" }, summaryContent: { textAlign: "center" }, summaryIconContainer: { marginBottom: 8, borderRadius: Module712.radii.round, border: 1, overflow: "hidden", alignItems: "center", justifyContent: "center", backgroundColor: Module712.colors.BACKGROUND_BRAND }, summaryIcon: { margin: 8, width: 20, height: 20, tintColor: Module712.colors.WHITE }, summaryTopic: { marginBottom: 4 }, divider: { height: 1, backgroundColor: Module712.colors.BORDER_SUBTLE }, actionsContainer: { flexDirection: "row", justifyContent: "space-evenly", marginBottom: 16 } }); export default function SummaryActionSheet(props) { const summary = props.summary; const styles = useStyles(); const ref = useRef(null); const channel = ChannelStore.getChannel(summary.channelId); const message = MessageStore.getMessage(summary.channelId, summary.startId); let r13 = message != null && message.hasFlag(MessageFlags.HAS_THREAD); let r36 = channel != null && message != null && !message.hasFlag(MessageFlags.HAS_THREAD) && computeCanStartPublicThread(channel, message); const callback = useCallback(() => { ActionSheetActionCreators.hideActionSheet(); if (channel?.guild_id != null) { ActionSheetActionCreators.openLazy(import("../../notifications/native/GuildHighlightsNotificationsActionSheet"), "GuildHighlightsNotifications", { guildId: channel?.guild_id }); } }, [channel?.guild_id]); const callback3 = useCallback(() => { ActionSheetActionCreators.hideActionSheet(); if (channel != null) { showShareActionSheet({ message: intl.formatToPlainString(t.I3yTDn, { topic: summary.topic, url: getChannelPermalink(channel.guild_id, channel.id, summary.startId, summary.id) }), subject: summary.topic }, AnalyticsSections.SUMMARY_ACTION_SHEET); } else { presentFailedToast(intl.string(t.gvkcQl)); } }, [summary, channel]); const callback4 = useCallback(() => { L5: { ActionSheetActionCreators.hideActionSheet(); if (channel != null && message != null) { ThreadActionCreators.openThreadCreationForMobile(channel, summary.startId, AnalyticsSections.SUMMARY_ACTION_SHEET); DraftActionCreators.changeThreadSettings(channel.id, { name: summary.topic }); if (navigateToCreateThread(channel.guild_id, SnowflakeUtils.castMessageIdAsChannelId(message.id))) { break L5; } transitionToGuild(channel.guild_id, SnowflakeUtils.castMessageIdAsChannelId(message.id)); } else { presentError(intl.string(t["/+DWeQ"])); } } }, [summary, channel, message]); const callback2 = useCallback(() => { ActionSheetActionCreators.hideActionSheet(); if (channel != null && message != null) { transitionToGuild(channel.guild_id, SnowflakeUtils.castMessageIdAsChannelId(message.id)); } }, [channel, message]); const r95 = [ {summary.topic} {summary.summShort} , , ,]; const r118 = [, , , ,]; if (r36) { r36 = ; } r118[1] = r36; if (r13) { r13 = ; } r118[2] = r13; r118[3] = ; r95[2] = {r118}; return {r95} ; }; export function openSummaryDividerActionSheet(a0, a1) { const summary2 = SummaryStore.findSummary(a0, a1); if (summary2 != null) { ActionSheetActionCreators.openLazy(import("./SummaryActionSheet"), `SummaryDivider${a1}`, { summary: summary2 }); } }