Style issue and patch list views

This commit is contained in:
Rūdolfs Ošiņš
2024-09-17 17:32:08 +02:00
parent e103fa21fb
commit 7f567e354a
9 changed files with 211 additions and 71 deletions
+1 -18
View File
@@ -31,24 +31,7 @@
z-index: -1;
background-color: var(--color-background-float);
clip-path: polygon(
0 0,
100% 0,
100% calc(100% - 6px),
calc(100% - 2px) calc(100% - 6px),
calc(100% - 2px) calc(100% - 4px),
calc(100% - 4px) calc(100% - 4px),
calc(100% - 4px) calc(100% - 2px),
calc(100% - 6px) calc(100% - 2px),
calc(100% - 6px) 100%,
6px 100%,
6px calc(100% - 2px),
4px calc(100% - 2px),
4px calc(100% - 4px),
2px calc(100% - 4px),
2px calc(100% - 6px),
0 calc(100% - 6px)
);
clip-path: var(--3px-bottom-corner-fill);
}
.breadcrumbs {
gap: 0.5rem;
+78
View File
@@ -0,0 +1,78 @@
<script lang="ts">
import type { Issue } from "@bindings/Issue";
import { formatOid } from "@app/lib/utils";
import Icon from "./Icon.svelte";
import NodeId from "./NodeId.svelte";
export let issue: Issue;
const statusColor: Record<Issue["state"]["status"], string> = {
open: "var(--color-fill-success)",
closed: "var(--color-foreground-red)",
};
const statusBackgroundColor: Record<Issue["state"]["status"], string> = {
open: "var(--color-fill-diff-green)",
closed: "var(--color-fill-diff-red)",
};
</script>
<style>
.issue-teaser {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.25rem;
height: 5rem;
background-color: var(--color-background-float);
padding: 1rem;
cursor: pointer;
font-size: var(--font-size-regular);
}
.issue-teaser:hover {
background-color: var(--color-fill-float-hover);
}
.status {
padding: 0;
margin-right: 1rem;
}
.issue-teaser:first-of-type {
clip-path: var(--3px-top-corner-fill);
}
.issue-teaser:last-of-type {
clip-path: var(--3px-bottom-corner-fill);
}
.issue-teaser:only-of-type {
clip-path: var(--3px-corner-fill);
}
</style>
<div class="issue-teaser">
<div class="global-flex">
<div
class="global-counter status"
style:color={statusColor[issue.state.status]}
style:background-color={statusBackgroundColor[issue.state.status]}>
<Icon name="issue" />
</div>
<div
class="global-flex"
style:flex-direction="column"
style:align-items="flex-start">
{issue.title}
<div class="global-flex txt-small">
<NodeId
nodeId={issue.author.did.replace("did:key:", "")}
alias={issue.author.alias} />
opened
<div class="global-oid">{formatOid(issue.id)}</div>
</div>
</div>
</div>
<div class="global-flex">
{#each issue.labels as label}
<div class="global-counter txt-small">{label}</div>
{/each}
</div>
</div>
-1
View File
@@ -15,7 +15,6 @@
display: flex;
align-items: center;
gap: 0.375rem;
height: 1rem;
font-weight: var(--font-weight-semibold);
}
.no-alias {
+83
View File
@@ -0,0 +1,83 @@
<script lang="ts">
import type { Patch } from "@bindings/Patch";
import { formatOid } from "@app/lib/utils";
import Icon from "./Icon.svelte";
import NodeId from "./NodeId.svelte";
export let patch: Patch;
const statusColor: Record<Patch["state"]["status"], string> = {
draft: "var(--color-fill-gray)",
open: "var(--color-fill-success)",
archived: "var(--color-foreground-yellow)",
merged: "var(--color-fill-primary)",
};
const statusBackgroundColor: Record<Patch["state"]["status"], string> = {
draft: "var(--color-fill-ghost)",
open: "var(--color-fill-diff-green)",
archived: "var(--color-fill-private)",
merged: "var(--color-fill-delegate)",
};
</script>
<style>
.patch-teaser {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.25rem;
height: 5rem;
background-color: var(--color-background-float);
padding: 1rem;
cursor: pointer;
font-size: var(--font-size-regular);
}
.patch-teaser:hover {
background-color: var(--color-fill-float-hover);
}
.status {
padding: 0;
margin-right: 1rem;
}
.patch-teaser:first-of-type {
clip-path: var(--3px-top-corner-fill);
}
.patch-teaser:last-of-type {
clip-path: var(--3px-bottom-corner-fill);
}
.patch-teaser:only-of-type {
clip-path: var(--3px-corner-fill);
}
</style>
<div class="patch-teaser">
<div class="global-flex">
<div
class="global-counter status"
style:color={statusColor[patch.state.status]}
style:background-color={statusBackgroundColor[patch.state.status]}>
<Icon name="patch" />
</div>
<div
class="global-flex"
style:flex-direction="column"
style:align-items="flex-start">
{patch.title}
<div class="global-flex txt-small">
<NodeId
nodeId={patch.author.did.replace("did:key:", "")}
alias={patch.author.alias} />
opened
<div class="global-oid">{formatOid(patch.id)}</div>
</div>
</div>
</div>
<div class="global-flex">
{#each patch.labels as label}
<div class="global-counter txt-small">{label}</div>
{/each}
</div>
</div>