Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions assets/images/avatars/admin-room.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions assets/images/avatars/announce-room.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/images/avatars/deleted-room.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/images/avatars/room.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ import Wallet from '../../../assets/images/wallet.svg';
import Workspace from '../../../assets/images/workspace-default-avatar.svg';
import ActiveRoomAvatar from '../../../assets/images/avatars/room.svg';
import DeletedRoomAvatar from '../../../assets/images/avatars/deleted-room.svg';
import AdminRoomAvatar from '../../../assets/images/avatars/admin-room.svg';
import AnnounceRoomAvatar from '../../../assets/images/avatars/announce-room.svg';

export {
ActiveRoomAvatar,
AdminRoomAvatar,
Android,
AnnounceRoomAvatar,
Apple,
ArrowRight,
BackArrow,
Expand Down
6 changes: 6 additions & 0 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ function getAvatarSources(report) {
if (ReportUtils.isArchivedRoom(report)) {
return Expensicons.DeletedRoomAvatar;
}
if (ReportUtils.isAdminRoom(report)) {
return Expensicons.AdminRoomAvatar;
}
if (ReportUtils.isAnnounceRoom(report)) {
return Expensicons.AnnounceRoomAvatar;
}
if (ReportUtils.isChatRoom(report)) {
return Expensicons.ActiveRoomAvatar;
}
Expand Down
22 changes: 22 additions & 0 deletions src/libs/reportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ function isDefaultRoom(report) {
], lodashGet(report, ['chatType'], ''));
}

/**
* Whether the provided report is an Admin room
* @param {Object} report
* @param {String} report.chatType
* @returns {Boolean}
*/
function isAdminRoom(report) {
return lodashGet(report, ['chatType'], '') === CONST.REPORT.CHAT_TYPE.POLICY_ADMINS;
}

/**
* Whether the provided report is a Announce room
* @param {Object} report
* @param {String} report.chatType
* @returns {Boolean}
*/
function isAnnounceRoom(report) {
return lodashGet(report, ['chatType'], '') === CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE;
}

/**
* Whether the provided report is a user created policy room
* @param {Object} report
Expand Down Expand Up @@ -257,6 +277,8 @@ export {
canDeleteReportAction,
sortReportsByLastVisited,
isDefaultRoom,
isAdminRoom,
isAnnounceRoom,
isUserCreatedPolicyRoom,
isChatRoom,
getChatRoomSubtitle,
Expand Down