diff --git a/src/views/projects/BranchSelector.svelte b/src/views/projects/BranchSelector.svelte index d60536fc9..908654a0e 100644 --- a/src/views/projects/BranchSelector.svelte +++ b/src/views/projects/BranchSelector.svelte @@ -12,7 +12,7 @@ export let selectedCommitId: string; export let branches: Array<{ name: string; route: Route }>; - $: showSelector = branches.length > 1; + $: hideDropdown = branches.length <= 1; $: selectedCommitShortId = utils.formatCommit(selectedCommitId); @@ -21,91 +21,64 @@ display: flex; align-items: center; justify-content: center; + line-height: initial; + font-family: var(--font-family-monospace); - } - .commit .branch { - padding: 0.5rem 0.75rem; color: var(--color-secondary); + } + .branch-name { + height: 2rem; + padding: 0.5rem 0.75rem; background-color: var(--color-secondary-2); border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); } - .commit .branch.not-allowed { + .branch-name.not-allowed { cursor: not-allowed; } - .branch:hover:not(.not-allowed) { + .branch-name:hover:not(.not-allowed) { background-color: var(--color-foreground-2); } - .commit .hash { - display: inline-block; + .commit-id { height: 2rem; - line-height: initial; - color: var(--color-secondary); - background-color: var(--color-secondary-1); padding: 0.5rem 0.75rem; + background-color: var(--color-secondary-1); border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; } - .commit .hash.unlabeled { + .commit-id.standalone { border-radius: var(--border-radius-small); } - .stat { - font-family: var(--font-family-monospace); - padding: 0.5rem 0.75rem; - height: 2rem; - line-height: initial; - background: var(--color-foreground-1); - }
- - {#if branches.length > 0} - {#if selectedBranch} - -
- {selectedBranch} -
- - - - closeFocused()}> - - {item.name} - - - - - -
-
- {selectedCommitShortId} + {#if selectedBranch} + +
+ {selectedBranch}
- {:else} -
- {selectedCommitId} -
- {/if} -
- {selectedCommitShortId} -
- - {:else if selectedBranch} -
- {selectedBranch} -
-
+ + closeFocused()}> + + {item.name} + + + + +
{selectedCommitShortId}
{:else} -
+
{selectedCommitId}
-
+
{selectedCommitShortId}
{/if}