Skip to content

Commit fd2a12a

Browse files
authored
Header icons refine (supabase#36549)
header refine
1 parent 4ae8257 commit fd2a12a

File tree

2 files changed

+25
-35
lines changed

2 files changed

+25
-35
lines changed

apps/studio/components/layouts/AppLayout/AssistantButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const AssistantButton = () => {
2929
},
3030
}}
3131
>
32-
<AiIconAnimation allowHoverEffect size={16} />
32+
<AiIconAnimation allowHoverEffect={false} size={16} />
3333
</ButtonTooltip>
3434
)
3535
}

apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover.tsx

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import { useProjectsQuery } from 'data/projects/projects-query'
1414
import { useNotificationsStateSnapshot } from 'state/notifications'
1515
import {
1616
Button,
17-
CriticalIcon,
1817
PopoverContent_Shadcn_,
1918
PopoverTrigger_Shadcn_,
2019
Popover_Shadcn_,
2120
TabsList_Shadcn_,
2221
TabsTrigger_Shadcn_,
2322
Tabs_Shadcn_,
24-
WarningIcon,
2523
cn,
2624
} from 'ui'
2725
import NotificationRow from './NotificationRow'
@@ -103,41 +101,33 @@ export const NotificationsPopoverV2 = () => {
103101
text: 'Notifications',
104102
},
105103
}}
106-
type={hasNewNotifications ? 'outline' : 'text'}
107-
className={cn(
108-
'rounded-none h-[30px] w-[32px]',
109-
// !hasCritical || !hasWarning || !hasNewNotifications ? 'w-[26px]' : '',
110-
'group',
111-
hasNewNotifications ? 'rounded-full px-1.5' : 'px-1',
112-
hasCritical
113-
? 'border-destructive-500 hover:border-destructive-600 hover:bg-destructive-300'
114-
: hasWarning
115-
? 'border-warning-500 hover:border-warning-600 hover:bg-warning-300'
116-
: ''
117-
)}
104+
type="text"
105+
className={cn('rounded-none h-[30px] w-[32px] group relative')}
118106
icon={
119-
hasCritical ? (
120-
<CriticalIcon className="relative !w-3.5 !h-3.5 transition-all -mr-3.5 group-hover:-mr-1 z-10" />
121-
) : hasWarning ? (
122-
<WarningIcon className="relative !w-3.5 !h-3.5 transition-all -mr-3.5 group-hover:-mr-1 z-10" />
123-
) : hasNewNotifications ? (
124-
<div
107+
<div className="relative">
108+
<InboxIcon
109+
size={18}
110+
strokeWidth={1.5}
125111
className={cn(
126-
'transition-all -mr-3 group-hover:-mr-1',
127-
'z-10 h-4 flex items-center justify-center rounded-full bg-black dark:bg-white',
128-
(summary?.unread_count ?? 0) > 9 ? 'px-0.5 w-auto' : 'w-4'
112+
'!h-[18px] !w-[18px] text-foreground-light group-hover:text-foreground'
129113
)}
130-
>
131-
<p className="text-xs text-background-alternative">{summary?.unread_count}</p>
132-
</div>
133-
) : null
134-
}
135-
iconRight={
136-
<InboxIcon
137-
size={18}
138-
strokeWidth={1.5}
139-
className="!h-[18px] !w-[18px] transition group-hover:text-foreground text-foreground-light"
140-
/>
114+
/>
115+
{hasCritical && (
116+
<div className="absolute -top-1 -right-2 w-3.5 h-3.5 z-10 flex items-center justify-center">
117+
<div className="w-0 h-0 border-l-[6px] border-r-[6px] border-b-[10px] border-l-transparent border-r-transparent border-b-destructive" />
118+
</div>
119+
)}
120+
{hasWarning && !hasCritical && (
121+
<div className="absolute -top-1 -right-2 w-3.5 h-3.5 z-10 flex items-center justify-center">
122+
<div className="w-2 h-2 rounded-full bg-warning" />
123+
</div>
124+
)}
125+
{!!hasNewNotifications && !hasCritical && !hasWarning && (
126+
<div className="absolute -top-1 -right-2 w-3.5 h-3.5 z-10 flex items-center justify-center">
127+
<div className="w-2 h-2 rounded-full bg-brand" />
128+
</div>
129+
)}
130+
</div>
141131
}
142132
/>
143133
</PopoverTrigger_Shadcn_>

0 commit comments

Comments
 (0)