Skip to content

Commit 634a2b2

Browse files
committed
feat: enhance HomeView to update sidebar tab on button click
This commit modifies the HomeView component to include functionality for setting the sidebar tab when the "Codex" button is clicked. The useNavigationStore is updated to include the setSidebarTab method, improving navigation consistency within the application.
1 parent c95838f commit 634a2b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/views/HomeView.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import { Button } from '@/components/ui/button';
33
import { useNavigationStore } from '@/stores/navigationStore';
44

55
export function HomeView() {
6-
const { setMainView } = useNavigationStore();
6+
const { setMainView, setSidebarTab } = useNavigationStore();
77
return (
88
<div className="m-auto flex flex-col items-center gap-4">
99
<div className="mt-8">
10-
<Button onClick={() => setMainView('codex')}>Codex</Button>
10+
<Button onClick={() => {
11+
setMainView('codex')
12+
setSidebarTab('codex')
13+
}}>Codex</Button>
1114
</div>
1215
<div className="grid grid-cols-3 gap-2">
1316
<Button onClick={() => setMainView('prompt')}>Prompt</Button>

0 commit comments

Comments
 (0)