mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
feat(frontend): add home and compact add button to repo quick switch sheet
This commit is contained in:
1 parent
d59ba90b66
commit
c3802aa021
1 file changed
+16
-2
@@ -7,7 +7,7 @@ import { Button } from '@/components/ui/button'
|
||||
import { cn, getRepoDisplayName } from '@/lib/utils'
|
||||
import { listRepos } from '@/api/repos'
|
||||
import { AddRepoDialog } from '@/components/repo/AddRepoDialog'
|
||||
import { FolderGit2, Check, Plus } from 'lucide-react'
|
||||
import { FolderGit2, Check, Plus, House } from 'lucide-react'
|
||||
import { isAssistantPath, getAssistantPath } from '@/lib/navigation'
|
||||
|
||||
interface RepoQuickSwitchSheetProps {
|
||||
@@ -75,6 +75,10 @@ export function RepoQuickSwitchSheet({ isOpen, onClose }: RepoQuickSwitchSheetPr
|
||||
navigateAndClose(`/repos/${id}`, { replace: true })
|
||||
}
|
||||
|
||||
const handleHomeClick = () => {
|
||||
navigateAndClose('/')
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<BottomSheet isOpen={isOpen} onClose={onClose} heightClass="h-[70dvh]" ariaLabel="Switch repo">
|
||||
@@ -90,6 +94,15 @@ export function RepoQuickSwitchSheet({ isOpen, onClose }: RepoQuickSwitchSheetPr
|
||||
autoComplete="off"
|
||||
name="repo-quick-switch"
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
size="icon-sm"
|
||||
variant="outline"
|
||||
onClick={handleHomeClick}
|
||||
>
|
||||
<House className="h-4 w-4" />
|
||||
<span className="sr-only">Home</span>
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
@@ -99,7 +112,8 @@ export function RepoQuickSwitchSheet({ isOpen, onClose }: RepoQuickSwitchSheetPr
|
||||
}}
|
||||
className="flex-shrink-0"
|
||||
>
|
||||
<Plus className="h-4 w-4" /> Repo
|
||||
<Plus className="h-4 w-4" />
|
||||
<span className="hidden sm:inline">Repo</span>
|
||||
<span className="sr-only">Add repository</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user