fix: notifications option in the sidebar menu not collapsing (#2662)

This commit is contained in:
Aaryan Khandelwal 2023-11-06 14:53:26 +05:30 committed by GitHub
parent 0c8a867565
commit a03e0c788f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 17 deletions

View File

@ -91,12 +91,12 @@ export const HeaderGroupByCard = observer(({ icon, title, count, issuePayload }:
/> />
)} )}
<div <div
className={`flex-shrink-0 relative flex gap-2 p-1.5 ${ className={`flex-shrink-0 relative flex gap-2 py-1.5 ${
verticalAlignPosition ? `flex-col items-center w-[44px]` : `flex-row items-center w-full` verticalAlignPosition ? `flex-col items-center w-11` : `flex-row items-center w-full`
}`} }`}
> >
<div className="flex-shrink-0 w-[20px] h-[20px] rounded-sm overflow-hidden flex justify-center items-center"> <div className="flex-shrink-0 w-5 h-5 rounded-sm overflow-hidden flex justify-center items-center">
{icon ? icon : <CircleDashed width={14} strokeWidth={2} />} {icon ? icon : <CircleDashed className="h-3.5 w-3.5" strokeWidth={2} />}
</div> </div>
<div className={`flex items-center gap-1 ${verticalAlignPosition ? `flex-col` : `flex-row w-full`}`}> <div className={`flex items-center gap-1 ${verticalAlignPosition ? `flex-col` : `flex-row w-full`}`}>
@ -114,8 +114,8 @@ export const HeaderGroupByCard = observer(({ icon, title, count, issuePayload }:
<CustomMenu <CustomMenu
width="auto" width="auto"
customButton={ customButton={
<span className="flex-shrink-0 w-[20px] h-[20px] rounded-sm overflow-hidden flex justify-center items-center hover:bg-custom-background-80 cursor-pointer transition-all"> <span className="flex-shrink-0 w-5 h-5 rounded-sm overflow-hidden flex justify-center items-center hover:bg-custom-background-80 cursor-pointer transition-all">
<Plus width={14} strokeWidth={2} /> <Plus className="h-3.5 w-3.5" strokeWidth={2} />
</span> </span>
} }
> >
@ -128,7 +128,7 @@ export const HeaderGroupByCard = observer(({ icon, title, count, issuePayload }:
</CustomMenu> </CustomMenu>
) : ( ) : (
<div <div
className="flex-shrink-0 w-[20px] h-[20px] rounded-sm overflow-hidden flex justify-center items-center hover:bg-custom-background-80 cursor-pointer transition-all" className="flex-shrink-0 w-5 h-5 rounded-sm overflow-hidden flex justify-center items-center hover:bg-custom-background-80 cursor-pointer transition-all"
onClick={() => setIsOpen(true)} onClick={() => setIsOpen(true)}
> >
<Plus width={14} strokeWidth={2} /> <Plus width={14} strokeWidth={2} />

View File

@ -16,7 +16,7 @@ import { getNumberCount } from "helpers/string.helper";
import { useMobxStore } from "lib/mobx/store-provider"; import { useMobxStore } from "lib/mobx/store-provider";
export const NotificationPopover = observer(() => { export const NotificationPopover = observer(() => {
const store: any = useMobxStore(); const { theme: themeStore } = useMobxStore();
const { const {
notifications, notifications,
@ -45,6 +45,8 @@ export const NotificationPopover = observer(() => {
markAllNotificationsAsRead, markAllNotificationsAsRead,
} = useUserNotification(); } = useUserNotification();
const isSidebarCollapsed = themeStore.sidebarCollapsed;
return ( return (
<> <>
<SnoozeNotificationModal <SnoozeNotificationModal
@ -62,23 +64,18 @@ export const NotificationPopover = observer(() => {
return ( return (
<> <>
<Tooltip <Tooltip tooltipContent="Notifications" position="right" className="ml-2" disabled={!isSidebarCollapsed}>
tooltipContent="Notifications"
position="right"
className="ml-2"
disabled={!store?.theme?.sidebarCollapsed}
>
<Popover.Button <Popover.Button
className={`relative group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium outline-none ${ className={`relative group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium outline-none ${
isActive isActive
? "bg-custom-primary-100/10 text-custom-primary-100" ? "bg-custom-primary-100/10 text-custom-primary-100"
: "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80" : "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80"
} ${store?.theme?.sidebarCollapsed ? "justify-center" : ""}`} } ${isSidebarCollapsed ? "justify-center" : ""}`}
> >
<Bell className="h-4 w-4" /> <Bell className="h-4 w-4" />
{store?.theme?.sidebarCollapsed ? null : <span>Notifications</span>} {isSidebarCollapsed ? null : <span>Notifications</span>}
{totalNotificationCount && totalNotificationCount > 0 ? ( {totalNotificationCount && totalNotificationCount > 0 ? (
store?.theme?.sidebarCollapsed ? ( isSidebarCollapsed ? (
<span className="absolute right-3.5 top-2 h-2 w-2 bg-custom-primary-300 rounded-full" /> <span className="absolute right-3.5 top-2 h-2 w-2 bg-custom-primary-300 rounded-full" />
) : ( ) : (
<span className="ml-auto bg-custom-primary-300 rounded-full text-xs text-white px-1.5"> <span className="ml-auto bg-custom-primary-300 rounded-full text-xs text-white px-1.5">

View File

@ -17,6 +17,7 @@ import {
export interface IIssueFilterStore { export interface IIssueFilterStore {
loader: boolean; loader: boolean;
error: any | null; error: any | null;
// TODO: store filters and properties separately for each project
userDisplayProperties: IIssueDisplayProperties; userDisplayProperties: IIssueDisplayProperties;
userDisplayFilters: IIssueDisplayFilterOptions; userDisplayFilters: IIssueDisplayFilterOptions;
userFilters: IIssueFilterOptions; userFilters: IIssueFilterOptions;