Skip to content

Commit 8b3ce96

Browse files
committed
feat(Icons): replace sidebar icon with collapse and expand icons for editor pane toggle
1 parent d2ef075 commit 8b3ce96

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

src/components/Icons.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,11 @@ export function Icons() {
330330
fill="#FDC709"
331331
/>
332332
</symbol>
333-
<symbol id="icon-sidebar" viewBox="0 0 24 24">
334-
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 3.5v17M3 9.4c0-2.24 0-3.36.436-4.216a4 4 0 0 1 1.748-1.748C6.04 3 7.16 3 9.4 3h5.2c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C21 6.04 21 7.16 21 9.4v5.2c0 2.24 0 3.36-.436 4.216a4 4 0 0 1-1.748 1.748C17.96 21 16.84 21 14.6 21H9.4c-2.24 0-3.36 0-4.216-.436a4 4 0 0 1-1.748-1.748C3 17.96 3 16.84 3 14.6z"/>
333+
<symbol id="icon-collapse" viewBox="0 0 24 24">
334+
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18m7-6l-3-3l3-3"/></g>
335+
</symbol>
336+
<symbol id="icon-expand" viewBox="0 0 24 24">
337+
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18m5-12l3 3l-3 3"/></g>
335338
</symbol>
336339
</symbol>
337340
</svg>

src/components/MainHeader.jsx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ export function MainHeader(props) {
6262
return (
6363
<div className="main-header text-gray-400 py-2 px-8 flex justify-between border-b border-black-700 bg-black-500">
6464
<div className="flex items-center gap-4">
65+
<button
66+
className="py-1.5 duration-200 font-semibold flex items-center gap-2 rounded-lg"
67+
aria-label="Toggle editor pane"
68+
title={props.isEditorCollapsed ? "Expand editor pane" : "Collapse editor pane"}
69+
onClick={props.onToggleEditorCollapse}
70+
>
71+
<svg
72+
className={`h-8 w-8 transition-transform duration-200 ${
73+
props.currentLayoutMode === 2 ? 'rotate-90' :
74+
props.currentLayoutMode === 3 ? 'rotate-180' :
75+
'rotate-0'
76+
}`}
77+
>
78+
<use xlinkHref={props.isEditorCollapsed ? "#icon-expand" : "#icon-collapse"} />
79+
</svg>
80+
</button>
6581
<DropdownMenu.Root>
6682
<DropdownMenu.Trigger asChild>
6783
<div className="flex items-center p-1 hover:bg-gray-700 data-[state=open]:bg-[#454856] rounded-lg cursor-pointer duration-200">
@@ -137,26 +153,6 @@ export function MainHeader(props) {
137153
</svg>
138154
<span>My library</span>
139155
</button>
140-
<button
141-
className={`px-4 py-1.5 bg-black-600 duration-200 font-semibold flex items-center gap-2 rounded-lg ${
142-
props.isEditorCollapsed
143-
? 'hover:opacity-80'
144-
: 'hover:bg-primary-700 text-white'
145-
}`}
146-
aria-label="Toggle editor pane"
147-
title={props.isEditorCollapsed ? "Expand editor pane" : "Collapse editor pane"}
148-
onClick={props.onToggleEditorCollapse}
149-
>
150-
<svg
151-
className={`h-5 w-5 transition-transform duration-200 ${
152-
props.currentLayoutMode === 2 ? 'rotate-90' :
153-
props.currentLayoutMode === 3 ? 'rotate-180' :
154-
'rotate-0'
155-
}`}
156-
>
157-
<use xlinkHref="#icon-sidebar" />
158-
</svg>
159-
</button>
160156
</div>
161157
<div>
162158
{isEditing ? (

0 commit comments

Comments
 (0)