@@ -16,6 +16,7 @@ import {
16
16
RectangleStackIcon ,
17
17
ServerStackIcon ,
18
18
Squares2X2Icon ,
19
+ UsersIcon ,
19
20
} from "@heroicons/react/20/solid" ;
20
21
import { useNavigation } from "@remix-run/react" ;
21
22
import { useEffect , useRef , useState , type ReactNode } from "react" ;
@@ -27,6 +28,7 @@ import { Avatar } from "~/components/primitives/Avatar";
27
28
import { type MatchedEnvironment } from "~/hooks/useEnvironment" ;
28
29
import { type MatchedOrganization } from "~/hooks/useOrganizations" ;
29
30
import { type MatchedProject } from "~/hooks/useProject" ;
31
+ import { useHasAdminAccess } from "~/hooks/useUser" ;
30
32
import { type User } from "~/models/user.server" ;
31
33
import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route" ;
32
34
import { type FeedbackType } from "~/routes/resources.feedback" ;
@@ -77,7 +79,6 @@ import { HelpAndFeedback } from "./HelpAndFeedbackPopover";
77
79
import { SideMenuHeader } from "./SideMenuHeader" ;
78
80
import { SideMenuItem } from "./SideMenuItem" ;
79
81
import { SideMenuSection } from "./SideMenuSection" ;
80
- import { useHasAdminAccess } from "~/hooks/useUser" ;
81
82
82
83
type SideMenuUser = Pick < User , "email" | "admin" > & { isImpersonating : boolean } ;
83
84
export type SideMenuProject = Pick <
@@ -133,8 +134,7 @@ export function SideMenu({
133
134
< div
134
135
className = { cn (
135
136
"flex items-center justify-between overflow-hidden border-b px-1 py-1 transition duration-300" ,
136
- showHeaderDivider ? "border-grid-bright" : "border-transparent" ,
137
- user . isImpersonating && "rounded-md border border-dashed border-amber-400"
137
+ showHeaderDivider ? "border-grid-bright" : "border-transparent"
138
138
) }
139
139
>
140
140
< ProjectSelector
@@ -143,23 +143,20 @@ export function SideMenu({
143
143
project = { project }
144
144
user = { user }
145
145
/>
146
- { isAdmin && (
146
+ { isAdmin && ! user . isImpersonating ? (
147
147
< TooltipProvider disableHoverableContent = { true } >
148
148
< Tooltip >
149
149
< TooltipTrigger >
150
- < LinkButton
151
- variant = "minimal/medium"
152
- to = { adminPath ( ) }
153
- TrailingIcon = { Cog8ToothIcon }
154
- />
150
+ < LinkButton variant = "minimal/medium" to = { adminPath ( ) } TrailingIcon = { UsersIcon } />
155
151
</ TooltipTrigger >
156
152
< TooltipContent side = "bottom" className = { "text-xs" } >
157
153
Admin dashboard
158
154
</ TooltipContent >
159
155
</ Tooltip >
160
156
</ TooltipProvider >
161
- ) }
162
- { user . isImpersonating && < ImpersonationBanner /> }
157
+ ) : isAdmin && user . isImpersonating ? (
158
+ < ImpersonationBanner />
159
+ ) : null }
163
160
</ div >
164
161
< div
165
162
className = "overflow-hidden overflow-y-auto pt-2 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600"
0 commit comments