Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hide-branch-tag-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@zpress/ui': patch
---

Hide branch tag badge on `master` in addition to `main` so repos using either default branch name don't show the tag in production.
6 changes: 3 additions & 3 deletions packages/ui/src/theme/components/nav/branch-tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ declare const __ZPRESS_GIT_BRANCH__: string | undefined

/**
* Git branch tag — pill-shaped badge rendered via the `beforeNavMenu`
* layout slot. Hidden when on `main` (production).
* layout slot. Hidden when on default branches (`main` or `master`).
* Uses the pixelarticons:git-branch icon.
*
* @returns React element or null when on main branch
* @returns React element or null when on a default branch
*/
export function BranchTag(): React.ReactElement | null {
const branch = resolveBranch()

if (!branch || branch === 'main') {
if (!branch || branch === 'main' || branch === 'master') {
return null
}

Expand Down
Loading