Skip to content

Commit e6d719a

Browse files
committed
refactor(navigation): simplify navigation panel layout and styling
- Flatten navigation buttons structure in NavigationPanel - Update CSS to improve horizontal scrolling and button layout - Add title attribute to navigation buttons for better accessibility
1 parent 2d91437 commit e6d719a

3 files changed

Lines changed: 50 additions & 80 deletions

File tree

resources/icons/grid-view.svg

Lines changed: 1 addition & 1 deletion
Loading

resources/style/outliner.scss

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -215,51 +215,24 @@
215215
}
216216

217217
.navigation-buttons {
218-
// display: flex;
219-
// flex-wrap: wrap;
220-
padding: 0.2rem;
221-
222-
.navigation-buttons-raw {
223-
display: flex;
224-
225-
.navigation-button {
226-
// flex: 1;
227-
228-
display: inline-block;
229-
flex-direction: column;
230-
background-color: var(--background-color);
231-
border-radius: 10px;
232-
width: 100%;
233-
min-width: 50px;
234-
cursor: pointer;
235-
// max-width: 120px;
236-
237-
margin: 0.2rem;
238-
239-
&:hover {
240-
background-color: var(--text-color-alt);
241-
}
242-
243-
.navigation-button__icon {
244-
.custom-icon {
245-
width: 1.4rem;
246-
height: 1.4rem;
247-
}
248-
}
249-
250-
.navigation-button__label {
251-
}
252-
}
253-
}
218+
display: flex;
219+
overflow-x: auto; /* Allows horizontal scrolling if needed */
220+
white-space: nowrap; /* Prevents text wrapping */
221+
}
254222

255-
.navigation-button--checked {
256-
box-shadow: inset 0 0 0 2px var(--accent-color);
257-
background-color: none;
223+
.navigation-button {
224+
// flex: 0 0 auto; /* Prevents buttons from shrinking */
225+
width: 100%; /* Square width */
226+
// height: 100%; /* Square height */
227+
display: flex;
228+
align-items: center;
229+
justify-content: center;
230+
margin: 2px;
231+
transition: border-color 0.3s;
232+
border-radius: 10px;
233+
}
258234

259-
.navigation-button__icon {
260-
.custom-icon {
261-
color: var(--accent-color);
262-
}
263-
}
264-
}
235+
.navigation-button--checked {
236+
background-color: var(--background-color);
237+
border-radius: 10px;
265238
}

src/frontend/containers/Outliner/NavigationPanel/index.tsx

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const NavigationButton = ({
2222
checked,
2323
}: NavigationButtonProps) => (
2424
<button
25+
title={text}
2526
className={'navigation-button' + (checked ? ' navigation-button--checked' : '')}
2627
tabIndex={-1}
2728
aria-checked={checked}
@@ -39,40 +40,36 @@ const TagsPanel = observer((props: Partial<MultiSplitPaneProps>) => {
3940

4041
return (
4142
<div className="navigation-buttons">
42-
<div className="navigation-buttons-raw">
43-
<NavigationButton
44-
icon={IconSet.VIEW_LIST}
45-
onClick={uiStore.setMethodList}
46-
checked={uiStore.isList}
47-
text="List"
48-
/>
49-
<NavigationButton
50-
icon={IconSet.VIEW_GRID}
51-
onClick={uiStore.setMethodMasonry}
52-
checked={uiStore.isMasonry}
53-
text="Grid"
54-
/>
55-
</div>
56-
<div className="navigation-buttons-raw">
57-
<NavigationButton
58-
icon={IconSet.FACE_SMILING}
59-
onClick={uiStore.setMethodFaces}
60-
checked={uiStore.isFaces}
61-
text="Faces"
62-
/>
63-
<NavigationButton
64-
icon={IconSet.WORLD}
65-
onClick={uiStore.setMethodMap}
66-
checked={uiStore.isMap}
67-
text="Map"
68-
/>
69-
<NavigationButton
70-
icon={IconSet.FILTER_DATE}
71-
onClick={uiStore.setMethodCalendar}
72-
checked={uiStore.isCalendar}
73-
text="Calendar"
74-
/>
75-
</div>
43+
<NavigationButton
44+
icon={IconSet.VIEW_LIST}
45+
onClick={uiStore.setMethodList}
46+
checked={uiStore.isList}
47+
text="List"
48+
/>
49+
<NavigationButton
50+
icon={IconSet.VIEW_GRID}
51+
onClick={uiStore.setMethodMasonry}
52+
checked={uiStore.isMasonry}
53+
text="Grid"
54+
/>
55+
<NavigationButton
56+
icon={IconSet.FACE_SMILING}
57+
onClick={uiStore.setMethodFaces}
58+
checked={uiStore.isFaces}
59+
text="Faces"
60+
/>
61+
<NavigationButton
62+
icon={IconSet.WORLD}
63+
onClick={uiStore.setMethodMap}
64+
checked={uiStore.isMap}
65+
text="Map"
66+
/>
67+
<NavigationButton
68+
icon={IconSet.FILTER_DATE}
69+
onClick={uiStore.setMethodCalendar}
70+
checked={uiStore.isCalendar}
71+
text="Calendar"
72+
/>
7673
</div>
7774
);
7875
});

0 commit comments

Comments
 (0)