2020-10-30 16:15:58 +00:00
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
export const getUnreadStyle = ({ unread, userMentions, groupMentions, theme, tunread, tunreadUser, tunreadGroup }: any) => {
|
|
|
|
if ((!unread || unread <= 0) && !tunread?.length) {
|
2020-10-30 16:15:58 +00:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2020-12-17 17:39:45 +00:00
|
|
|
let backgroundColor = themes[theme].unreadColor;
|
2020-10-30 16:15:58 +00:00
|
|
|
const color = themes[theme].buttonText;
|
|
|
|
if (userMentions > 0 || tunreadUser?.length) {
|
2020-12-17 17:39:45 +00:00
|
|
|
backgroundColor = themes[theme].mentionMeColor;
|
2020-10-30 16:15:58 +00:00
|
|
|
} else if (groupMentions > 0 || tunreadGroup?.length) {
|
2020-12-17 17:39:45 +00:00
|
|
|
backgroundColor = themes[theme].mentionGroupColor;
|
2020-10-30 16:15:58 +00:00
|
|
|
} else if (tunread?.length > 0) {
|
2020-12-17 17:39:45 +00:00
|
|
|
backgroundColor = themes[theme].tunreadColor;
|
2020-10-30 16:15:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
2021-09-13 20:41:05 +00:00
|
|
|
backgroundColor,
|
|
|
|
color
|
2020-10-30 16:15:58 +00:00
|
|
|
};
|
|
|
|
};
|