Skip to content

Commit e47ad43

Browse files
committed
Small coderabbit nitpic improvements
1 parent 68d686d commit e47ad43

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ClockIcon,
1010
Cog8ToothIcon,
1111
CogIcon,
12+
ExclamationTriangleIcon,
1213
FolderIcon,
1314
FolderOpenIcon,
1415
GlobeAmericasIcon,
@@ -45,7 +46,6 @@ import { useHasAdminAccess } from "~/hooks/useUser";
4546
import { type UserWithDashboardPreferences } from "~/models/user.server";
4647
import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route";
4748
import { type FeedbackType } from "~/routes/resources.feedback";
48-
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
4949
import { IncidentStatusPanel, useIncidentStatus } from "~/routes/resources.incidents";
5050
import { cn } from "~/utils/cn";
5151
import {
@@ -165,6 +165,8 @@ export function SideMenu({
165165
const isAdmin = useHasAdminAccess();
166166
const { isManagedCloud } = useFeatures();
167167
const featureFlags = useFeatureFlags();
168+
const incidentStatus = useIncidentStatus();
169+
const isV3Project = project.engine === "V1";
168170

169171
const persistSideMenuPreferences = useCallback(
170172
(data: {
@@ -599,8 +601,17 @@ export function SideMenu({
599601
</div>
600602
</div>
601603
<div>
602-
<IncidentStatusPanel isCollapsed={isCollapsed} />
603-
<V3DeprecationPanel isCollapsed={isCollapsed} isV3={project.engine === "V1"} />
604+
<IncidentStatusPanel
605+
isCollapsed={isCollapsed}
606+
title={incidentStatus.title}
607+
hasIncident={incidentStatus.hasIncident}
608+
isManagedCloud={incidentStatus.isManagedCloud}
609+
/>
610+
<V3DeprecationPanel
611+
isCollapsed={isCollapsed}
612+
isV3={isV3Project}
613+
hasIncident={incidentStatus.hasIncident}
614+
/>
604615
<motion.div
605616
layout
606617
transition={{ duration: 0.2, ease: "easeInOut" }}
@@ -625,9 +636,15 @@ export function SideMenu({
625636
);
626637
}
627638

628-
function V3DeprecationPanel({ isCollapsed, isV3 }: { isCollapsed: boolean; isV3: boolean }) {
629-
const { hasIncident } = useIncidentStatus();
630-
639+
function V3DeprecationPanel({
640+
isCollapsed,
641+
isV3,
642+
hasIncident,
643+
}: {
644+
isCollapsed: boolean;
645+
isV3: boolean;
646+
hasIncident: boolean;
647+
}) {
631648
if (!isV3 || hasIncident) {
632649
return null;
633650
}

apps/webapp/app/routes/resources.incidents.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,17 @@ export function useIncidentStatus() {
7070
};
7171
}
7272

73-
export function IncidentStatusPanel({ isCollapsed = false }: { isCollapsed?: boolean }) {
74-
const { title, hasIncident, isManagedCloud } = useIncidentStatus();
75-
73+
export function IncidentStatusPanel({
74+
isCollapsed = false,
75+
title,
76+
hasIncident,
77+
isManagedCloud,
78+
}: {
79+
isCollapsed?: boolean;
80+
title: string | null;
81+
hasIncident: boolean;
82+
isManagedCloud: boolean;
83+
}) {
7684
if (!isManagedCloud || !hasIncident) {
7785
return null;
7886
}

0 commit comments

Comments
 (0)