MCPcopy Create free account
hub / github.com/dailydotdev/apps / MessagesSquare

Function MessagesSquare

packages/shared/src/components/shell/ShellBlock.tsx:100–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.
100const 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
134const RootRow = ({ root }: { root: ShellRoot }): ReactElement => {
135 const { user } = useAuthContext();

Callers

nothing calls this directly

Calls 4

useMessagesEnabledFunction · 0.90
useUnreadMessagesCountFunction · 0.90
getMessagesUrlFunction · 0.90
getUnreadTextFunction · 0.90

Tested by

no test coverage detected