Files
discord-decomp/modules/notifications/settings/native/MuteAppDmActionSheet.tsx
T
2026-11-01 12:12:55 +02:00

93 lines
3.5 KiB
TypeScript

// 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>;
};