Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Show branch name when project is at head
Alexis Sellier committed 4 years ago
commit b2949d99100631fac778ba573975d1a21689af74
parent 24aa0d5f806c394385b7d6175644cadfb00d34bb
3 files changed +39 -4
modified public/index.css
@@ -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;
modified src/base/projects/Browser.svelte
@@ -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}
modified src/project.ts
@@ -18,6 +18,7 @@ export interface Info {
export interface Meta {
  name: string;
  description: string;
+
  defaultBranch: string;
  maintainers: Urn[];
}