// Metro module 15175 (f15176). import { useCallback } from "react"; import { View } from "react-native"; import NewChannelsStore from "../../recent_channels/NewChannelsStore"; import ReadStateStore from "../../../stores/ReadStateStore"; import { CHANNEL_MARGIN_VERTICAL } from "../../channel_list_v2/native/RedesignChannelListConstants"; import { CHANNELS_AND_ROLES_MODAL_KEY } from "../../guild_onboarding/native/GuildOnboardingConstants"; import { ReadStateTypes } from "../../read_states/ReadStateConstants"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import useGuildOnboardingAvailable from "../../guild_onboarding/useGuildOnboardingAvailable"; import { useIsDismissibleContentDismissed_UNSAFE } from "../../dismissible_content/DismissibleContentUnsafeUtils"; import { DismissibleContent } from "../../../_bundle/Module1358"; import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual"; import { MAX_NEW_CHANNELS_TO_SHOW } from "../ChannelListState"; import ModalActionCreators from "../../../actions/ModalActionCreators"; import BaseChannelItem, { ChannelModes, BaseChannelName, BaseChannelIcon } from "./BaseChannelItem"; import { NewBadge } from "../../channel_list_v2/native/components/index"; import { intl, t } from "../../../intl/index.native"; import { ChannelListMagnifyingGlassIcon } from "../../../design/components/Icon/native/redesign/generated/ChannelListMagnifyingGlassIcon"; const useStyles = createStyles({ container: { marginVertical: CHANNEL_MARGIN_VERTICAL, marginHorizontal: 8, borderRadius: Module712.radii.md }, channelInfoContainer: { paddingStart: 4 } }); export function GuildRolesAndChannelsRow(props) { const { guild, selected } = props; const styles = useStyles(); const guildOnboardingAvailable = useGuildOnboardingAvailable(guild); const id = guild.id; const isDismissibleContentDismissed_UNSAFE = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.CHANNEL_BROWSER_NEW_BADGE_NUX); const stateFromStores = useStateFromStores([ReadStateStore], () => ReadStateStore.hasUnread(guild.id, ReadStateTypes.GUILD_ONBOARDING_QUESTION)); const stateFromStores2 = useStateFromStores([NewChannelsStore], () => NewChannelsStore.getNewChannelIds(guild.id).size > MAX_NEW_CHANNELS_TO_SHOW); const callback = useCallback(() => { ModalActionCreators.pushLazy(import("../../guild_onboarding/native/ChannelsAndRolesModal"), { guildId: id }, CHANNELS_AND_ROLES_MODAL_KEY); }, [id]); let DEFAULT = ChannelModes.DEFAULT; if (selected) { DEFAULT = ChannelModes.SELECTED; } const channelInfo = (isDismissibleContentDismissed_UNSAFE ? stateFromStores : !isDismissibleContentDismissed_UNSAFE) || stateFromStores2 ? : null; return } icon={} channelInfo={channelInfo} />; }