2020-10-30 16:15:58 +00:00
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
|
|
|
|
export const getUnreadStyle = ({
|
|
|
|
unread, userMentions, groupMentions, theme, tunread, tunreadUser, tunreadGroup
|
|
|
|
}) => {
|
|
|
|
if ((!unread || unread <= 0) && (!tunread?.length)) {
|
|
|
|
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 {
|
|
|
|
backgroundColor, color
|
|
|
|
};
|
|
|
|
};
|