Skip to content

Commit

Permalink
fix branch switcher in localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Oct 5, 2024
1 parent c61c84a commit 93d2d63
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions packages/basehub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# basehub

## 7.5.3

### Patch Changes

- Fix branch switcher in localhost

## 7.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/basehub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "basehub",
"description": "A very fast Headless CMS.",
"author": "JB <[email protected]>",
"version": "7.5.2",
"version": "7.5.3",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down
10 changes: 7 additions & 3 deletions packages/basehub/src/next/toolbar/components/branch-swticher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ export const BranchSwitcher = ({
};
}, [apiRref]);

const isDraftActive = isForcedDraft || draft;

return (
<div
className={s.branch}
data-draft-active={isForcedDraft || draft}
data-draft-active={isDraftActive}
onMouseEnter={() => {
setRefetchLatestBranches(true);
}}
Expand All @@ -84,7 +86,9 @@ export const BranchSwitcher = ({
&nbsp;
<Tooltip
content={
!draft ? "Enable draft mode to switch branches" : "Switch branch"
!isDraftActive
? "Enable draft mode to switch branches"
: "Switch branch"
}
>
<select
Expand All @@ -95,7 +99,7 @@ export const BranchSwitcher = ({
onClick={() => {
setRefetchLatestBranches(true);
}}
disabled={!draft}
disabled={!isDraftActive}
>
{refOptions.map((r) => {
return (
Expand Down
7 changes: 7 additions & 0 deletions playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# playground

## 0.0.145

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.144

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playground",
"private": true,
"version": "0.0.144",
"version": "0.0.145",
"scripts": {
"dev": "basehub dev & next dev --port 3003",
"build": "basehub && next build",
Expand Down

0 comments on commit 93d2d63

Please sign in to comment.