Show branch name when project is at head

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2021-10-29 11:04:56 +02:00
parent 24aa0d5f80
commit b2949d9910
3 changed files with 39 additions and 4 deletions
+2
View File
@@ -16,7 +16,9 @@
--color-primary-background-lighter: #ff55ff22;
--color-secondary: #5555ff;
--color-secondary-background: #5555ff11;
--color-secondary-background-darker: #5555ff09;
--color-secondary-faded: #5555ff77;
--color-secondary-darker: #4343cc;
--color-secondary-1: #212847;
--color-secondary-2: #2c326d;
--color-secondary-6: #e3e3ff;
+36 -4
View File
@@ -104,11 +104,32 @@
}
.commit {
display: inline-block;
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-family-monospace);
}
.commit .branch {
padding: 0.5rem 0.75rem;
color: var(--color-secondary);
background-color: var(--color-secondary-background);
border-radius: inherit;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.commit .hash {
display: inline-block;
color: var(--color-secondary);
background-color: var(--color-secondary-background);
padding: 0.5rem 0.75rem;
border-radius: inherit;
}
.branch + .hash {
color: var(--color-secondary-darker);
background-color: var(--color-secondary-background-darker);
border-radius: inherit;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.anchor {
@@ -117,7 +138,7 @@
.anchor-widget {
display: flex;
padding: 0.5rem 0.75rem;
border-radius: 0.25rem;
border-radius: inherit;
color: var(--color-tertiary);
background-color: var(--color-tertiary-background);
cursor: pointer;
@@ -142,7 +163,7 @@
.seed {
cursor: pointer;
border-radius: 0.25rem;
border-radius: inherit;
}
.seed:hover {
background-color: var(--color-foreground-background-lighter);
@@ -261,7 +282,18 @@
{:then tree}
<header>
<div class="commit">
{commit}
{#if commit === project.head}
<div class="branch">
{project.meta.defaultBranch}
</div>
<div class="hash">
{commit.slice(0, 7)}
</div>
{:else}
<div class="hash">
{commit}
</div>
{/if}
</div>
<div class="anchor">
{#if anchors}
+1
View File
@@ -18,6 +18,7 @@ export interface Info {
export interface Meta {
name: string;
description: string;
defaultBranch: string;
maintainers: Urn[];
}