Skip to content

Commit 39e659d

Browse files
committed
feat: remove conditional rendering for project switcher when only one project exists
1 parent 66c0d17 commit 39e659d

File tree

2 files changed

+43
-38
lines changed

2 files changed

+43
-38
lines changed

packages/ui-vite/src/components/ProjectSwitcher.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ export function ProjectSwitcher({ collapsed }: ProjectSwitcherProps) {
5454
);
5555
}
5656

57-
// In Vite app, always show project switcher if there are multiple projects
58-
const hasMultipleProjects = projects.length > 1;
59-
if (!hasMultipleProjects) {
60-
return null;
61-
}
62-
6357
const handleProjectSelect = (projectId: string) => {
6458
if (projectId === currentProject?.id) {
6559
setOpen(false);

packages/ui-vite/src/components/specs/SpecsFilters.tsx

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
import { Search, Filter, X } from 'lucide-react';
2+
import {
3+
Select,
4+
SelectContent,
5+
SelectItem,
6+
SelectTrigger,
7+
SelectValue,
8+
Input,
9+
} from '@leanspec/ui-components';
210

311
interface SpecsFiltersProps {
412
searchQuery: string;
@@ -40,12 +48,12 @@ export function SpecsFilters({
4048
{/* Search Bar */}
4149
<div className="relative">
4250
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground" />
43-
<input
51+
<Input
4452
type="text"
4553
placeholder="Search by name, title, or tags..."
4654
value={searchQuery}
4755
onChange={(e) => onSearchChange(e.target.value)}
48-
className="w-full pl-10 pr-4 py-2 border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary"
56+
className="w-full pl-10 pr-4 py-2"
4957
/>
5058
</div>
5159

@@ -57,38 +65,41 @@ export function SpecsFilters({
5765
<span className="text-sm font-medium">Filters:</span>
5866
</div>
5967

60-
<select
61-
value={statusFilter}
62-
onChange={(e) => onStatusFilterChange(e.target.value)}
63-
className="px-3 py-1.5 text-sm border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary"
64-
>
65-
<option value="all">All Statuses</option>
66-
{uniqueStatuses.map(status => (
67-
<option key={status} value={status}>{status}</option>
68-
))}
69-
</select>
68+
<Select value={statusFilter} onValueChange={onStatusFilterChange}>
69+
<SelectTrigger className="w-[140px]">
70+
<SelectValue placeholder="All Statuses" />
71+
</SelectTrigger>
72+
<SelectContent>
73+
<SelectItem value="all">All Statuses</SelectItem>
74+
{uniqueStatuses.map(status => (
75+
<SelectItem key={status} value={status}>{status}</SelectItem>
76+
))}
77+
</SelectContent>
78+
</Select>
7079

71-
<select
72-
value={priorityFilter}
73-
onChange={(e) => onPriorityFilterChange(e.target.value)}
74-
className="px-3 py-1.5 text-sm border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary"
75-
>
76-
<option value="all">All Priorities</option>
77-
{uniquePriorities.map(priority => (
78-
<option key={priority} value={priority}>{priority}</option>
79-
))}
80-
</select>
80+
<Select value={priorityFilter} onValueChange={onPriorityFilterChange}>
81+
<SelectTrigger className="w-[140px]">
82+
<SelectValue placeholder="All Priorities" />
83+
</SelectTrigger>
84+
<SelectContent>
85+
<SelectItem value="all">All Priorities</SelectItem>
86+
{uniquePriorities.map(priority => (
87+
<SelectItem key={priority} value={priority}>{priority}</SelectItem>
88+
))}
89+
</SelectContent>
90+
</Select>
8191

82-
<select
83-
value={tagFilter}
84-
onChange={(e) => onTagFilterChange(e.target.value)}
85-
className="px-3 py-1.5 text-sm border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary"
86-
>
87-
<option value="all">All Tags</option>
88-
{uniqueTags.map(tag => (
89-
<option key={tag} value={tag}>{tag}</option>
90-
))}
91-
</select>
92+
<Select value={tagFilter} onValueChange={onTagFilterChange}>
93+
<SelectTrigger className="w-[140px]">
94+
<SelectValue placeholder="All Tags" />
95+
</SelectTrigger>
96+
<SelectContent>
97+
<SelectItem value="all">All Tags</SelectItem>
98+
{uniqueTags.map(tag => (
99+
<SelectItem key={tag} value={tag}>{tag}</SelectItem>
100+
))}
101+
</SelectContent>
102+
</Select>
92103

93104
{hasActiveFilters && (
94105
<button

0 commit comments

Comments
 (0)