// Metro module 10462 (f10463). import { useEffect, useCallback } from "react"; import { View, StyleSheet } from "react-native"; import GatewayConnectionStore from "../../gateway/GatewayConnectionStore"; import ReadStateStore from "../../../stores/ReadStateStore"; import { ChatOverlays } from "../ChatOverlayConstants"; import { AnalyticEvents, AnalyticsObjectTypes, AnalyticsObjects, AnalyticsSections } from "../../../Constants"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import useShowChannelOptInNotice from "../../opt_in_channels/useShowChannelOptInNotice"; import useAllowedChatOverlays from "../useAllowedChatOverlays"; import { useStateFromStores, useStateFromStoresObject } from "../../../_bundle/Module589"; import SnowflakeUtils from "../../../utils/SnowflakeUtils"; import MobileVisualRefreshExperiment from "../../themes/experiments/MobileVisualRefreshExperiment"; import AnalyticsUtils from "../../../utils/AnalyticsUtils"; import { collectGuildAnalyticsMetadata, collectChannelAnalyticsMetadata } from "../../app_analytics/AppAnalyticsUtils"; import { setOptInChannel } from "../../opt_in_channels/OptInChannelsActionCreators"; import { Text } from "../../../design/components/Text/native/Text"; import { intl, t } from "../../../intl/index.native"; import { Button } from "../../../design/components/Button/native/Button.native"; import { useCanUnarchiveThread, useIsThreadModerator } from "../../threads/ThreadHooks"; import ThreadActionCreators from "../../threads/ThreadActionCreators"; import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables"; import { ack } from "../../../actions/ReadStateActionCreators"; import { XSmallBoldIcon } from "../../../design/components/Icon/native/redesign/generated/XSmallBoldIcon"; let useStyles, ArchivedLockedThreadChatBanner, LockedThreadChatBanner, NewMessagesChatBar; const OptInChannelBanner = function OptInChannelBanner(props) { const { channel, ctaProps, topBorder } = props; const styles = useStyles(); const r12 = MobileVisualRefreshExperiment("OptInChannelBanner"); useEffect(() => { AnalyticsUtils.track(AnalyticEvents.CHANNEL_BANNER_VIEWED, { ...collectGuildAnalyticsMetadata(channel.getGuildId()), ...collectChannelAnalyticsMetadata(channel), banner_type: "channel_opt_in" }); }, [channel]); const callback = useCallback(() => { AnalyticsUtils.track(AnalyticEvents.CHANNEL_BANNER_CTA_CLICKED, { ...collectGuildAnalyticsMetadata(channel.getGuildId()), ...collectChannelAnalyticsMetadata(channel), banner_type: "channel_opt_in", cta_type: "add channel" }); setOptInChannel(channel.guild_id, channel.id, true, { section: AnalyticsSections.CHANNEL }); }, [channel]); return {intl.string(t.iOWmmB)}