Skip to content

Commit 77bd001

Browse files
committed
Improved the preview branch action buttons
1 parent 8dbf504 commit 77bd001

File tree

1 file changed

+22
-13
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches

1 file changed

+22
-13
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export default function Page() {
289289
</TableBlankRow>
290290
) : (
291291
branches.map((branch) => {
292-
const path = v3EnvironmentPath(organization, project, branch);
292+
const path = branchesPath(organization, project, branch);
293293
const cellClass = branch.archivedAt ? "opacity-50" : "";
294294
const isSelected = branch.id === environment.id;
295295

@@ -323,20 +323,29 @@ export default function Page() {
323323
)}
324324
</TableCell>
325325
<TableCellMenu
326+
className="pl-32"
326327
isSticky
327-
hiddenButtons={<PopoverMenuItem to={path} title="View branch" />}
328+
hiddenButtons={
329+
isSelected ? null : (
330+
<PopoverMenuItem to={path} title="Switch to branch" />
331+
)
332+
}
328333
popoverContent={
329-
<>
330-
<PopoverMenuItem
331-
to={path}
332-
icon={ArrowRightIcon}
333-
leadingIconClassName="text-blue-500"
334-
title="View branch"
335-
/>
336-
{!branch.archivedAt ? (
337-
<ArchiveButton environment={branch} />
338-
) : null}
339-
</>
334+
!isSelected || !branch.archivedAt ? (
335+
<>
336+
{isSelected ? null : (
337+
<PopoverMenuItem
338+
to={path}
339+
icon={ArrowRightIcon}
340+
leadingIconClassName="text-blue-500"
341+
title="Switch to branch"
342+
/>
343+
)}
344+
{!branch.archivedAt ? (
345+
<ArchiveButton environment={branch} />
346+
) : null}
347+
</>
348+
) : null
340349
}
341350
/>
342351
</TableRow>

0 commit comments

Comments
 (0)