Files
discourse/app/assets/javascripts/discourse/app/components/topic-notifications-tracking.gjs
Joffrey JAFFEUX 41df705188 DEV: replaces topic-notifications-options by DMenu (#30298)
This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />.

Each tracking case has its dedicated component:

- topic -> `<TopicNotificationsTracking />`
- group -> `<GroupNotificationsTracking />`
- tag -> `<TagNotificationsTracking />`
- category -> `<CategoryNotificationsTracking />`
- chat thread -> `<ThreadNotificationsTracking />`
2024-12-16 19:59:18 +01:00

25 lines
776 B
Plaintext

import Component from "@glimmer/component";
import NotificationsTracking from "discourse/components/notifications-tracking";
import { topicLevels } from "discourse/lib/notification-levels";
import { i18n } from "discourse-i18n";
export default class TopicNotificationsTracking extends Component {
get suffix() {
return this.args.topic?.archetype === "private_message" ? "_pm" : "";
}
<template>
<NotificationsTracking
@onChange={{@onChange}}
@levelId={{@levelId}}
@showCaret={{@showCaret}}
@showFullTitle={{@showFullTitle}}
@prefix="topic.notifications"
@title={{i18n "topic.notifications.title"}}
class="topic-notifications-tracking"
@levels={{topicLevels}}
@suffix={{this.suffix}}
/>
</template>
}