// Metro module 11530 (f11531). import { useCallback } from "react"; import { StyleSheet, View } from "react-native"; import ChannelStore from "../../stores/ChannelStore"; import GuildStore from "../../stores/GuildStore"; import LurkingStore from "./LurkingStore"; import { JoinGuildSources } from "../../Constants"; import { openAlert } from "../../design/components/AlertModal/native/useAlertStore.native"; import GuildIcon, { GuildIconSizes, ImageSizes } from "../guild/native/GuildIcon"; import { createStyles } from "../../design/components/Styles/native/createStyles"; import { trackLeavePromptLeaveClicked, trackJoinClicked } from "./LurkerPreviewAnalytics"; import { AlertModal, AlertActionButton } from "../../design/components/AlertModal/native/AlertModal.native"; import { intl, t } from "../../intl/index.native"; import GuildBadgeV2 from "../guild/native/GuildBadgeV2"; import { Icon } from "../../design/void/native"; import { setHubProgressActionComplete } from "../hub/HubProgressActionCreators"; import { HubProgressStep } from "../../_bundle/Module1306"; import LurkerPreviewManager from "./LurkerPreviewManager"; import GuildActionCreators from "../../actions/GuildActionCreators"; let c7863_13, useStyles; const LurkerLeavePromptModal = function LurkerLeavePromptModal(props) { const { guild, onJoin: onJoin2 } = props; const styles = useStyles(); const callback = useCallback(() => { trackLeavePromptLeaveClicked(guild.id); }, [guild.id]); return } actions={<> } />; }; c7863_13 = new Set(); const width = ImageSizes[GuildIconSizes.XLARGE]; useStyles = createStyles({ headerRoot: { alignItems: "center" }, iconWrapper: { width, height: width, position: "relative" }, badgeOverlay: { position: "absolute", right: -4, bottom: -4, marginRight: 0 } }); export function openLurkerLeavePrompt(a0, a1) { let c18939_2; const onLeave = a1.onLeave; c18939_2 = void 0; if (!c7863_13.has(a0)) { const guild2 = GuildStore.getGuild(a0); if (guild2 != null) { c7863_13.add(a0); c18939_2 = false; openAlert(`lurker-leave-prompt:${a0}`, { c18939_2 = true; const lurkingSourceForGuild = LurkingStore.getLurkingSourceForGuild(a0); if (lurkingSourceForGuild?.type === JoinGuildSources.DIRECTORY_ENTRY) { const channel = ChannelStore.getChannel(lurkingSourceForGuild.directoryChannelId); if (channel != null) { setHubProgressActionComplete(channel.getGuildId(), HubProgressStep.JOIN_GUILD); } } trackJoinClicked(a0, JoinGuildSources.LEAVE_PROMPT_LURKER, LurkerPreviewManager.hasNavigatedAway(a0)); GuildActionCreators.joinGuild(a0, { source: JoinGuildSources.LEAVE_PROMPT_LURKER }); }} />, () => { c7863_13.delete(a0); if (!c18939_2) { onLeave(); } }); } else { onLeave(); } } }