Skip to content

Commit 71afa3a

Browse files
committed
fix(sidebar): show icon-sized skeletons in collapsed settings sidebar
1 parent 38c8922 commit 71afa3a

File tree

1 file changed

+23
-15
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-sidebar

1 file changed

+23
-15
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-sidebar/settings-sidebar.tsx

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,29 +206,37 @@ export function SettingsSidebar({
206206
)}
207207
>
208208
{sessionLoading || orgsLoading
209-
? Array.from({ length: 3 }, (_, i) => (
210-
<div key={i} className='flex flex-shrink-0 flex-col'>
211-
<div className='px-[16px] pb-[6px]'>
212-
<Skeleton className='h-[14px] w-[64px] rounded-[4px]' />
209+
? isCollapsed
210+
? Array.from({ length: 7 }, (_, i) => (
211+
<div key={i} className='mx-[2px] flex h-[30px] items-center px-[8px]'>
212+
<Skeleton className='h-[16px] w-[16px] rounded-[4px]' />
213213
</div>
214-
<div className='flex flex-col gap-[2px] px-[8px]'>
215-
{Array.from({ length: i === 0 ? 3 : 2 }, (_, j) => (
216-
<div key={j} className='mx-[2px] flex h-[30px] items-center px-[8px]'>
217-
<Skeleton className='h-[24px] w-full rounded-[4px]' />
218-
</div>
219-
))}
214+
))
215+
: Array.from({ length: 3 }, (_, i) => (
216+
<div key={i} className='flex flex-shrink-0 flex-col'>
217+
<div className='px-[16px] pb-[6px]'>
218+
<Skeleton className='h-[14px] w-[64px] rounded-[4px]' />
219+
</div>
220+
<div className='flex flex-col gap-[2px] px-[8px]'>
221+
{Array.from({ length: i === 0 ? 3 : 2 }, (_, j) => (
222+
<div key={j} className='mx-[2px] flex h-[30px] items-center px-[8px]'>
223+
<Skeleton className='h-[24px] w-full rounded-[4px]' />
224+
</div>
225+
))}
226+
</div>
220227
</div>
221-
</div>
222-
))
228+
))
223229
: sectionConfig.map(({ key, title }) => {
224230
const sectionItems = navigationItems.filter((item) => item.section === key)
225231
if (sectionItems.length === 0) return null
226232

227233
return (
228234
<div key={key} className='flex flex-shrink-0 flex-col'>
229-
<div className='px-[16px] pb-[6px]'>
230-
<div className='font-base text-[var(--text-icon)] text-small'>{title}</div>
231-
</div>
235+
{!isCollapsed && (
236+
<div className='px-[16px] pb-[6px]'>
237+
<div className='font-base text-[var(--text-icon)] text-small'>{title}</div>
238+
</div>
239+
)}
232240
<div className='flex flex-col gap-[2px] px-[8px]'>
233241
{sectionItems.map((item) => {
234242
const Icon = item.icon

0 commit comments

Comments
 (0)