45 lines
1.8 KiB
TypeScript
45 lines
1.8 KiB
TypeScript
// Metro module 10332 (f10333).
|
|
import { View } from "react-native";
|
|
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
|
|
import { useStateFromStoresObject } from "../../../../_bundle/Module589";
|
|
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import { TableCheckboxRow } from "../../../../design/components/TableRow/native/TableCheckboxRow.native";
|
|
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
|
|
export function NotificationSettingsChannelPost(props) {
|
|
let newForumThreadsCreated;
|
|
let c17879_0 = props;
|
|
const channel = props.channel;
|
|
const { guild_id, id } = channel;
|
|
const stateFromStoresObject = useStateFromStoresObject([UserGuildSettingsStore], () => ({
|
|
muted: UserGuildSettingsStore.isChannelMuted(guild_id, id),
|
|
guildMuted: UserGuildSettingsStore.isMuted(guild_id),
|
|
newForumThreadsCreated: UserGuildSettingsStore.getNewForumThreadsCreated(c17879_0.channel)
|
|
}));
|
|
let muted = stateFromStoresObject.muted;
|
|
const guildMuted = stateFromStoresObject.guildMuted;
|
|
newForumThreadsCreated = stateFromStoresObject.newForumThreadsCreated;
|
|
const props2 = {
|
|
title: intl.string(t.bK11jO),
|
|
hasIcons: false,
|
|
children: null
|
|
};
|
|
const props3 = {
|
|
label: intl.string(t.Rkgjph),
|
|
checked: newForumThreadsCreated,
|
|
disabled: null,
|
|
onPress: null
|
|
};
|
|
if (!muted) {
|
|
muted = guildMuted;
|
|
}
|
|
props3.disabled = muted;
|
|
props3.onPress = () => {
|
|
NotificationSettingsModalActionCreators.setForumThreadsCreated(c17879_0.channel, !newForumThreadsCreated);
|
|
};
|
|
props2.children = <TableCheckboxRow {...props3} />;
|
|
return <View style={props.style}>
|
|
<TableRowGroup {...props2} />
|
|
</View>;
|
|
}
|