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,92 @@
// Metro module 11693 (f11694).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import ChatInputActionButton from "../../../chat_input/native/action_buttons/ChatInputActionButton";
import { BellIcon } from "../../../../design/components/Icon/native/redesign/generated/BellIcon";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { Icon } from "../../../../design/void/native";
import Module7732 from "../../../../_bundle/Module7732";
const useStyles = createStyles({
sheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
iconContainer: {
alignItems: "center",
marginBottom: 8
},
iconBackground: {
width: 48,
height: 48
},
content: {
padding: 16
},
headerText: {
textAlign: "center",
marginBottom: 8,
paddingHorizontal: 16
},
infoText: {
textAlign: "center",
marginBottom: 16,
paddingHorizontal: 16
},
dismissButtonContainer: {
marginTop: 8
},
mutedNotificationContainer: {
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_FEEDBACK_NOTIFICATION,
height: 24,
width: 24,
padding: 4,
alignContent: "center"
},
mutedNotification: {
width: 16,
height: 16
}
});
export default function MuteAppDMActionSheet(props) {
const styles = useStyles();
const channel = props.channel;
return <BottomSheet startExpanded backgroundStyles={styles.sheet}>
<View style={styles.content}>
<View style={styles.iconContainer}>
<ChatInputActionButton style={styles.iconBackground} IconComponent={BellIcon} active accessibilityLabel={intl.string(t.uAmAiL)} />
</View>
<Text variant="heading-lg/bold" color="mobile-text-heading-primary" style={styles.headerText}>
{intl.string(t.uAmAiL)}
</Text>
<Text variant="text-md/normal" color="text-default" style={styles.infoText}>
{intl.string(t.mscFJU)}
</Text>
<Button variant="destructive" text={intl.string(t.uAmAiL)} onPress={() => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(null, channel.id, {
muted: true
}, NotificationLabels.Muted);
ActionSheetActionCreators.hideActionSheet();
ToastActionCreators.open({
key: "NOTIFICATIONS_MUTED",
content: intl.string(t.EgGpkx),
icon: () => <View style={styles.mutedNotificationContainer}>
<Icon source={Module7732} color={Module712.unsafe_rawColors.WHITE} style={styles.mutedNotification} />
</View>
});
}} />
<View style={styles.dismissButtonContainer}>
<Button variant="secondary" text={intl.string(t.WAI6xu)} onPress={() => {
ActionSheetActionCreators.hideActionSheet();
}} />
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,73 @@
// Metro module 10311 (f10312).
import { useLayoutEffect, useCallback } from "react";
import { View } from "react-native";
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useChannelPresetInheritance, updateChannelToGuildDefault } from "../utils/notficationSettingsChannelFlagUtils";
import { intl, t } from "../../../../intl/index.native";
import useChannelName from "../../../channel/useChannelName";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { NavigatorHeader, getHeaderBackButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
import { useStateFromStoresObject } from "../../../../_bundle/Module589";
import { Form } from "../../../../design/void/Form/native/index";
import { NotificationSettingsMuteBanner, getMuteBannerSubtitleFromConfig } from "./NotificationSettingsMuteBanner";
import { NotificationSettingsChannelPresets } from "./NotificationSettingsPresets";
import { NotificationSettingsChannelMessageNotification } from "./NotificationSettingsMessageNotification";
import { NotificationSettingsChannelMessageUnread } from "./NotificationSettingsMessageUnread";
import { NotificationSettingsChannelPost } from "./NotificationSettingsChannelPost";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
screenContainer: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
padding: 16
}
});
export default function NotificationSettingsChannel(props) {
let c17860_0 = props;
const channelPresetInheritance = useChannelPresetInheritance(props.channel);
const title = intl.string(t.h850Ss);
const subtitle = useChannelName(props.channel);
const navigation = useNavigation();
const styles = useStyles();
useLayoutEffect(() => {
navigation.setOptions({
title: `${title} (${subtitle})`,
headerTitle: () => <NavigatorHeader title={title} subtitle={subtitle} />
});
if (c17860_0.inGuildContext) {
navigation.setOptions({
headerLeft: getHeaderBackButton(() => navigation.popToTop())
});
}
});
const callback2 = useCallback(() => updateChannelToGuildDefault(c17860_0.channel.guild_id, c17860_0.channel.id), [props.channel]);
const callback = useCallback(() => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17860_0.channel.guild_id, c17860_0.channel.id, {
muted: false
}, NotificationLabels.Unmuted);
}, [props.channel]);
const stateFromStoresObject = useStateFromStoresObject([UserGuildSettingsStore], () => ({
config: UserGuildSettingsStore.getChannelMuteConfig(c17860_0.channel.guild_id, c17860_0.channel.id),
muted: UserGuildSettingsStore.isChannelMuted(c17860_0.channel.guild_id, c17860_0.channel.id)
}));
const r79 = [stateFromStoresObject.muted && <NotificationSettingsMuteBanner style={{
marginBottom: 16
}} title={intl.string(t["6MCxAy"])} subtitle={getMuteBannerSubtitleFromConfig(stateFromStoresObject.config)} onPressUnmute={callback} />, <NotificationSettingsChannelPresets channel={props.channel} />, <NotificationSettingsChannelMessageNotification style={{
marginTop: 24
}} channel={props.channel} />, <NotificationSettingsChannelMessageUnread style={{
marginTop: 24
}} channel={props.channel} />, props.channel.isForumLikeChannel() && <NotificationSettingsChannelPost style={{
marginTop: 24
}} channel={props.channel} />, ,];
const inherited = channelPresetInheritance.inherited;
r79[5] = inherited ? !inherited : <View style={{
marginTop: 24
}}>
<Button variant="secondary" onPress={callback2} text={intl.string(t["3PBFN6"])} />
</View>;
return <Form style={styles.screenContainer}>{r79}</Form>;
};
@@ -0,0 +1,44 @@
// 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>;
}
@@ -0,0 +1,81 @@
// Metro module 10319 (f10320).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { getPushNotificationSelectOptions } from "../utils/notificationSettingsPresetOptionUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import NotificationSettingsMockMessage from "./NotificationSettingsMockMessage";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
let useStyles;
const NotificationSettingsMessageNotification = function NotificationSettingsMessageNotification(props) {
let c17867_0 = props;
const styles = useStyles();
const r18 = getPushNotificationSelectOptions().find((item) => item.value === c17867_0.setting);
const r65 = [<View style={styles.header}>
<Text variant="text-sm/semibold" color="text-default" style={styles.headerTitle}>
{intl.string(t["1m22ZB"])}
</Text>
<Text variant="text-xs/semibold" color="text-default">
{props.context === "guild" ? intl.string(t["4bP2ZZ"]) : intl.string(t["R1j5+4"])}
</Text>
</View>, ,];
const r79 = [<NotificationSettingsMockMessage notificationSetting={props.setting} />, , ,];
let r85 = r18?.label;
if (r85 == null) {
r85 = "unset";
}
r79[1] = <Text variant="text-sm/medium" style={styles.label}>{r85}</Text>;
r79[2] = <PressableOpacity onPress={props.onCustomize}>
<Text variant="text-sm/semibold" style={styles.cta} color="text-brand">
{intl.string(t.yxiV9W)}
</Text>
</PressableOpacity>;
r65[1] = <PressableOpacity onPress={props.onCustomize} activeOpacity={0.6}>
<View style={styles.card}>{r79}</View>
</PressableOpacity>;
return <View style={props.style}>{r65}</View>;
};
useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
borderRadius: 20,
borderWidth: 1,
padding: 14
},
cta: {
textAlign: "center",
marginTop: 4
},
label: {
textAlign: "center",
marginTop: 8
},
header: {
marginBottom: 8
},
headerTitle: {
marginBottom: 4
}
});
export default NotificationSettingsMessageNotification;
export function NotificationSettingsGuildMessageNotification(props) {
let c17868_0 = props;
return <NotificationSettingsMessageNotification context="guild" style={props.style} setting={useGuildPresetSettings(props.guildId).notification} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageNotificationGuildActionSheet"), "MessageNotificationGuildActionSheet", {
guildId: c17868_0.guildId
});
}} />;
}
export function NotificationSettingsChannelMessageNotification(props) {
let c17869_0 = props;
return <NotificationSettingsMessageNotification context="channel" style={props.style} setting={useChannelPresetSettings(props.channel).notification} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageNotificationChannelActionSheet"), "MessageNotificationChannelActionSheet", {
channel: c17869_0.channel
});
}} />;
}
@@ -0,0 +1,49 @@
// Metro module 10324 (f10325).
import { View } from "react-native";
import { UserNotificationSettings } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import NotificationSettingsMockMessage from "./NotificationSettingsMockMessage";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { TableRadioGroup } from "../../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../../design/components/TableRow/native/TableRadioRow.native";
const useStyles = createStyles({
sheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
header: {
padding: 24,
paddingTop: 0
},
content: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
padding: 16
},
form: {
marginTop: 8,
marginBottom: 16
}
});
export default function NotificationSettingsMessageNotificationActionSheet(props) {
const styles = useStyles();
return <BottomSheet startExpanded backgroundStyles={styles.sheet}>
<View style={styles.header}>
<NotificationSettingsMockMessage notificationSetting={props.value} />
</View>
<View style={styles.content}>
<Text variant="text-sm/semibold">
{intl.string(t["1m22ZB"])}
</Text>
<Text variant="text-xs/medium" color="text-muted" />
<View style={styles.form}>
<TableRadioGroup defaultValue={props.value} onChange={props.onChange} hasIcons={false}>
<TableRadioRow label={intl.string(t["HVah/3"])} value={UserNotificationSettings.ALL_MESSAGES} subLabel={props.allMessagesSubLabel} />
<TableRadioRow label={intl.string(t["tu+ZWJ"])} value={UserNotificationSettings.ONLY_MENTIONS} />
<TableRadioRow label={intl.string(t.X4wWUi)} value={UserNotificationSettings.NO_MESSAGES} />
</TableRadioGroup>
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,25 @@
// Metro module 10325 (f10326).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
import NotificationSettingsMessageNotificationActionSheet from "./NotificationSettingsMessageNotificationActionSheet";
import { intl, t } from "../../../../intl/index.native";
import { withChannelUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageNotificationChannelActionSheet(props) {
let c17872_0 = props;
const channelPresetSettings = useChannelPresetSettings(props.channel);
const { unread, notification } = channelPresetSettings;
return <NotificationSettingsMessageNotificationActionSheet context="channel" value={notification} allMessagesSubLabel={notification !== UserNotificationSettings.ALL_MESSAGES ? unread !== UnreadSetting.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0 : void 0} onChange={(event) => {
const r7 = {
message_notifications: event
};
if (event === UserNotificationSettings.ALL_MESSAGES && unread !== UnreadSetting.ALL_MESSAGES) {
r7.flags = withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(c17872_0.channel.guild_id, c17872_0.channel.id), ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES);
}
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17872_0.channel.guild_id, c17872_0.channel.id, r7, NotificationLabel.notifications(event));
}} />;
};
@@ -0,0 +1,25 @@
// Metro module 10323 (f10324).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import NotificationSettingsMessageNotificationActionSheet from "./NotificationSettingsMessageNotificationActionSheet";
import { intl, t } from "../../../../intl/index.native";
import { withGuildUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageNotificationGuildActionSheet(props) {
let c17871_0 = props;
const guildPresetSettings = useGuildPresetSettings(props.guildId);
const { unread, notification } = guildPresetSettings;
return <NotificationSettingsMessageNotificationActionSheet context="guild" value={notification} allMessagesSubLabel={notification !== UserNotificationSettings.ALL_MESSAGES ? unread !== UnreadSetting.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0 : void 0} onChange={(event) => {
const r6 = {
message_notifications: event
};
if (event === UserNotificationSettings.ALL_MESSAGES && unread !== UnreadSetting.ALL_MESSAGES) {
r6.flags = withGuildUnreadFlags(UserGuildSettingsStore.getGuildFlags(c17871_0.guildId), GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES);
}
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(c17871_0.guildId, r6, NotificationLabel.notifications(event));
}} />;
};
@@ -0,0 +1,81 @@
// Metro module 10326 (f10327).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { getUnreadSelectOptions } from "../utils/notificationSettingsPresetOptionUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import NotificationSettingsMockChannels from "./NotificationSettingsMockChannels";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
let useStyles;
const NotificationSettingsMessageUnread = function NotificationSettingsMessageUnread(props) {
let c17873_0 = props;
const styles = useStyles();
const r18 = getUnreadSelectOptions().find((item) => item.value === c17873_0.setting);
const r55 = [<View style={styles.header}>
<Text variant="text-sm/semibold" color="text-default" style={styles.headerTitle}>
{intl.string(t.Tqd1Af)}
</Text>
<Text variant="text-xs/semibold" color="text-default">
{intl.string(t.RpQgm5)}
</Text>
</View>, ,];
const r69 = [<NotificationSettingsMockChannels unreadSetting={props.setting} />, , ,];
let r75 = r18?.label;
if (r75 == null) {
r75 = "unset";
}
r69[1] = <Text variant="text-sm/medium" style={styles.label}>{r75}</Text>;
r69[2] = <PressableOpacity onPress={props.onCustomize}>
<Text variant="text-sm/semibold" style={styles.cta} color="text-brand">
{intl.string(t.yxiV9W)}
{" "}
</Text>
</PressableOpacity>;
r55[1] = <PressableOpacity onPress={props.onCustomize} activeOpacity={0.6}>
<View style={styles.card}>{r69}</View>
</PressableOpacity>;
return <View style={props.style}>{r55}</View>;
};
useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
borderRadius: 20,
borderWidth: 1,
padding: 14
},
cta: {
marginTop: 4,
textAlign: "center"
},
label: {
marginTop: 8,
textAlign: "center"
},
header: {
marginBottom: 8
},
headerTitle: {
marginBottom: 4
}
});
export function NotificationSettingsGuildMessageUnread(props) {
let c17874_0 = props;
return <NotificationSettingsMessageUnread style={props.style} setting={useGuildPresetSettings(props.guildId).unread} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageUnreadGuildActionSheet"), "MessageUnreadActionSheet", {
guildId: c17874_0.guildId
});
}} />;
}
export function NotificationSettingsChannelMessageUnread(props) {
let c17875_0 = props;
return <NotificationSettingsMessageUnread style={props.style} setting={useChannelPresetSettings(props.channel).unread} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageUnreadChannelActionSheet"), "MessageUnreadActionSheet", {
channel: c17875_0.channel
});
}} />;
}
@@ -0,0 +1,50 @@
// Metro module 10330 (f10331).
import { View } from "react-native";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import NotificationSettingsMockChannels from "./NotificationSettingsMockChannels";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { TableRadioGroup } from "../../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../../design/components/TableRow/native/TableRadioRow.native";
const useStyles = createStyles({
sheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
header: {
padding: 24,
paddingTop: 0
},
content: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
padding: 16
},
form: {
marginTop: 8,
marginBottom: 16
}
});
export default function NotificationSettingsMessageUnreadActionSheet(props) {
const styles = useStyles();
return <BottomSheet startExpanded backgroundStyles={styles.sheet}>
<View style={styles.header}>
<NotificationSettingsMockChannels unreadSetting={props.value} />
</View>
<View style={styles.content}>
<Text variant="text-sm/semibold">
{intl.string(t.Tqd1Af)}
</Text>
<Text variant="text-xs/medium" color="text-muted">
{intl.string(t.RpQgm5)}
</Text>
<View style={styles.form}>
<TableRadioGroup defaultValue={props.value} onChange={props.onChange} hasIcons={false}>
<TableRadioRow label={intl.string(t["HVah/3"])} value={UnreadSetting.ALL_MESSAGES} />
<TableRadioRow subLabel={props.disabledMentionOnlyWithReason} disabled={props.disabledMentionOnlyWithReason != null} label={intl.string(t["tu+ZWJ"])} value={UnreadSetting.ONLY_MENTIONS} />
</TableRadioGroup>
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,20 @@
// Metro module 10331 (f10332).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
import NotificationSettingsMessageUnreadActionSheet from "./NotificationSettingsMessageUnreadActionSheet";
import { intl, t } from "../../../../intl/index.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withChannelUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageUnreadChannelActionSheet(props) {
let c17878_0 = props;
const channelPresetSettings = useChannelPresetSettings(props.channel);
return <NotificationSettingsMessageUnreadActionSheet value={channelPresetSettings.unread} disabledMentionOnlyWithReason={channelPresetSettings.notification === UserNotificationSettings.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0} onChange={(event) => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17878_0.channel.guild_id, c17878_0.channel.id, {
flags: withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(c17878_0.channel.guild_id, c17878_0.channel.id), event === UnreadSetting.ALL_MESSAGES ? ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES : ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabel.unreads(event));
}} />;
};
@@ -0,0 +1,21 @@
// Metro module 10329 (f10330).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import NotificationSettingsMessageUnreadActionSheet from "./NotificationSettingsMessageUnreadActionSheet";
import { intl, t } from "../../../../intl/index.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withGuildUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageUnreadGuildActionSheet(props) {
let c17877_0 = props;
const guildPresetSettings = useGuildPresetSettings(props.guildId);
const unread = guildPresetSettings.unread;
return <NotificationSettingsMessageUnreadActionSheet disabledMentionOnlyWithReason={guildPresetSettings.notification === UserNotificationSettings.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0} value={unread} onChange={(event) => {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(c17877_0.guildId, {
flags: withGuildUnreadFlags(UserGuildSettingsStore.getGuildFlags(c17877_0.guildId), event === UnreadSetting.ALL_MESSAGES ? GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES : GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabel.unreads(event));
}} />;
};
@@ -0,0 +1,67 @@
// Metro module 10327 (f10328).
import { View } from "react-native";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { intl, t } from "../../../../intl/index.native";
import StaticChannelIndicator from "../../../channel_list_v2/native/components/StaticChannelIndicator";
import { TextIcon } from "../../../../design/components/Icon/native/redesign/generated/TextIcon";
import { Text } from "../../../../design/components/Text/native/Text";
import { Badge } from "../../../../design/void/native";
const useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
overflow: "hidden",
borderRadius: 10,
paddingVertical: 8
},
channel: {
display: "flex",
flexDirection: "row",
alignItems: "center",
paddingVertical: 4,
justifyContent: "space-between",
paddingRight: 12
},
channelName: {
display: "flex",
flexDirection: "row",
alignItems: "center"
}
});
export default function NotificationSettingsMockChannels(props) {
const styles = useStyles();
const r20 = [{
badged: true,
unread: true,
resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES,
name: intl.string(t.EjLobP)
}, {
badged: false,
unread: true,
resolvedUnreadSetting: UnreadSetting.ONLY_MENTIONS,
name: intl.string(t.Wgpwpp)
}, {
badged: false,
unread: false,
resolvedUnreadSetting: UnreadSetting.ONLY_MENTIONS,
name: intl.string(t.g9VImh)
}];
if (props.unreadSetting === UnreadSetting.ALL_MESSAGES) {
r20[1].resolvedUnreadSetting = UnreadSetting.ALL_MESSAGES;
}
return <View style={styles.card}>
{r20.map((item) => <View key={item.name} style={styles.channel}>
<View style={styles.channelName}>
<StaticChannelIndicator unread={item.unread} resolvedUnreadSetting={item.resolvedUnreadSetting} />
<TextIcon style={{
marginLeft: 12
}} size="xs" color={item.resolvedUnreadSetting === UnreadSetting.ONLY_MENTIONS ? "text-muted" : void 0} />
<Text style={{
marginLeft: 4
}} variant="text-sm/semibold" color={item.resolvedUnreadSetting === UnreadSetting.ONLY_MENTIONS ? "text-muted" : void 0}>{item.name}</Text>
</View>
<Badge value={item.badged ? 1 : 0} />
</View>)}
</View>;
};
@@ -0,0 +1,93 @@
// Metro module 10321 (f10322).
import { useEffect } from "react";
import { View } from "react-native";
import UserStore from "../../../../stores/UserStore";
import { UserNotificationSettings } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import UserUtils from "../../../../utils/UserUtils";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { Avatar, AvatarSizes } from "../../../../design/void/native";
import Module10322 from "../../../../_bundle/Module10322";
const useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
overflow: "hidden",
borderRadius: 10,
padding: 16
},
cardContent: {
display: "flex",
flexDirection: "row"
},
cardMessage: {
marginLeft: 12,
maxWidth: 240
},
overlay: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
}
});
const __initData = {
code: "function NotificationSettingsMockMessageTsx1(){const{withTiming,opacity,timingStandard}=this.__closure;return{opacity:withTiming(opacity.get(),timingStandard)};}"
};
export default function NotificationSettingsMockMessage(props) {
const styles = useStyles();
let r20 = UserUtils.getName(useStateFromStores([UserStore], () => UserStore.getCurrentUser()));
if (r20 == null) {
r20 = "Roka";
}
const r33 = props.notificationSetting === UserNotificationSettings.NO_MESSAGES;
let c17870_0 = r33;
const sharedValue = useSharedValue(r33 ? 0.8 : 0);
const h = () => ({
opacity: _timing.withTiming(sharedValue.get(), _timingPresets.timingStandard)
});
h.__closure = {
withTiming: _timing.withTiming,
opacity: sharedValue,
timingStandard: _timingPresets.timingStandard
};
h.__workletHash = 6531430956793;
h.__initData = __initData;
const animatedStyle = useAnimatedStyle(h);
const r73 = props.notificationSetting === UserNotificationSettings.ALL_MESSAGES ? <Text variant="text-sm/medium" color="text-default">
{intl.string(t.WYyzI5)}
</Text> : <View>
<Text variant="text-sm/medium" color="text-default">
<Text variant="text-sm/normal" color="text-link">
@
{r20}
{" "}
</Text>
{intl.string(t.WYyzI5)}
</Text>
</View>;
useEffect(() => {
sharedValue.set(c17870_0 ? 0.8 : 0);
}, [sharedValue, r33]);
return <View style={styles.card}>
<View style={styles.cardContent}>
<View>
<Avatar source={Module10322} size={AvatarSizes.LARGE_48} />
</View>
<View style={styles.cardMessage}>
<Text variant="text-sm/semibold">
{intl.string(t.qSq0tD)}
</Text>
{r73}
</View>
</View>
<ReanimatedRexport.View style={[animatedStyle, styles.overlay]} />
</View>;
};
@@ -0,0 +1,40 @@
// Metro module 10314 (f10315).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../intl/index.native";
const useStyles = createStyles({
card: {
padding: 16,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderRadius: Module712.radii.lg + 8,
backgroundColor: Module712.colors.BACKGROUND_BRAND
}
});
export function NotificationSettingsMuteBanner(props) {
return <View style={[props.style, useStyles().card]}>
<View style={{
flex: 1,
marginRight: 8
}}>
<Text variant="text-md/semibold" color="text-overlay-light">{props.title}</Text>
<Text variant="text-xs/medium" color="text-overlay-light">{props.subtitle}</Text>
</View>
<Button text={intl.string(t.YqAjXy)} onPress={props.onPressUnmute} variant="primary-overlay" />
</View>;
}
export function getMuteBannerSubtitleFromConfig(a0) {
return a0?.end_time == null ? intl.string(t["tFqP/P"]) : intl.formatToPlainString(t.C7m4oh, {
endTime: new Date(a0.end_time).toLocaleString(intl.currentLocale, {
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "2-digit"
})
});
}
@@ -0,0 +1,95 @@
// Metro module 10315 (f10316).
import { useEffect } from "react";
import { View } from "react-native";
import { intl, t } from "../../../../intl/index.native";
import { Presets } from "../utils/notificationSettingsPresetUtils";
import { CircleCheckIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleCheckIcon";
import { MagicWandIcon } from "../../../../design/components/Icon/native/redesign/generated/MagicWandIcon";
import { BellSlashIcon } from "../../../../design/components/Icon/native/redesign/generated/BellSlashIcon";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useSegmentedControlState } from "../../../../design/components/SegmentedControl/native/SegmentedControlState.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { SegmentedControl } from "../../../../design/components/SegmentedControl/native/SegmentedControl.native";
import { useGuildPresetSettings, updateGuildPreset } from "../utils/notificationSettingsGuildFlagUtils";
import { useChannelPresetSettings, updateChannelPreset } from "../utils/notficationSettingsChannelFlagUtils";
let useStyles;
const NotificationSettingsPresets = function NotificationSettingsPresets(props) {
let c17863_0 = props;
const styles = useStyles();
const defaultIndex = props.preset !== Presets.ALL_MESSAGES ? props.preset !== Presets.MENTIONS ? props.preset === Presets.NOTHING ? 2 : void 0 : 1 : 0;
let c17863_1 = defaultIndex;
const segmentedControlState = useSegmentedControlState({
pageWidth: 0,
onSetActiveIndex: function onSetActiveIndex(a0) {
if (a0 === 0 && c17863_0.preset !== Presets.ALL_MESSAGES) {
c17863_0.updatePreset(Presets.ALL_MESSAGES);
}
if (a0 === 1 && c17863_0.preset !== Presets.MENTIONS) {
c17863_0.updatePreset(Presets.MENTIONS);
}
if (a0 === 2 && c17863_0.preset !== Presets.NOTHING) {
c17863_0.updatePreset(Presets.NOTHING);
}
},
items: [{
label: intl.string(t.hZrr6k),
id: Presets.ALL_MESSAGES,
icon: <CircleCheckIcon />,
page: null
}, {
label: intl.string(t.y59NJm),
id: Presets.MENTIONS,
icon: <MagicWandIcon />,
page: null
}, {
label: intl.string(t["pGn/bJ"]),
id: Presets.NOTHING,
icon: <BellSlashIcon />,
page: null
}],
defaultIndex
});
useEffect(() => {
if (!(c17863_1 == null || c17863_1 >= 3)) {
segmentedControlState.setActiveIndex(c17863_1);
}
}, [defaultIndex, segmentedControlState]);
return props.preset === Presets.CUSTOM ? <View style={styles.customContainer}>
<View style={{
flex: 1,
marginRight: 8
}}>
<Text variant="text-sm/semibold">
{intl.string(t["32yow9"])}
</Text>
<Text variant="text-xs/medium">
{intl.string(t.l3doVX)}
</Text>
</View>
<Button variant="secondary" text={intl.string(t["ztO+l+"])} onPress={() => {
c17863_0.updatePreset(Presets.MENTIONS);
}} />
</View> : <SegmentedControl variant="experimental_Large" state={segmentedControlState} />;
};
useStyles = createStyles({
customContainer: {
padding: 16,
minHeight: 82,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
borderRadius: Module712.radii.lg + 8,
backgroundColor: Module712.colors.REDESIGN_INPUT_CONTROL_ACTIVE_BG
}
});
export function NotificationSettingsGuildPresets(props) {
let c17864_0 = props;
return <NotificationSettingsPresets preset={useGuildPresetSettings(props.guildId).preset} updatePreset={(a0) => updateGuildPreset(c17864_0.guildId, a0)} />;
}
export function NotificationSettingsChannelPresets(props) {
let c17865_0 = props;
return <NotificationSettingsPresets preset={useChannelPresetSettings(props.channel).preset} updatePreset={(a0) => updateChannelPreset(c17865_0.channel.guild_id, c17865_0.channel.id, a0)} />;
}