@@ -12,7 +12,6 @@ import { SkeletonText } from "@calcom/ui/components/skeleton";
1212import { Tooltip } from "@calcom/ui/components/tooltip" ;
1313import { ArrowLeftIcon , ArrowRightIcon } from "@coss/ui/icons" ;
1414import Link from "next/link" ;
15- import { usePathname } from "next/navigation" ;
1615import type { User as UserAuth } from "next-auth" ;
1716import { useSession } from "next-auth/react" ;
1817import { KBarTrigger } from "./Kbar" ;
@@ -23,16 +22,14 @@ import { UserDropdown } from "./user-dropdown/UserDropdown";
2322
2423export type SideBarContainerProps = {
2524 bannersHeight : number ;
26- isPlatformUser ?: boolean ;
2725} ;
2826
2927export type SideBarProps = {
3028 bannersHeight : number ;
3129 user ?: UserAuth | null ;
32- isPlatformUser ?: boolean ;
3330} ;
3431
35- export function SideBarContainer ( { bannersHeight, isPlatformUser = false } : SideBarContainerProps ) {
32+ export function SideBarContainer ( { bannersHeight } : SideBarContainerProps ) {
3633 const { status, data } = useSession ( ) ;
3734 const isStandalone = useIsStandalone ( ) ;
3835
@@ -41,13 +38,11 @@ export function SideBarContainer({ bannersHeight, isPlatformUser = false }: Side
4138 // Though when logged out, app store pages would temporarily show SideBar until session status is confirmed.
4239 if ( status !== "loading" && status !== "authenticated" ) return null ;
4340 if ( isStandalone ) return null ;
44- return < SideBar isPlatformUser = { isPlatformUser } bannersHeight = { bannersHeight } user = { data ?. user } /> ;
41+ return < SideBar bannersHeight = { bannersHeight } user = { data ?. user } /> ;
4542}
4643
4744export function SideBar ( { bannersHeight, user } : SideBarProps ) {
4845 const { t, isLocaleReady } = useLocale ( ) ;
49- const pathname = usePathname ( ) ;
50- const isPlatformPages = pathname ?. startsWith ( "/settings/platform" ) ;
5146
5247 const publicPageUrl = `${ WEBAPP_URL } /${ user ?. orgAwareUsername } ` ;
5348
@@ -63,10 +58,10 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
6358 return (
6459 < div className = "relative" >
6560 < aside
66- style = { ! isPlatformPages ? sidebarStylingAttributes : { } }
61+ style = { sidebarStylingAttributes }
6762 className = { classNames (
6863 "fixed left-0 hidden h-full w-14 flex-col overflow-y-auto overflow-x-hidden border-muted border-r bg-cal-muted md:sticky md:flex lg:w-56 lg:px-3" ,
69- ! isPlatformPages && "max-h-screen"
64+ "max-h-screen"
7065 ) } >
7166 < div className = "flex h-full flex-col justify-between py-3 lg:pt-4" >
7267 < header className = "todesktop:-mt-3 todesktop:flex-col-reverse items-center justify-between todesktop:[-webkit-app-region:drag] md:hidden lg:flex" >
@@ -125,47 +120,45 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
125120 < Navigation />
126121 </ div >
127122
128- { ! isPlatformPages && (
129- < div className = "md:px-2 md:pb-4 lg:p-0" >
130- { bottomNavItems . map ( ( item , index ) => (
131- < Tooltip side = "right" content = { t ( item . name ) } className = "lg:hidden" key = { item . name } >
132- < ButtonOrLink
133- id = { item . name }
134- href = { item . href || undefined }
135- aria-label = { t ( item . name ) }
136- target = { item . target }
137- className = { classNames (
138- "text-left" ,
139- "justify-right group flex items-center rounded-md px-2 py-1.5 font-medium text-default text-sm transition [&[aria-current='page']]:bg-emphasis" ,
140- "mt-0.5 w-full text-sm [&[aria-current='page']]:text-emphasis" ,
141- isLocaleReady ? "hover:bg-subtle hover:text-emphasis" : "" ,
142- index === 0 && "mt-3"
143- ) }
144- onClick = { item . onClick } >
145- { ! ! item . icon && (
146- < Icon
147- name = { item . isLoading ? "rotate-cw" : item . icon }
148- className = { classNames (
149- "h-4 w-4 shrink-0 aria-[aria-current='page']:text-inherit" ,
150- "ml-3 md:mx-auto lg:ltr:mr-2 lg:rtl:ml-2" ,
151- item . isLoading && "animate-spin"
152- ) }
153- aria-hidden = "true"
154- />
155- ) }
156- { isLocaleReady ? (
157- < span className = "hidden w-full justify-between lg:flex" >
158- < div className = "flex" > { t ( item . name ) } </ div >
159- </ span >
160- ) : (
161- < SkeletonText className = "h-[20px] w-full" />
162- ) }
163- </ ButtonOrLink >
164- </ Tooltip >
165- ) ) }
166- { ! IS_VISUAL_REGRESSION_TESTING && < Credits /> }
167- </ div >
168- ) }
123+ < div className = "md:px-2 md:pb-4 lg:p-0" >
124+ { bottomNavItems . map ( ( item , index ) => (
125+ < Tooltip side = "right" content = { t ( item . name ) } className = "lg:hidden" key = { item . name } >
126+ < ButtonOrLink
127+ id = { item . name }
128+ href = { item . href || undefined }
129+ aria-label = { t ( item . name ) }
130+ target = { item . target }
131+ className = { classNames (
132+ "text-left" ,
133+ "justify-right group flex items-center rounded-md px-2 py-1.5 font-medium text-default text-sm transition [&[aria-current='page']]:bg-emphasis" ,
134+ "mt-0.5 w-full text-sm [&[aria-current='page']]:text-emphasis" ,
135+ isLocaleReady ? "hover:bg-subtle hover:text-emphasis" : "" ,
136+ index === 0 && "mt-3"
137+ ) }
138+ onClick = { item . onClick } >
139+ { ! ! item . icon && (
140+ < Icon
141+ name = { item . isLoading ? "rotate-cw" : item . icon }
142+ className = { classNames (
143+ "h-4 w-4 shrink-0 aria-[aria-current='page']:text-inherit" ,
144+ "ml-3 md:mx-auto lg:ltr:mr-2 lg:rtl:ml-2" ,
145+ item . isLoading && "animate-spin"
146+ ) }
147+ aria-hidden = "true"
148+ />
149+ ) }
150+ { isLocaleReady ? (
151+ < span className = "hidden w-full justify-between lg:flex" >
152+ < div className = "flex" > { t ( item . name ) } </ div >
153+ </ span >
154+ ) : (
155+ < SkeletonText className = "h-[20px] w-full" />
156+ ) }
157+ </ ButtonOrLink >
158+ </ Tooltip >
159+ ) ) }
160+ { ! IS_VISUAL_REGRESSION_TESTING && < Credits /> }
161+ </ div >
169162 </ aside >
170163 </ div >
171164 ) ;
0 commit comments