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

43 lines
1.9 KiB
TypeScript

// Metro module 9541 (f9542).
import { NotificationUserFeedbackReasons } from "./Constants";
import { AnalyticEvents } from "../../../Constants";
import { intl, t } from "../../../intl/index.native";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import FeedbackActionSheet from "../../feedback/native/FeedbackActionSheet";
import { handleSurveyCleanup } from "../../push_feedback/PushFeedbackActions";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
const trackOpen = function trackOpen() {
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
type: "Notification Feedback Sheet",
source: "Notification End"
});
};
export default function NotificationSurveyActionSheet(props) {
const { notificationType, location: location2, messageId } = props;
const reasons = [{
value: NotificationUserFeedbackReasons.TOO_MANY,
label: intl.string(t.pLeQp0)
}, {
value: NotificationUserFeedbackReasons.IRRELEVANT,
label: intl.string(t.tuwPcC)
}, {
value: NotificationUserFeedbackReasons.DISLIKE_CONTENT,
label: intl.string(t.glUMhg)
}];
return <FeedbackActionSheet headerLabel={intl.string(t.wGioO1)} showHeaderCloseButton hideDontShowAgainCheckbox ratingsBodyLabel={intl.string(t.Yzl7Or)} reasonsHeaderLabel={intl.string(t.g1q5fr)} reasons={reasons} trackOpen={trackOpen} trackReport={function trackReport({ rating, reason }) {
if (rating != null) {
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_REPORT_SUBMITTED, {
reason: reason != null ? reason.value : null,
rating,
notification_type: notificationType,
location: location2,
message_id: messageId
});
handleSurveyCleanup();
ActionSheetActionCreators.openLazy(import("./NotificationSurveyResponseActionSheet"), "UserFeedbackSurvey", {
header: intl.string(t.wGioO1)
});
}
}} />;
};