Skip to content

Commit 51556a3

Browse files
fix styles
1 parent 3b8ca77 commit 51556a3

File tree

2 files changed

+41
-43
lines changed

2 files changed

+41
-43
lines changed

apps/web/src/components/BranchToolbar.tsx

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "./BranchToolbar.logic";
1414
import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector";
1515
import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "./ui/select";
16+
import { Button } from "./ui/button";
1617

1718
const envModeItems = [
1819
{ value: "local", label: "Local" },
@@ -110,54 +111,50 @@ export default function BranchToolbar({
110111

111112
return (
112113
<div className="mx-auto flex w-full max-w-3xl items-center justify-between px-5 pb-3 pt-1">
113-
<div className="flex items-center gap-2">
114-
{envLocked || activeWorktreePath ? (
115-
<span className="inline-flex items-center gap-1.5 border border-transparent px-[calc(--spacing(2)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
116-
{activeWorktreePath ? (
117-
<>
118-
<GitForkIcon className="size-3" />
119-
Worktree
120-
</>
114+
{envLocked || activeWorktreePath ? (
115+
<span className="inline-flex items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
116+
{activeWorktreePath ? (
117+
<>
118+
<GitForkIcon className="size-3" />
119+
Worktree
120+
</>
121+
) : (
122+
<>
123+
<FolderIcon className="size-3" />
124+
Local
125+
</>
126+
)}
127+
</span>
128+
) : (
129+
<Select
130+
value={effectiveEnvMode}
131+
onValueChange={(value) => onEnvModeChange(value as EnvMode)}
132+
items={envModeItems}
133+
>
134+
<SelectTrigger variant="ghost" size="xs" className="font-medium">
135+
{effectiveEnvMode === "worktree" ? (
136+
<GitForkIcon className="size-3" />
121137
) : (
122-
<>
138+
<FolderIcon className="size-3" />
139+
)}
140+
<SelectValue />
141+
</SelectTrigger>
142+
<SelectPopup>
143+
<SelectItem value="local">
144+
<span className="inline-flex items-center gap-1.5">
123145
<FolderIcon className="size-3" />
124146
Local
125-
</>
126-
)}
127-
</span>
128-
) : (
129-
<Select
130-
value={effectiveEnvMode}
131-
onValueChange={(value) => onEnvModeChange(value as EnvMode)}
132-
items={envModeItems}
133-
>
134-
<SelectTrigger variant="ghost" size="sm">
147+
</span>
148+
</SelectItem>
149+
<SelectItem value="worktree">
135150
<span className="inline-flex items-center gap-1.5">
136-
{effectiveEnvMode === "worktree" ? (
137-
<GitForkIcon className="size-3" />
138-
) : (
139-
<FolderIcon className="size-3" />
140-
)}
141-
<SelectValue />
151+
<GitForkIcon className="size-3" />
152+
New worktree
142153
</span>
143-
</SelectTrigger>
144-
<SelectPopup>
145-
<SelectItem value="local">
146-
<span className="inline-flex items-center gap-1.5">
147-
<FolderIcon className="size-3" />
148-
Local
149-
</span>
150-
</SelectItem>
151-
<SelectItem value="worktree">
152-
<span className="inline-flex items-center gap-1.5">
153-
<GitForkIcon className="size-3" />
154-
New worktree
155-
</span>
156-
</SelectItem>
157-
</SelectPopup>
158-
</Select>
159-
)}
160-
</div>
154+
</SelectItem>
155+
</SelectPopup>
156+
</Select>
157+
)}
161158

162159
<BranchToolbarBranchSelector
163160
activeProjectCwd={activeProject.cwd}

apps/web/src/components/ui/select.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const selectTriggerVariants = cva(
2929
default: "min-h-9 px-[calc(--spacing(3)-1px)] sm:min-h-8",
3030
lg: "min-h-10 px-[calc(--spacing(3)-1px)] sm:min-h-9",
3131
sm: "min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:min-h-7",
32+
xs: "h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5",
3233
},
3334
},
3435
},

0 commit comments

Comments
 (0)