This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,22 @@
// Metro module 10918 (f10919).
import { AnalyticEvents } from "../../../Constants";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
export function openAddMembersActionSheet(a0, canSkip = false) {
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
type: "Grant Channel Access"
});
ActionSheetActionCreators.openLazy(import("./action_sheets/AddMembersActionSheet"), `channel-add-members-${a0.id}`, {
channel: a0,
canSkip
});
}
export function openChannelMembersActionSheet(a0, a1) {
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
type: "Manage Channel Access"
});
ActionSheetActionCreators.openLazy(import("./action_sheets/ChannelMembersActionSheet"), `channel-members-${a0}`, {
channelId: a0,
guildId: a1
});
}
@@ -0,0 +1,509 @@
// Metro module 8284 (f8285).
import _objectWithoutProperties from "../../../../_bundle/_objectWithoutProperties";
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useState, useEffect } from "react";
import { ScrollView, View } from "react-native";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import GuildRoleStore from "../../../../stores/GuildRoleStore";
import GuildStore from "../../../../stores/GuildStore";
import UserStore from "../../../../stores/UserStore";
import { MEMBER_REQUEST_COUNT, RowType } from "../../ChannelPermissionsConstants";
import { Permissions } from "../../../../_bundle/Module505";
import { jsx } from "react/jsx-runtime";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { NONE, canEveryoneRole } from "../../../../utils/PermissionUtils";
import useSafeAreaInsetsKeyboardAware_native from "../../../safe_area/useSafeAreaInsetsKeyboardAware.native";
import RegexUtils from "../../../../utils/RegexUtils";
import { useStateFromStores, useStateFromStoresArray } from "../../../../_bundle/Module589";
import { getRolesRows, getNoRolesRow, getMembersRows } from "../../ChannelPermissionsUtils";
import { AccessibilityAnnouncer } from "../../../../_bundle/Module3902";
import { intl, t } from "../../../../intl/index.native";
import { HelpMessage, HelpMessageTypes, EmptyState, Avatar } from "../../../../design/void/native";
import { Text } from "../../../../design/components/Text/native/Text";
import { ChannelOverwritesCheckboxItem } from "../components/ChannelOverwritesItem";
import { BottomSheetScrollView } from "../../../../_bundle/Module5245";
import { BottomSheetFlashList, FlashList } from "../../../../_bundle/noop_6676";
import TagListInput_native from "../../../../design/components/TagListInput/native/TagListInput.native";
import GuildUtils from "../../../../utils/GuildUtils";
import { NoResultsAlt } from "../../../../design/components/Illustration/native/redesign/generated/NoResultsAlt";
import useChannelName from "../../../channel/useChannelName";
import { permissionOverwriteForRole, permissionOverwriteForUser } from "../../../../utils/ChannelUtils";
import { savePermissionUpdates } from "../../../../actions/ChannelSettingsPermissionsActionCreators";
import { memberOrRoleAddedToast } from "../../../toast/native/ToastUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { HermesBuiltin } from "../../../../_hermes/prelude";
let AddMembersBody, useStyles;
let env5279 = {};
const _toPropertyKey = function _toPropertyKey(a0) {
let r2 = a0;
if (typeof a0 === "object") {
r2 = a0;
if (a0) {
const r5 = a0[Symbol.toPrimitive];
if (r5 !== void 0) {
r2 = r5.call(a0, "string");
if (typeof r2 === "object") {
throw new TypeError("@@toPrimitive must return a primitive value.");
}
} else {
r2 = String(a0);
}
}
}
let r19 = r2;
if (typeof r19 !== "symbol") {
r19 = "" + r2;
}
return r19;
};
AddMembersBody = function AddMembersBody(props) {
let data;
let c16460_3, state, setState, state2, setState2, count, c16460_9, c16460_10, c16460_11, c16460_12;
const { channel, guild, pendingAdditions, setPendingAdditions, permission = NONE, inActionSheet, ...rest } = props;
c16460_3 = void 0;
state = void 0;
setState = void 0;
state2 = void 0;
setState2 = void 0;
count = void 0;
c16460_9 = void 0;
c16460_10 = void 0;
c16460_11 = void 0;
c16460_12 = void 0;
const filterByQuery = function filterByQuery(a0) {
const r11 = state2.trim();
return new RegExp(`${RegexUtils.escape(state ? r11.slice(1) : r11)}`, "i").test(a0);
};
const styles = useStyles();
c16460_3 = styles;
[state, setState] = useState(false);
[state2, setState2] = useState("");
const insets = useSafeAreaInsetsKeyboardAware_native({
isKeyboardAwareOnAndroid: !inActionSheet
}).insets;
let r27 = canEveryoneRole(Permissions.ADMINISTRATOR, guild);
const stateFromStores = useStateFromStores([GuildRoleStore], () => GuildRoleStore.getSortedRoles(guild.id));
const stateFromStoresArray = useStateFromStoresArray([GuildMemberStore], () => GuildMemberStore.getMemberIds(guild.id));
if (state) {
data = [];
} else {
const rolesRows = getRolesRows(guild, stateFromStores, channel, permission, filterByQuery);
data = rolesRows.length === 0 && state2.trim() === "" && stateFromStores.length === 1 ? getNoRolesRow() : rolesRows;
}
const membersRows = getMembersRows(stateFromStoresArray, channel, guild, permission, filterByQuery);
count = data.length + membersRows.length;
useEffect(() => {
if (state2 !== "") {
AccessibilityAnnouncer.announce(intl.formatToPlainString(t.ZGVL3g, {
count
}), "polite");
}
}, [count, state2]);
const r113 = data.length > 0 ? [intl.string(t["LPJmL/"])] : [];
const data2 = [];
const r0 = HermesBuiltin.arraySpread(data2, data, HermesBuiltin.arraySpread(data2, r113, 0));
HermesBuiltin.arraySpread(data2, membersRows, HermesBuiltin.arraySpread(data2, membersRows.length > 0 ? [intl.string(t["9Oq93m"])] : [], r0));
const r152 = data.length > 0 ? 1 : 0;
c16460_9 = r152;
const r4 = r152 + data.length - 1;
c16460_10 = r4;
const r2 = membersRows.length > 0 ? r4 + 2 : r4;
const r157 = [];
c16460_11 = r2;
c16460_12 = r2 + membersRows.length - 1;
r157.push({
title: intl.string(t["LPJmL/"]),
data
});
r157.push({
title: intl.string(t["9Oq93m"]),
data: membersRows
});
const tags = Object.values(pendingAdditions).map((item) => ({
...item.display,
id: item.row.id
}));
const Component = inActionSheet ? BottomSheetScrollView : ScrollView;
const Component2 = inActionSheet ? BottomSheetFlashList : FlashList;
const r227 = [<View style={styles.inputContainer}>
<TagListInput_native accessibilityLabel={intl.string(t["5h0QOP"])} placeholder={intl.string(t.TVZdKh)} tags={tags} onChangeText={function onChangeText(text) {
const r11 = text.trim();
const r2 = r11.charAt(0) === "@";
GuildUtils.requestMembers(guild.id, r2 ? r11.slice(1) : r11, MEMBER_REQUEST_COUNT);
setState2(text);
setState(r2);
}} onRemove={function onRemove(event) {
let c26172_0 = Object.keys(pendingAdditions)[event];
setPendingAdditions((prevPendingAdditions) => {
prevPendingAdditions[c26172_0];
return _objectWithoutProperties(prevPendingAdditions, [c26172_0].map(_toPropertyKey));
});
}} />
</View>, , ,];
if (r27) {
r27 = <View style={styles.adminWarning}>
<HelpMessage messageType={HelpMessageTypes.WARNING}>
{intl.string(t["5f3HIC"])}
</HelpMessage>
</View>;
}
r227[1] = r27;
r227[2] = state2 !== "" && (data.length === 0 && membersRows.length === 0) ? <Component {...rest}>
<EmptyState Illustration={NoResultsAlt} style={styles.emptyState} bodyStyle={styles.emptyStateText} body={intl.format(t.ErpIY3, {
query: state2
})} />
</Component> : <Component2 {...rest} extraData={pendingAdditions} data={data2} contentContainerStyle={{
paddingHorizontal: Module712.space.PX_16,
paddingBottom: Module712.space.PX_16 + insets.bottom
}} renderItem={function renderRow({ item, index }) {
return typeof item === "string" ? <Text style={[c16460_3.sectionRowWrapper, index === 0 ? {
paddingTop: 0
} : {}]} maxFontSizeMultiplier={2} accessibilityRole="header" variant="text-sm/semibold" color="interactive-text-default">{item}</Text> : <ChannelOverwritesCheckboxItem start={c16460_9 === index || c16460_11 === index} end={c16460_10 === index || c16460_12 === index} item={item} guildId={guild.id} onPress={() => {
const item2 = item;
if (item.rowType !== RowType.EMPTY_STATE) {
setPendingAdditions((prevPendingAdditions) => {
let display;
const r2 = {
...prevPendingAdditions
};
const r20 = `${item2.rowType}:${item2.id}`;
if (r20 in r2) {
delete r2[r20];
} else {
L8: {
const rowType = item2.rowType;
if (RowType.ROLE !== rowType && RowType.ADMINISTRATOR !== rowType) {
if (RowType.MEMBER !== rowType) {
const OWNER = RowType.OWNER;
display = void 0;
if (OWNER !== rowType) {
break L8;
}
}
const user = UserStore.getUser(item2.id);
const r1 = user != null;
display = void 0;
if (!r1) {
break L8;
}
display = {
text: item2.name,
icon: (0, jsx)(Avatar, {
user,
guildId: guild.id,
avatarStyle: c16460_3.tagAvatar,
style: c16460_3.tagAvatar
})
};
} else {
display = {
text: item2.name,
icon: (0, jsx)(View, {
style: [c16460_3.tagRoleColor, {
backgroundColor: item2.colorString
}]
})
};
}
}
if (display != null) {
r2[r20] = {
display,
row: item2
};
}
}
return r2;
});
}
}} checked={`${item.rowType}:${item.id}` in pendingAdditions} />;
}} keyboardShouldPersistTaps="handled" />;
return <>{r227}</>;
};
useStyles = createStyles({
container: {
flex: 1
},
inputContainer: {
alignItems: "stretch",
paddingHorizontal: Module712.space.PX_16,
paddingVertical: Module712.space.PX_12
},
tagRoleColor: {
height: 12,
width: 12,
borderRadius: 6
},
tagAvatar: {
width: 16,
height: 16,
borderRadius: Module712.radii.sm
},
emptyState: {
paddingTop: Module712.space.PX_16
},
emptyStateText: {
color: Module712.colors.TEXT_DEFAULT
},
sectionRowWrapper: {
paddingVertical: Module712.space.PX_12
},
adminWarning: {
marginHorizontal: 16,
marginVertical: 8
}
});
export default function AddMembersActionSheet(props) {
let env16461 = {
$parent: env5279
};
const channel = props.channel;
env16461[0] = channel;
const canSkip = props.canSkip;
env16461[1] = void 0;
env16461[2] = function _handleAddPressed() {
const r9 = async () => {
let c29938_0, c29938_1, c29938_2;
let c29938_4 = 0;
let c29938_3 = 0;
let r27 = void 0;
let r4 = 0;
let r12 = env16461;
L37: {
L30: {
L31: {
L38: {
L13: {
L14: {
try {
const r29 = c29938_4;
if (r29 !== 0) {
if (r29 === 1) {
c29938_3 = 0;
break L13;
}
if (r4 === 1) {
throw r27;
}
if (r4 === 2) {
c29938_3 = 0;
break L14;
}
memberOrRoleAddedToast(env31463[2], env31463[1]);
ActionSheetActionCreators.hideActionSheet();
c29938_3 = 0;
break L13;
}
if (r4 === 1) {
throw r27;
}
if (r4 === 2) {
break L38;
}
let env31463;
c29938_1 = r12;
const r51 = env31463 = {
$parent: r12
};
c29938_0 = r51;
const r52 = [];
env31463[0] = r52;
env31463[1] = 0;
Object.values(env16461[1]).forEach(({ row }) => {
if (row.id != null && row.id !== "") {
if (row.rowType === RowType.ROLE) {
env31463[2] = env31463[2] + 1;
env31463[0].push(permissionOverwriteForRole(row.id, env16461[0].type));
} else if (row.rowType === RowType.MEMBER) {
env31463[1] = env31463[1] + 1;
env31463[0].push(permissionOverwriteForUser(row.id, env16461[0].type));
}
}
});
c29938_3 = 1;
const r67 = savePermissionUpdates(env16461[0].id, r52);
c29938_4 = 2;
r27 = await r67;
r4 = 0;
r12 = env16461;
while (true) {
const r80 = c29938_4;
if (r80 !== 0) {
if (r80 === 1) {
c29938_3 = 0;
break L30;
}
if (r4 === 1) {
throw r27;
}
if (r4 === 2) {
c29938_3 = 0;
break L31;
}
memberOrRoleAddedToast(env31463[2], env31463[1]);
ActionSheetActionCreators.hideActionSheet();
c29938_3 = 0;
break L30;
}
if (r4 === 1) {
throw r27;
}
if (r4 === 2) {
break L37;
}
let env31463;
c29938_1 = r12;
const r104 = env31463 = {
$parent: r12
};
c29938_0 = r104;
const r105 = [];
env31463[0] = r105;
env31463[1] = 0;
Object.values(env16461[1]).forEach(({ row }) => {
if (row.id != null && row.id !== "") {
if (row.rowType === RowType.ROLE) {
env31463[2] = env31463[2] + 1;
env31463[0].push(permissionOverwriteForRole(row.id, env16461[0].type));
} else if (row.rowType === RowType.MEMBER) {
env31463[1] = env31463[1] + 1;
env31463[0].push(permissionOverwriteForUser(row.id, env16461[0].type));
}
}
});
c29938_3 = 1;
const r120 = savePermissionUpdates(env16461[0].id, r105);
c29938_4 = 2;
r27 = await r120;
r4 = 0;
r12 = env16461;
}
} catch ($e) {
const r30 = $e;
let r7 = r30;
c29938_2 = r30;
if (c29938_3 !== 0) {
while (true) {
c29938_4 = 1;
try {
let r134 = c29938_4;
while (r134 === 0) {
if (r4 === 1) {
throw r27;
}
if (r4 === 2) {
break L37;
}
let env31463;
c29938_1 = r12;
const r160 = env31463 = {
$parent: r12
};
c29938_0 = r160;
const r161 = [];
env31463[0] = r161;
env31463[1] = 0;
Object.values(env16461[1]).forEach(({ row }) => {
if (row.id != null && row.id !== "") {
if (row.rowType === RowType.ROLE) {
env31463[2] = env31463[2] + 1;
env31463[0].push(permissionOverwriteForRole(row.id, env16461[0].type));
} else if (row.rowType === RowType.MEMBER) {
env31463[1] = env31463[1] + 1;
env31463[0].push(permissionOverwriteForUser(row.id, env16461[0].type));
}
}
});
c29938_3 = 1;
const r176 = savePermissionUpdates(env16461[0].id, r161);
c29938_4 = 2;
r27 = await r176;
r4 = 0;
r12 = env16461;
r134 = c29938_4;
}
if (r134 === 1) {
c29938_3 = 0;
break L30;
}
if (r4 === 1) {
throw r27;
}
if (r4 === 2) {
c29938_3 = 0;
break L31;
}
memberOrRoleAddedToast(env31463[2], env31463[1]);
ActionSheetActionCreators.hideActionSheet();
c29938_3 = 0;
break L30;
} catch (r135) {
r7 = r135;
c29938_2 = r135;
if (c29938_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
return r27;
}
return void 0;
}
return r27;
}
return r27;
}
return void 0;
}
return r27;
};
env16461[2] = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
const r27 = _slicedToArray(useState({}), 2);
const pendingAdditions2 = r27[0];
env16461[1] = pendingAdditions2;
const setPendingAdditions2 = r27[1];
const stateFromStores = useStateFromStores([GuildStore], () => {
const r5 = env16461[0];
return GuildStore.getGuild(r5 == null ? void 0 : r5.getGuildId());
});
let subtitle = useChannelName(channel, true);
if (subtitle == null) {
subtitle = "";
}
if (stateFromStores == null) {
return null;
}
const disabled = Object.keys(pendingAdditions2).length === 0;
return <BottomSheet scrollable header={<BottomSheetTitleHeader title={intl.string(t.dMJ3Y6)} subtitle={subtitle} trailing={<Button {...canSkip && disabled ? {
size: "sm",
text: intl.string(t["5Wxrcd"]),
onPress: () => {
ActionSheetActionCreators.hideActionSheet();
},
variant: "secondary"
} : {
size: "sm",
text: intl.string(t.OYkgVk),
onPress: function handleAddPressed() {
return env16461[2].apply(this, arguments);
},
variant: disabled ? "secondary" : "primary",
disabled
}} />} />} startExpanded>
<View style={styles.container}>
<AddMembersBody channel={channel} guild={stateFromStores} permission={channel.accessPermissions} pendingAdditions={pendingAdditions2} setPendingAdditions={setPendingAdditions2} inActionSheet />
</View>
</BottomSheet>;
};
export { AddMembersBody };
@@ -0,0 +1,106 @@
// Metro module 10919 (f10920).
import { View } from "react-native";
import ChannelStore from "../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import GuildRoleStore from "../../../../stores/GuildRoleStore";
import GuildStore from "../../../../stores/GuildStore";
import PermissionStore from "../../../../stores/PermissionStore";
import { ChannelSettingsSections, Permissions } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useStateFromStores, useStateFromStoresObject, useStateFromStoresArray } from "../../../../_bundle/Module589";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import useChannelName from "../../../channel/useChannelName";
import { getExistingRolesRows, getExistingMembersRows } from "../../ChannelPermissionsUtils";
import { intl, t } from "../../../../intl/index.native";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import ChannelSettingsActionCreators from "../../../../actions/ChannelSettingsActionCreators";
import { navigateToChannelDetailsScreen } from "../../../main_tabs_v2/native/sidebar/details/ChannelDetailsUtils";
import { SettingsIcon } from "../../../../design/components/Icon/native/redesign/generated/SettingsIcon";
import { RowButton } from "../../../../design/components/TableRow/native/RowButton.native";
import { openAddMembersActionSheet } from "../ChannelPermissionsUtils";
import { GroupPlusIcon } from "../../../../design/components/Icon/native/redesign/generated/GroupPlusIcon";
import { HelpMessage, HelpMessageTypes } from "../../../../design/void/native";
import { BottomSheetSectionList } from "../../../../_bundle/Module5245";
import ChannelOverwritesItem from "../components/ChannelOverwritesItem";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles({
container: {
paddingHorizontal: 16,
flex: 1
},
sectionRowWrapper: {
paddingVertical: Module712.space.PX_12
},
warning: {
margin: 16,
marginBottom: 0
}
});
export default function ChannelMembersActionSheet(props) {
let navigation, showRemove;
const { channelId, guildId } = props;
navigation = void 0;
showRemove = void 0;
const styles = useStyles();
const safeAreaInsets_native = useSafeAreaInsets_native();
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
const stateFromStoresObject = useStateFromStoresObject([GuildStore, GuildRoleStore], () => {
const guild = GuildStore.getGuild(stateFromStores == null ? void 0 : stateFromStores.getGuildId());
return {
guild,
sortedGuildRoles: guild != null ? GuildRoleStore.getSortedRoles(guild.id) : void 0
};
}, [stateFromStores]);
const { guild, sortedGuildRoles } = stateFromStoresObject;
const stateFromStoresArray = useStateFromStoresArray([GuildMemberStore], () => GuildMemberStore.getMemberIds(stateFromStores == null ? void 0 : stateFromStores.getGuildId()), [stateFromStores]);
navigation = useNavigation();
const channelName = useChannelName(stateFromStores);
if (stateFromStores != null && guild != null && sortedGuildRoles != null) {
showRemove = PermissionStore.can(Permissions.MANAGE_ROLES, stateFromStores);
const existingRolesRows = getExistingRolesRows(guild, sortedGuildRoles, stateFromStores, stateFromStores.accessPermissions);
const existingMembersRows = getExistingMembersRows(stateFromStoresArray, stateFromStores, guild, stateFromStores.accessPermissions);
const sections = [];
sections.push({
title: intl.string(t["LPJmL/"]),
data: existingRolesRows
});
sections.push({
title: intl.string(t["9Oq93m"]),
data: existingMembersRows
});
return <BottomSheet scrollable header={<BottomSheetTitleHeader title={intl.string(t.ES4CC6)} subtitle={`#${channelName}`} trailing={showRemove ? <PressableOpacity onPress={function onPress() {
ActionSheetActionCreators.hideActionSheet();
ChannelSettingsActionCreators.init(channelId);
navigateToChannelDetailsScreen(navigation, ChannelSettingsSections.PERMISSIONS, channelId, "channel-members-action-sheet");
}} accessibilityRole="button" accessibilityLabel={intl.string(t.XPDhcc)}>
<SettingsIcon />
</PressableOpacity> : showRemove} />} startExpanded>
<View style={styles.container}>
{showRemove ? <RowButton label={intl.string(t.dMJ3Y6)} onPress={() => openAddMembersActionSheet(stateFromStores)} icon={<GroupPlusIcon />} /> : <View style={styles.warning}>
<HelpMessage messageType={HelpMessageTypes.INFO}>
{intl.string(t.VOuiSj)}
</HelpMessage>
</View>}
<BottomSheetSectionList contentContainerStyle={{
paddingBottom: safeAreaInsets_native.bottom + Module712.space.PX_16
}} renderItem={function renderItem(info) {
const { item, index } = info;
return <ChannelOverwritesItem start={index === 0} end={index === info.section.data.length - 1} guildId={guildId} item={item} channelId={channelId} showType showRemove={showRemove} />;
}} renderSectionHeader={function renderSectionHeader({ section }) {
return <Text style={styles.sectionRowWrapper} maxFontSizeMultiplier={2} accessibilityRole="header" variant="text-sm/semibold" color="interactive-text-default">
{intl.format(t.u8CWLl, {
numberOfItems: section.data.length,
sectionTitle: section.title
})}
</Text>;
}} sections={sections} stickySectionHeadersEnabled={false} />
</View>
</BottomSheet>;
}
return null;
};
@@ -0,0 +1,129 @@
// Metro module 11563 (f11564).
import { View } from "react-native";
import { isGuildOwner } from "../../../../records/GuildRecord";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import GuildRoleStore from "../../../../stores/GuildRoleStore";
import { Fragment, jsx } from "react/jsx-runtime";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { intl, t } from "../../../../intl/index.native";
import { useStateFromStoresArray } from "../../../../_bundle/Module589";
import { getExistingRoles, getExistingMembers } from "../../ChannelPermissionsUtils";
import { assertNever } from "../../../../utils/GlobalUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { openChannelMembersActionSheet } from "../ChannelPermissionsUtils";
import { Avatar, AvatarSizes, Icon } from "../../../../design/void/native";
import Module11562 from "../../../../_bundle/Module11562";
import { GroupIcon } from "../../../../design/components/Icon/native/redesign/generated/GroupIcon";
import Module8288 from "../../../../_bundle/Module8288";
import { ShieldUserIcon } from "../../../../design/components/Icon/native/redesign/generated/ShieldUserIcon";
import Module10737 from "../../../../_bundle/Module10737";
const count = 100;
const useStyles = createStyles({
section: {
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.sm,
color: Module712.colors.TEXT_DEFAULT,
flexDirection: "row",
marginBottom: 8,
marginTop: 8,
padding: 16
},
sectionContent: {
alignItems: "center",
flexDirection: "row",
flexGrow: 1
},
avatar: {
marginRight: 8
},
labelDetail: {
marginRight: 12
},
sectionIcon: {
marginRight: 6
}
});
let c7887_13 = {
MEMBERS: 0,
0: "MEMBERS",
ROLES: 1,
1: "ROLES"
};
export default function ChannelAccessInfo(props) {
let props3;
const { guild, channel } = props;
const styles = useStyles();
const accessibilityLabel = intl.string(t.li1wKf);
const stateFromStoresArray = useStateFromStoresArray([GuildRoleStore], () => getExistingRoles(guild, GuildRoleStore.getSortedRoles(guild.id), channel, channel.accessPermissions), [guild, channel]);
const existingMembers = getExistingMembers(GuildMemberStore.getMemberIds(guild?.id), channel, guild, channel.accessPermissions);
const user = stateFromStoresArray.length === 0 && existingMembers.length === 1 && isGuildOwner(guild, existingMembers[0]) ? existingMembers[0] : null;
const r64 = [<Text variant="eyebrow">{accessibilityLabel}</Text>, ,];
const props2 = {
accessibilityLabel,
accessibilityRole: "button",
onPress: function onPress() {
openChannelMembersActionSheet(channel.id, channel.guild_id);
},
style: styles.section,
children: null
};
if (user != null) {
props3 = {
children: [<Avatar style={styles.avatar} user={user} guildId={guild.id} size={AvatarSizes.XSMALL} />, <View>
<Text variant="text-sm/semibold">{user.tag}</Text>
<Text variant="text-xs/medium">
{intl.string(t.rt0ERW)}
</Text>
</View>]
};
} else {
const renderCounts = function renderCounts(a0, a1, a2, a3) {
let r10;
if (a1 === 0) {
return null;
}
if (c7887_13.MEMBERS === a0) {
r10 = a1 > count ? intl.formatToPlainString(t.PR5l07, {
count
}) : intl.formatToPlainString(t.bu5sya, {
count: a1
});
} else if (c7887_13.ROLES === a0) {
r10 = a1 > count ? intl.formatToPlainString(t["+OYnFQ"], {
count
}) : intl.formatToPlainString(t.T2BEtm, {
count: a1
});
} else {
assertNever(a0);
r10 = void 0;
}
return <>
{jsx(a3, {
size: "sm",
style: styles.sectionIcon
})}
<Text style={styles.labelDetail} variant="text-sm/medium">{r10}</Text>
</>;
};
const MEMBERS = c7887_13.MEMBERS;
const length = existingMembers.length;
Module11562;
const children = [renderCounts(MEMBERS, length, 0, GroupIcon), ,];
const ROLES = c7887_13.ROLES;
const length2 = stateFromStoresArray.length;
Module8288;
children[1] = renderCounts(ROLES, length2, 0, ShieldUserIcon);
props3 = {
children
};
}
props2.children = [<View style={styles.sectionContent}>
<Fragment {...props3} />
</View>, <Icon source={Module10737} size={Icon.Sizes.SMALL} />];
r64[1] = <PressableOpacity {...props2} />;
return <>{r64}</>;
};
@@ -0,0 +1,168 @@
// Metro module 8285 (f8286).
import { View } from "react-native";
import UserStore from "../../../../stores/UserStore";
import { RowType } from "../../ChannelPermissionsConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { showConfirmModal } from "../../../../design/components/AlertModal/native/AlertModal.native";
import { intl, t } from "../../../../intl/index.native";
import ChannelActionCreators from "../../../../actions/ChannelActionCreators";
import { memberOrRoleRemovedToast } from "../../../toast/native/ToastUtils";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { CircleXIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleXIcon";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import { ShieldUserIcon } from "../../../../design/components/Icon/native/redesign/generated/ShieldUserIcon";
import { getRowTypeLabel } from "../../ChannelPermissionsUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { Icon, Avatar, AvatarSizes, IconSizes } from "../../../../design/void/native";
import Module8287 from "../../../../_bundle/Module8287";
import Module8288 from "../../../../_bundle/Module8288";
import { useCheckboxA11yNative } from "../../../../_bundle/Module3907";
import { FormCheckbox } from "../../../../design/components/Forms/native/FormCheckbox.native";
let useStyles, RoleItem, MemberItem, EmptyRoleItem, ChannelOverwritesItem;
const RemoveIcon = function RemoveIcon(props) {
const { item, channelId, onRemove } = props;
const styles = useStyles();
return channelId != null ? <PressableOpacity disabled={item.disabled} accessibilityRole="button" accessibilityLabel={intl.string(t.N86XcP)} onPress={() => {
if (onRemove != null) {
return onRemove(item);
}
const { id: id2, name: name2 } = item;
const id = id2;
const name = name2;
const channelId2 = channelId;
showConfirmModal({
key: `remove-channel-overwrite-${id}`,
title: intl.string(t.GuPYQB),
content: intl.format(t.xERCnZ, {
name
}),
confirmText: intl.string(t.fKxYb0),
onConfirm: () => {
ChannelActionCreators.clearPermissionOverwrite(channelId2, id).then(() => {
memberOrRoleRemovedToast(name);
});
}
});
}}>
<CircleXIcon style={item.disabled ? styles.rowRemoveIconDisabled : void 0} />
</PressableOpacity> : null;
};
RoleItem = function RoleItem(props) {
const { disabled, item: item2 } = props;
let subLabel = props.subLabel;
const { channelId: channelId3, showType, showRemove, start, end } = props;
let trailing = props.trailing;
const { onPress: onPress2, accessibilityRole, accessibilityState, accessible } = props;
const props2 = {
icon: <ShieldUserIcon size="lg" color={item2.colorString} />,
label: item2.name,
subLabel: null,
start: null,
end: null,
trailing: null,
onPress: null,
disabled: null,
accessibilityRole: null,
accessibilityState: null,
accessible: null
};
if (showType) {
subLabel = getRowTypeLabel(item2.rowType);
}
props2.subLabel = subLabel;
props2.start = start;
props2.end = end;
if (showRemove) {
trailing = <RemoveIcon item={item2} channelId={channelId3} />;
}
props2.trailing = trailing;
props2.onPress = onPress2;
props2.disabled = disabled;
props2.accessibilityRole = accessibilityRole;
props2.accessibilityState = accessibilityState;
props2.accessible = accessible;
return <TableRow {...props2} />;
};
MemberItem = function MemberItem(props) {
const { item: item2, channelId: channelId3, showRemove, onRemove: onRemove2, guildId, start, end } = props;
let trailing = props.trailing;
const { onPress: onPress2, disabled, accessibilityRole, accessibilityState, accessible } = props;
const styles = useStyles();
const label = <View style={styles.nameWrapper}>
<Text style={[styles.name, styles.memberName]} lineClamp={1} variant="text-md/semibold" color="interactive-text-active">{item2.name}</Text>
{item2.rowType === RowType.OWNER ? <Icon size={Icon.Sizes.REFRESH_SMALL_16} source={Module8287} disableColor style={styles.ownerIcon} /> : null}
</View>;
const user = UserStore.getUser(item2.id);
const props2 = {
icon: <Avatar source={user == null ? void 0 : user.getAvatarSource(guildId)} size={AvatarSizes.SMALL} />,
label,
subLabel: item2.username,
start,
end,
trailing: null,
onPress: null,
disabled: null,
accessibilityRole: null,
accessibilityState: null,
accessible: null
};
if (showRemove) {
trailing = <RemoveIcon item={item2} channelId={channelId3} onRemove={onRemove2} />;
}
props2.trailing = trailing;
props2.onPress = onPress2;
props2.disabled = disabled;
props2.accessibilityRole = accessibilityRole;
props2.accessibilityState = accessibilityState;
props2.accessible = accessible;
return <TableRow {...props2} />;
};
EmptyRoleItem = function EmptyRoleItem(props) {
const item2 = props.item;
return <TableRow icon={<Icon source={Module8288} color={item2.colorString} size={IconSizes.MEDIUM} style={useStyles().roleIcon} />} label={item2.name} />;
};
ChannelOverwritesItem = function ChannelOverwritesItem(props) {
const { item: item2, ...props2 } = props;
const rowType = item2.rowType;
if (RowType.ADMINISTRATOR !== rowType && RowType.ROLE !== rowType) {
if (RowType.OWNER !== rowType && RowType.MEMBER !== rowType) {
if (RowType.EMPTY_STATE === rowType) {
return <EmptyRoleItem item={item2} {...props2} />;
}
return null;
}
return <MemberItem item={item2} {...props2} />;
}
return <RoleItem item={item2} {...props2} />;
};
useStyles = createStyles({
nameWrapper: {
flexDirection: "row",
alignItems: "flex-end",
marginRight: 16
},
name: {
paddingRight: 4
},
memberName: {
flexShrink: 1
},
ownerIcon: {
alignSelf: "center"
},
roleIcon: {
height: 30,
width: 30
},
rowRemoveIconDisabled: {
opacity: 0.3
}
});
export default ChannelOverwritesItem;
export function ChannelOverwritesCheckboxItem(props) {
const { checked, ...props2 } = props;
const checkboxA11yNative = useCheckboxA11yNative({
checked
});
return <ChannelOverwritesItem {...props2} accessible accessibilityRole={checkboxA11yNative.accessibilityRole} accessibilityState={checkboxA11yNative.accessibilityState} trailing={<FormCheckbox checked={checked} />} />;
}
@@ -0,0 +1,331 @@
// Metro module 15650 (f15651).
import { useLayoutEffect, useMemo, useState, useEffect, useCallback } from "react";
import { View, ScrollView } from "react-native";
import ChannelSettingsPermissionsStore from "../../../../stores/ChannelSettingsPermissionsStore";
import ChannelStore from "../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import GuildRoleStore from "../../../../stores/GuildRoleStore";
import GuildStore from "../../../../stores/GuildStore";
import PermissionStore from "../../../../stores/PermissionStore";
import RelationshipStore from "../../../../stores/RelationshipStore";
import UserStore from "../../../../stores/UserStore";
import { SettingMode } from "../../ChannelPermissionsConstants";
import { Permissions, ChannelTypes, AnalyticEvents, ChannelSettingsSections, SettingsPaneTypes } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { useStateFromStoresObject, useStateFromStores } from "../../../../_bundle/Module589";
import * as _ChannelPermissionsUtils from "../../ChannelPermissionsUtils";
import { flipEveryonePermission, grantUserChannelAccess, getExistingRolesRows, getExistingMembersRows } from "../../ChannelPermissionsUtils";
import { savePermissionUpdates, setAdvancedMode } from "../../../../actions/ChannelSettingsPermissionsActionCreators";
import { checkChattableChannelThresholdMetAfterChannelPermissionDeny } from "../../../guild_onboarding/DefaultChannelThresholdUtils";
import { intl, t } from "../../../../intl/index.native";
import { computeChannelName } from "../../../channel/useChannelName";
import AlertActionCreators from "../../../../actions/AlertActionCreators";
import ChannelOverwritesItem from "./ChannelOverwritesItem";
import * as _PermissionUtils from "../../../../utils/PermissionUtils";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { TableSwitchRow } from "../../../../design/components/TableRow/native/TableSwitchRow.native";
import { HelpMessage, HelpMessageTypes } from "../../../../design/void/native";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import { CirclePlusIcon } from "../../../../design/components/Icon/native/redesign/generated/CirclePlusIcon";
import { openAddMembersActionSheet } from "../ChannelPermissionsUtils";
import { useNavigatorBackPressHandler } from "../../../../design/components/Navigator/native/useNavigatorBackPressHandler.native";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import { useSegmentedControlState } from "../../../../design/components/SegmentedControl/native/SegmentedControlState.native";
import { SegmentedControl } from "../../../../design/components/SegmentedControl/native/SegmentedControl.native";
import ViewModerators from "../../../stage_channels/native/channel_permissions/ViewModerators";
import ChannelSettingsPermissionsOverview from "../../../../components_native/channel_settings/ChannelSettingsPermissionsOverview";
function $mk118501($env) {
return () => {
const r1 = $env;
const r2 = r1[2];
r2(_ChannelPermissionsUtils.isPrivateGuildChannel(r1[0]));
};
}
let onBack, c11171_25, useStyles;
let env11171 = {};
const ChannelPermissionSettingsBasicView = function ChannelPermissionSettingsBasicView(props) {
let env22287 = {
$parent: env11171
};
const channel = props.channel;
env22287[0] = channel;
const privateToggleState = props.privateToggleState;
env22287[1] = privateToggleState;
env22287[2] = props.setPrivateToggleState;
env22287[3] = void 0;
env22287[4] = void 0;
env22287[5] = void 0;
env22287[9] = void 0;
env22287[6] = function togglePrivateChannel() {
return env22287[7].apply(this, arguments);
};
env22287[7] = function _togglePrivateChannel() {
const r9 = async () => {
const isPrivateGuildChannel = _ChannelPermissionsUtils.isPrivateGuildChannel(env22287[0]);
const accessPermissions = env22287[0].accessPermissions;
let c31778_0 = flipEveryonePermission(env22287[0], accessPermissions, isPrivateGuildChannel);
const currentUser = UserStore.getCurrentUser();
const r51 = PermissionStore.can(Permissions.ADMINISTRATOR, env22287[4]);
if (env22287[9] || currentUser == null || r51) {
await savePermissionUpdates(env22287[0].id, [c31778_0]);
} else {
await grantUserChannelAccess(env22287[0], accessPermissions);
await savePermissionUpdates(env22287[0].id, [c31778_0]);
}
};
env22287[7] = r9;
return r9.apply(this, arguments);
};
env22287[8] = function _onPrivateChannelSwitchChange() {
const r9 = async () => {
let c30911_0, c30911_1;
L28: {
L21: {
L14: {
let env31779;
const r9 = env22287;
c30911_1 = r9;
const r29 = env31779 = {
$parent: r9
};
c30911_0 = r29;
env31779[0] = void 0;
env31779[1] = void 0;
env31779[2] = void 0;
if (env22287[0].guild_id != null && !env22287[1]) {
if (await checkChattableChannelThresholdMetAfterChannelPermissionDeny(env22287[0], Permissions.VIEW_CHANNEL)) {
env31779[0] = env22287[1] ? intl.string(t.vw48TT) : intl.string(t["47gQYL"]);
env31779[1] = computeChannelName(env22287[0], UserStore, RelationshipStore);
env31779[2] = env22287[1] ? intl.format(t.hGzPnx, {
channelName: env31779[1]
}) : intl.format(t.rKzX1E, {
channelName: env31779[1]
});
(0, env22287[2])(!env22287[1]);
AlertActionCreators.show({
title: env31779[0],
body: env31779[2],
cancelText: intl.string(t["ETE/oC"]),
confirmText: intl.string(t.p89ACt),
onConfirm: env22287[6],
hideActionSheet: false,
onCancel: $mk118501(env22287)
});
break L21;
}
break L14;
}
env31779[0] = env22287[1] ? intl.string(t.vw48TT) : intl.string(t["47gQYL"]);
env31779[1] = computeChannelName(env22287[0], UserStore, RelationshipStore);
env31779[2] = env22287[1] ? intl.format(t.hGzPnx, {
channelName: env31779[1]
}) : intl.format(t.rKzX1E, {
channelName: env31779[1]
});
(0, env22287[2])(!env22287[1]);
AlertActionCreators.show({
title: env31779[0],
body: env31779[2],
cancelText: intl.string(t["ETE/oC"]),
confirmText: intl.string(t.p89ACt),
onConfirm: env22287[6],
hideActionSheet: false,
onCancel: $mk118501(env22287)
});
break L28;
}
return void 0;
}
return void 0;
}
};
env22287[8] = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
const navigation = useNavigation();
env22287[3] = navigation;
const stateFromStoresObject = useStateFromStoresObject([GuildStore, GuildRoleStore], () => {
const guild = GuildStore.getGuild(env22287[0].getGuildId());
return {
guild,
sortedGuildRoles: guild != null ? GuildRoleStore.getSortedRoles(guild.id) : void 0
};
});
const guild = stateFromStoresObject.guild;
env22287[4] = guild;
const sortedGuildRoles = stateFromStoresObject.sortedGuildRoles;
env22287[5] = sortedGuildRoles;
useLayoutEffect(() => {
env22287[3].setOptions({
headerRight: void 0
});
}, [navigation]);
const memo = useMemo(() => {
let r17;
const r6 = env22287[4];
if (r6 != null) {
const r5 = env22287[5];
if (r5 != null) {
const r16 = env22287[0];
r17 = getExistingRolesRows(r6, r5, r16, r16.accessPermissions);
} else {
r17 = [];
}
} else {
r17 = [];
}
return r17;
}, [guild, sortedGuildRoles, channel]);
if (guild != null && sortedGuildRoles != null) {
const isCategory = channel.isCategory();
const existingMembersRows = getExistingMembersRows(GuildMemberStore.getMemberIds(guild?.id), channel, guild, channel.accessPermissions);
const isPrivateGuildChannel = _ChannelPermissionsUtils.isPrivateGuildChannel(channel);
env22287[9] = isPrivateGuildChannel;
const canEveryoneRole2 = _PermissionUtils.canEveryoneRole(Permissions.VIEW_CHANNEL, guild);
const canEveryoneRole = _PermissionUtils.canEveryoneRole(Permissions.ADMINISTRATOR, guild);
const type = channel.type;
const r84 = intl.string(t.hfbjIH);
return <Stack style={{
paddingHorizontal: Module712.space.PX_16
}} spacing={Module712.space.PX_16}>
<TableRowGroup title={type === ChannelTypes.GUILD_CATEGORY ? intl.string(t.RQUk61) : type === ChannelTypes.GUILD_VOICE ? intl.string(t.cLjvKg) : r84} hasIcons={false}>
<TableSwitchRow label={isCategory ? intl.string(t.lEPAZ5) : intl.string(t.aUI70g)} value={privateToggleState} onValueChange={function onPrivateChannelSwitchChange() {
return env22287[8].apply(this, arguments);
}} />
</TableRowGroup>
{canEveryoneRole && <View style={styles.adminWarning}>
<HelpMessage messageType={HelpMessageTypes.WARNING}>
{intl.string(t["5f3HIC"])}
</HelpMessage>
</View>}
{(canEveryoneRole ? !canEveryoneRole : !canEveryoneRole2) && !isPrivateGuildChannel && <View style={styles.adminWarning}>
<HelpMessage messageType={HelpMessageTypes.WARNING}>
{intl.string(t.ZAk4Q9)}
</HelpMessage>
</View>}
<TableRowGroup hasIcons>
<TableRow arrow icon={<CirclePlusIcon />} label={intl.string(t.dMJ3Y6)} onPress={() => {
const r3 = env22287[0];
if (r3 != null) {
openAddMembersActionSheet(r3);
}
}} />
</TableRowGroup>
<TableRowGroup title={intl.string(t.ES4CC6)} hasIcons>
{memo.map((a0) => {
const r10 = env22287[0];
return <ChannelOverwritesItem key={a0.id} item={a0} channelId={r10.id} showType showRemove guildId={r10.guild_id} />;
})}
</TableRowGroup>
<TableRowGroup hasIcons>
{existingMembersRows.map((existingMembersRow) => {
const r10 = env22287[0];
return <ChannelOverwritesItem key={existingMembersRow.id} item={existingMembersRow} channelId={r10.id} showType showRemove guildId={r10.guild_id} />;
})}
</TableRowGroup>
</Stack>;
}
return null;
};
onBack = function onBack() {
AlertActionCreators.close();
return false;
};
c11171_25 = {
BASIC: 0,
0: "BASIC",
ADVANCED: 1,
1: "ADVANCED",
MODERATORS: 2,
2: "MODERATORS"
};
useStyles = createStyles({
container: {
flex: 1,
paddingTop: 16,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER
},
content: {
marginTop: 16,
flex: 1
},
adminWarning: {
marginTop: Module712.space.PX_12
}
});
export default function EasyChannelPermissionSettings(props) {
let r43, MODERATORS;
let state, setState, setState2;
const { channelId, origin } = props;
state = void 0;
setState = void 0;
setState2 = void 0;
useNavigatorBackPressHandler(onBack);
const styles = useStyles();
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
const stateFromStores2 = useStateFromStores([ChannelSettingsPermissionsStore], () => ChannelSettingsPermissionsStore.advancedMode);
const r10 = stateFromStores == null ? void 0 : stateFromStores.isGuildStageVoice();
if (r10) {
MODERATORS = c11171_25.MODERATORS;
r43 = c11171_25;
} else if (stateFromStores2) {
MODERATORS = c11171_25.ADVANCED;
r43 = c11171_25;
} else {
MODERATORS = c11171_25.BASIC;
r43 = c11171_25;
}
[state, setState] = useState(MODERATORS);
let privateToggleState;
[privateToggleState, setState2] = useState(_ChannelPermissionsUtils.isPrivateGuildChannel(stateFromStores));
useEffect(() => {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.SETTINGS_PANE_VIEWED, {
settings_type: "channel",
origin_pane: origin === ChannelSettingsSections.OVERVIEW ? SettingsPaneTypes.CHANNEL_SETTINGS : null,
destination_pane: ChannelSettingsSections.PERMISSIONS
});
}, [origin]);
const callback = useCallback((a0) => {
if (a0 === c11171_25.ADVANCED) {
setAdvancedMode(true);
} else {
setState2(_ChannelPermissionsUtils.isPrivateGuildChannel(stateFromStores));
setAdvancedMode(false);
}
setState(a0);
}, [stateFromStores]);
const r20 = [intl.string(t["Mw/UDN"]), intl.string(t["0a6awf"])];
if ((stateFromStores == null ? void 0 : stateFromStores.isGuildStageVoice()) === true) {
r20.push(intl.string(t.YIIUJ3));
}
const segmentedControlState = useSegmentedControlState({
pageWidth: 0,
defaultIndex: state,
onSetActiveIndex: callback,
items: r20.map((item) => ({
id: item,
label: item,
page: null
}))
});
useEffect(() => {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.CHANNEL_PERMISSIONS_PAGE_VIEWED, {
mode: state === c11171_25.BASIC ? SettingMode.BASIC : SettingMode.ADVANCED,
channel_is_private: _ChannelPermissionsUtils.isPrivateGuildChannel(stateFromStores)
});
}, [stateFromStores, state]);
return stateFromStores != null ? <View style={styles.container}>
<View style={{
paddingHorizontal: Module712.space.PX_12
}}>
<SegmentedControl state={segmentedControlState} />
</View>
<ScrollView style={styles.content}>
{state === r43.BASIC ? <ChannelPermissionSettingsBasicView channel={stateFromStores} privateToggleState={privateToggleState} setPrivateToggleState={setState2} /> : state === r43.MODERATORS ? <ViewModerators channel={stateFromStores} /> : <ChannelSettingsPermissionsOverview channelId={stateFromStores.id} />}
</ScrollView>
</View> : null;
};