Skip to content

Commit 833a252

Browse files
committed
style: run prettier to fix formatting
Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
1 parent 0670ad1 commit 833a252

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/components/Layout/Sidebar/SidebarLink.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ export function SidebarLink({
132132
onToggle();
133133
}
134134
}}
135-
aria-label={isExpanded ? "Collapse" : "Expand"}
136-
aria-expanded={isExpanded}
137-
>
135+
aria-label={isExpanded ? 'Collapse' : 'Expand'}
136+
aria-expanded={isExpanded}>
138137
<IconNavArrow displayDirection={isExpanded ? 'down' : 'end'} />
139138
</span>
140139
)}

src/components/Layout/Sidebar/SidebarRouteTree.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ function ExpandableSidebarItem({
120120
hideArrow={isForceExpanded}
121121
onToggle={onToggle}
122122
/>
123-
<CollapseWrapper duration={250} isExpanded={isForceExpanded || isExpanded}>
123+
<CollapseWrapper
124+
duration={250}
125+
isExpanded={isForceExpanded || isExpanded}>
124126
<SidebarRouteTree
125127
isForceExpanded={isForceExpanded}
126128
routeTree={{title, routes}}
@@ -142,13 +144,14 @@ export function SidebarRouteTree({
142144
const pendingRoute = usePendingRoute();
143145
const currentRoutes = routeTree.routes as RouteItem[];
144146

145-
const defaultExpandedPath = currentRoutes.find(({path}) => {
146-
const isBreadcrumb =
147-
breadcrumbs.length > 1 &&
148-
breadcrumbs[breadcrumbs.length - 1].path === path;
149-
const selected = slug === path;
150-
return isBreadcrumb || selected;
151-
})?.path || null;
147+
const defaultExpandedPath =
148+
currentRoutes.find(({path}) => {
149+
const isBreadcrumb =
150+
breadcrumbs.length > 1 &&
151+
breadcrumbs[breadcrumbs.length - 1].path === path;
152+
const selected = slug === path;
153+
return isBreadcrumb || selected;
154+
})?.path || null;
152155

153156
const [expandedPath, setExpandedPath] = useState<string | null>(
154157
defaultExpandedPath
@@ -203,7 +206,7 @@ export function SidebarRouteTree({
203206
pendingRoute={pendingRoute}
204207
isExpanded={expandedPath === path}
205208
onToggle={() =>
206-
setExpandedPath(expandedPath === path ? null : (path || null))
209+
setExpandedPath(expandedPath === path ? null : path || null)
207210
}
208211
/>
209212
);

0 commit comments

Comments
 (0)