Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+25
-4
@@ -1,3 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useParams } from "react-router";
|
||||
import { useAppOrAdminData } from "~/utils/data/useAppOrAdminData";
|
||||
import AddFeedbackButton from "./buttons/AddFeedbackButton";
|
||||
@@ -5,9 +6,10 @@ import ChatSupportButton from "./buttons/ChatSupportButton";
|
||||
import CurrentSubscriptionButton from "./buttons/CurrentSubscriptionButton";
|
||||
import OnboardingButton from "./buttons/OnboardingButton";
|
||||
import ProfileButton from "./buttons/ProfileButton";
|
||||
import QuickActionsButton from "./buttons/QuickActionsButton";
|
||||
import SearchButton from "./buttons/SearchButton";
|
||||
import NotificationsButton from "./buttons/NotificationsButton";
|
||||
import { NotificationsDrawer } from "~/components/screens/notifications/NotificationsDrawer";
|
||||
import { useNotificationsStream } from "~/components/notifications/useNotificationsStream";
|
||||
import { adminPath, appPath } from "~/utils/app/CanonicalUrlUtils";
|
||||
|
||||
export default function NavBar({
|
||||
@@ -24,7 +26,6 @@ export default function NavBar({
|
||||
mySubscription: boolean;
|
||||
feedback: boolean;
|
||||
chatSupport: boolean;
|
||||
quickActions: boolean;
|
||||
search: boolean;
|
||||
notifications: boolean;
|
||||
onboarding: boolean;
|
||||
@@ -38,6 +39,13 @@ export default function NavBar({
|
||||
const params = useParams();
|
||||
const notificationsPath =
|
||||
layout === "admin" ? adminPath("notifications", { mode: "host-aware" }) : params.tenant ? appPath({ tenantSlug: params.tenant, path: "notifications", mode: "host-aware" }) : "/notifications";
|
||||
// AK-P3 (AD-28): tenant-app bell opens the notifications drawer with a live
|
||||
// SSE unseen count; the stream route is tenant-scoped, so the admin layout
|
||||
// keeps the plain link (documented Dev-Nachzug in the ticket doc).
|
||||
const isTenantApp = layout === "app" && Boolean(params.tenant);
|
||||
const streamPath = isTenantApp && params.tenant ? appPath({ tenantSlug: params.tenant, path: "notifications/stream", mode: "host-aware" }) : null;
|
||||
const notificationsStream = useNotificationsStream(streamPath, []);
|
||||
const [notificationsDrawerOpen, setNotificationsDrawerOpen] = useState(false);
|
||||
return (
|
||||
<div className="flex flex-1 justify-between space-x-2">
|
||||
<div className="flex flex-1 items-center">{title && <div className="font-extrabold">{title}</div>}</div>
|
||||
@@ -53,11 +61,24 @@ export default function NavBar({
|
||||
)}
|
||||
{layout === "app" && buttons.mySubscription && <CurrentSubscriptionButton />}
|
||||
{/* <LocaleSelector /> */}
|
||||
{buttons.notifications && appOrAdminData?.user && <NotificationsButton to={notificationsPath} />}
|
||||
{buttons.notifications && appOrAdminData?.user && (
|
||||
<NotificationsButton
|
||||
to={notificationsPath}
|
||||
unseenCount={isTenantApp ? notificationsStream.unreadCount : undefined}
|
||||
onOpen={isTenantApp ? () => setNotificationsDrawerOpen(true) : undefined}
|
||||
/>
|
||||
)}
|
||||
{isTenantApp && (
|
||||
<NotificationsDrawer
|
||||
open={notificationsDrawerOpen}
|
||||
items={notificationsStream.items}
|
||||
allHref={notificationsPath}
|
||||
onClose={() => setNotificationsDrawerOpen(false)}
|
||||
/>
|
||||
)}
|
||||
{buttons.search && <SearchButton onClick={onOpenCommandPalette} />}
|
||||
{layout === "app" && buttons.feedback && <AddFeedbackButton />}
|
||||
{layout === "app" && buttons.chatSupport && <ChatSupportButton />}
|
||||
{layout === "app" && buttons.quickActions && <QuickActionsButton entities={appOrAdminData?.entities?.filter((f) => f.showInSidebar)} />}
|
||||
{/* {(layout === "app" || layout === "admin") && <ThemeSelector variant="secondary" />} */}
|
||||
{(layout === "app" || layout === "admin") && buttons.userProfile && <ProfileButton user={appOrAdminData?.user} layout={layout} />}
|
||||
{children}
|
||||
|
||||
Reference in new issue
Block a user