mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
fix: show notifications on mobile (#17008)
Show the notifications close to the menu button. **After fix:** <img width="515" alt="Screenshot 2025-03-19 at 15 09 36" src="https://github.com/user-attachments/assets/38f86c5b-d324-4a8b-9c68-ea818b226ae4" />
This commit is contained in:
@ -67,9 +67,8 @@ export const MobileMenu: FC<MobileMenuProps> = ({
|
|||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
aria-label={open ? "Close menu" : "Open menu"}
|
aria-label={open ? "Close menu" : "Open menu"}
|
||||||
size="lg"
|
size="icon-lg"
|
||||||
variant="subtle"
|
variant="subtle"
|
||||||
className="ml-auto md:hidden"
|
|
||||||
>
|
>
|
||||||
{open ? <XIcon /> : <MenuIcon />}
|
{open ? <XIcon /> : <MenuIcon />}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -55,7 +55,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
|
|||||||
|
|
||||||
<NavItems className="ml-4" />
|
<NavItems className="ml-4" />
|
||||||
|
|
||||||
<div className=" hidden md:flex items-center gap-3 ml-auto">
|
<div className="hidden md:flex items-center gap-3 ml-auto">
|
||||||
{proxyContextValue && (
|
{proxyContextValue && (
|
||||||
<ProxyMenu proxyContextValue={proxyContextValue} />
|
<ProxyMenu proxyContextValue={proxyContextValue} />
|
||||||
)}
|
)}
|
||||||
@ -67,18 +67,6 @@ export const NavbarView: FC<NavbarViewProps> = ({
|
|||||||
canViewHealth={canViewHealth}
|
canViewHealth={canViewHealth}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NotificationsInbox
|
|
||||||
fetchNotifications={API.getInboxNotifications}
|
|
||||||
markAllAsRead={() => {
|
|
||||||
throw new Error("Function not implemented.");
|
|
||||||
}}
|
|
||||||
markNotificationAsRead={(notificationId) =>
|
|
||||||
API.updateInboxNotificationReadStatus(notificationId, {
|
|
||||||
is_read: true,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{user && (
|
{user && (
|
||||||
<UserDropdown
|
<UserDropdown
|
||||||
user={user}
|
user={user}
|
||||||
@ -89,16 +77,30 @@ export const NavbarView: FC<NavbarViewProps> = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MobileMenu
|
<div className="ml-auto flex items-center gap-3 md:hidden">
|
||||||
proxyContextValue={proxyContextValue}
|
<NotificationsInbox
|
||||||
user={user}
|
fetchNotifications={API.getInboxNotifications}
|
||||||
supportLinks={supportLinks}
|
markAllAsRead={() => {
|
||||||
onSignOut={onSignOut}
|
throw new Error("Function not implemented.");
|
||||||
canViewAuditLog={canViewAuditLog}
|
}}
|
||||||
canViewOrganizations={canViewOrganizations}
|
markNotificationAsRead={(notificationId) =>
|
||||||
canViewDeployment={canViewDeployment}
|
API.updateInboxNotificationReadStatus(notificationId, {
|
||||||
canViewHealth={canViewHealth}
|
is_read: true,
|
||||||
/>
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<MobileMenu
|
||||||
|
proxyContextValue={proxyContextValue}
|
||||||
|
user={user}
|
||||||
|
supportLinks={supportLinks}
|
||||||
|
onSignOut={onSignOut}
|
||||||
|
canViewAuditLog={canViewAuditLog}
|
||||||
|
canViewOrganizations={canViewOrganizations}
|
||||||
|
canViewDeployment={canViewDeployment}
|
||||||
|
canViewHealth={canViewHealth}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user