Skip to content

Commit 98b046e

Browse files
committed
Cleanup
1 parent 33cec91 commit 98b046e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

apps/array/src/renderer/components/HeaderRow.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ const COLLAPSED_WIDTH = 110;
1313
export function HeaderRow() {
1414
const content = useHeaderStore((state) => state.content);
1515
const view = useNavigationStore((state) => state.view);
16+
1617
const sidebarOpen = useSidebarStore((state) => state.open);
1718
const sidebarWidth = useSidebarStore((state) => state.width);
1819
const isResizing = useSidebarStore((state) => state.isResizing);
1920
const setIsResizing = useSidebarStore((state) => state.setIsResizing);
21+
2022
const rightSidebarOpen = useRightSidebarStore((state) => state.open);
2123
const rightSidebarWidth = useRightSidebarStore((state) => state.width);
2224
const rightSidebarIsResizing = useRightSidebarStore(
@@ -28,14 +30,14 @@ export function HeaderRow() {
2830

2931
const showRightSidebarSection = view.type === "task-detail";
3032

31-
const handleLeftMouseDown = (e: React.MouseEvent) => {
33+
const handleLeftSidebarMouseDown = (e: React.MouseEvent) => {
3234
e.preventDefault();
3335
setIsResizing(true);
3436
document.body.style.cursor = "col-resize";
3537
document.body.style.userSelect = "none";
3638
};
3739

38-
const handleRightMouseDown = (e: React.MouseEvent) => {
40+
const handleRightSidebarMouseDown = (e: React.MouseEvent) => {
3941
e.preventDefault();
4042
setRightSidebarIsResizing(true);
4143
document.body.style.cursor = "col-resize";
@@ -69,7 +71,7 @@ export function HeaderRow() {
6971
<SidebarTrigger />
7072
{sidebarOpen && (
7173
<Box
72-
onMouseDown={handleLeftMouseDown}
74+
onMouseDown={handleLeftSidebarMouseDown}
7375
className="no-drag"
7476
style={{
7577
position: "absolute",
@@ -122,7 +124,7 @@ export function HeaderRow() {
122124
)}
123125
{rightSidebarOpen && (
124126
<Box
125-
onMouseDown={handleRightMouseDown}
127+
onMouseDown={handleRightSidebarMouseDown}
126128
className="no-drag"
127129
style={{
128130
position: "absolute",

apps/array/src/renderer/components/MainLayout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export function MainLayout() {
3232
goForward,
3333
} = useNavigationStore();
3434
const clearAllLayouts = usePanelLayoutStore((state) => state.clearAllLayouts);
35-
const toggleLeftSidebar = useSidebarStore((state) => state.setOpen);
36-
const leftSidebarOpen = useSidebarStore((state) => state.open);
35+
const toggleLeftSidebar = useSidebarStore((state) => state.toggle);
3736
const toggleRightSidebar = useRightSidebarStore((state) => state.toggle);
3837
useIntegrations();
3938
const [commandMenuOpen, setCommandMenuOpen] = useState(false);
@@ -64,7 +63,7 @@ export function MainLayout() {
6463
useHotkeys("mod+,", () => handleOpenSettings());
6564
useHotkeys("mod+[", () => goBack());
6665
useHotkeys("mod+]", () => goForward());
67-
useHotkeys("mod+b", () => toggleLeftSidebar(!leftSidebarOpen));
66+
useHotkeys("mod+b", () => toggleLeftSidebar());
6867
useHotkeys("mod+shift+b", () => toggleRightSidebar());
6968

7069
useEffect(() => {

0 commit comments

Comments
 (0)