Merge pull request 'remove the ui bnutton' (#66) from Implement_Changes into main
Deploy to S3 / deploy (push) Successful in 39s
Details
Deploy to S3 / deploy (push) Successful in 39s
Details
Reviewed-on: #66pull/67/head
commit
2101fbac74
|
|
@ -3,8 +3,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||||
|
|
||||||
import Dropdown, { DropdownGroup } from '../ui/Dropdown'
|
import Dropdown, { DropdownGroup } from '../ui/Dropdown'
|
||||||
import GlobalSearch from './GlobalSearch'
|
import GlobalSearch from './GlobalSearch'
|
||||||
import { Avatar, Icon } from '../ui/primitives'
|
import { Icon } from '../ui/primitives'
|
||||||
import { seedQuery } from '../data/seedQueries'
|
|
||||||
import { useToast } from '../ui/Toast'
|
import { useToast } from '../ui/Toast'
|
||||||
import { useTheme } from '../theme/ThemeProvider'
|
import { useTheme } from '../theme/ThemeProvider'
|
||||||
import { useAuth } from '../auth/AuthContext'
|
import { useAuth } from '../auth/AuthContext'
|
||||||
|
|
@ -40,8 +39,6 @@ export default function Topbar({ onOpenNav, searchRef }) {
|
||||||
const notifications = notifQuery.data?.items ?? []
|
const notifications = notifQuery.data?.items ?? []
|
||||||
const unread = notifQuery.data?.unread ?? 0
|
const unread = notifQuery.data?.unread ?? 0
|
||||||
|
|
||||||
const { data: messages = [] } = useQuery(seedQuery('messages'))
|
|
||||||
|
|
||||||
const markAll = useMutation({
|
const markAll = useMutation({
|
||||||
mutationFn: () => notificationsApi.markAllRead(),
|
mutationFn: () => notificationsApi.markAllRead(),
|
||||||
onError: (err) => toast(friendlyAuthError(err, 'Could not mark all as read.'), 'error'),
|
onError: (err) => toast(friendlyAuthError(err, 'Could not mark all as read.'), 'error'),
|
||||||
|
|
@ -85,33 +82,6 @@ export default function Topbar({ onOpenNav, searchRef }) {
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<DropdownGroup>
|
<DropdownGroup>
|
||||||
<Dropdown
|
|
||||||
panelClassName="dropdown-menu-wide"
|
|
||||||
trigger={({ toggle }) => (
|
|
||||||
<button className="icon-btn" onClick={toggle} title="Messages" aria-label="Messages">
|
|
||||||
<Icon name="message" />
|
|
||||||
{messages.some((m) => m.unread) && <span className="dot dot-blue" />}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="dropdown-head">Messages</div>
|
|
||||||
<div className="dd-scroll">
|
|
||||||
{messages.map((m) => (
|
|
||||||
<div key={m.id ?? m.name} className={`notif-row${m.unread ? ' unread' : ''}`}>
|
|
||||||
<Avatar name={m.name} initials={m.initials} color={m.color} />
|
|
||||||
<div className="notif-body">
|
|
||||||
<div className="notif-title">{m.name}</div>
|
|
||||||
<div className="notif-text">{m.text}</div>
|
|
||||||
<div className="notif-time">{m.time} ago</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="dropdown-foot">
|
|
||||||
<Link to="/inbox">Open inbox</Link>
|
|
||||||
</div>
|
|
||||||
</Dropdown>
|
|
||||||
|
|
||||||
<Dropdown
|
<Dropdown
|
||||||
panelClassName="dropdown-menu-wide"
|
panelClassName="dropdown-menu-wide"
|
||||||
trigger={({ toggle }) => (
|
trigger={({ toggle }) => (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue