2017-09-27 02:33:08 +08:00
|
|
|
import { PLUGIN_ID } from './send-reminders-constants';
|
2019-03-05 03:03:12 +08:00
|
|
|
import { SendRemindersMetadata } from './types';
|
2017-09-07 07:19:48 +08:00
|
|
|
|
2017-09-27 02:33:08 +08:00
|
|
|
export const name = 'SendRemindersThreadListExtension';
|
2017-09-07 07:19:48 +08:00
|
|
|
|
|
|
|
export function cssClassNamesForThreadListItem(thread) {
|
2019-03-05 03:03:12 +08:00
|
|
|
const { shouldNotify } = thread.metadataForPluginId(PLUGIN_ID) || ({} as SendRemindersMetadata);
|
2017-09-07 07:19:48 +08:00
|
|
|
if (shouldNotify) {
|
2017-09-27 02:33:08 +08:00
|
|
|
return 'thread-list-reminder-item';
|
2017-09-07 07:19:48 +08:00
|
|
|
}
|
2017-09-27 02:33:08 +08:00
|
|
|
return '';
|
2017-09-07 07:19:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function cssClassNamesForThreadListIcon(thread) {
|
2019-03-05 03:03:12 +08:00
|
|
|
const { expiration, shouldNotify } =
|
|
|
|
thread.metadataForPluginId(PLUGIN_ID) || ({} as SendRemindersMetadata);
|
2017-09-07 07:19:48 +08:00
|
|
|
if (shouldNotify) {
|
2017-09-27 02:33:08 +08:00
|
|
|
return 'thread-icon-reminder-triggered';
|
2017-09-07 07:19:48 +08:00
|
|
|
}
|
2017-09-26 06:44:20 +08:00
|
|
|
if (expiration) {
|
2017-09-27 02:33:08 +08:00
|
|
|
return 'thread-icon-reminder-pending';
|
2017-09-07 07:19:48 +08:00
|
|
|
}
|
2017-09-27 02:33:08 +08:00
|
|
|
return '';
|
2017-09-07 07:19:48 +08:00
|
|
|
}
|