()
| 98 | // The inbox door, beside the avatar on every root: messages are checked |
| 99 | // in passing, not browsed, so they live in the header rather than a tab. |
| 100 | const MessagesSquare = (): ReactElement | null => { |
| 101 | const { isEnabled } = useMessagesEnabled(); |
| 102 | const { total: unreadCount } = useUnreadMessagesCount(isEnabled); |
| 103 | |
| 104 | if (!isEnabled) { |
| 105 | return null; |
| 106 | } |
| 107 | |
| 108 | return ( |
| 109 | <Link |
| 110 | href={getMessagesUrl(undefined, { origin: DmOrigin.Header })} |
| 111 | passHref |
| 112 | > |
| 113 | <ShellSquare |
| 114 | tag="a" |
| 115 | aria-label={ |
| 116 | unreadCount |
| 117 | ? `Messages, ${getUnreadText(unreadCount)} unread` |
| 118 | : 'Messages' |
| 119 | } |
| 120 | > |
| 121 | <span className="relative flex"> |
| 122 | <MailIcon size={IconSize.Small} /> |
| 123 | {!!unreadCount && ( |
| 124 | <Bubble className={railCountBubbleClass}> |
| 125 | {getUnreadText(unreadCount)} |
| 126 | </Bubble> |
| 127 | )} |
| 128 | </span> |
| 129 | </ShellSquare> |
| 130 | </Link> |
| 131 | ); |
| 132 | }; |
| 133 | |
| 134 | const RootRow = ({ root }: { root: ShellRoot }): ReactElement => { |
| 135 | const { user } = useAuthContext(); |
nothing calls this directly
no test coverage detected