Various patch improvements

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-08-01 15:51:12 +02:00
parent 78388e9fe2
commit 46176bd46b
11 changed files with 36 additions and 42 deletions
@@ -7,17 +7,18 @@
export let stats: DiffStats;
const diffDescription = ({ modified, created, deleted }: Diff): string => {
let s = "";
let s = [];
if (modified.length) {
s.push(`${modified.length} file(s) changed`);
}
if (created.length) {
s = s.concat(`${created.length} file(s) created`);
s.push(`${created.length} file(s) created`);
}
if (deleted.length) {
s = s.concat(`, ${deleted.length} file(s) deleted`);
s.push(`${deleted.length} file(s) deleted`);
}
if (modified.length) {
s = s.concat(` and ${modified.length} file(s) changed`);
}
return s;
return s.join(", ");
};
</script>
@@ -35,7 +36,6 @@
.diff-listing {
/* This border forces to keep the FileDiff margin-bottom visible */
border: 1px solid transparent;
margin: 0 1rem;
}
</style>
@@ -127,7 +127,7 @@
}
.file-header .diff-type {
margin-left: 1rem;
padding: 0.25rem 0.5rem;
padding: 0rem 0.5rem;
border-radius: var(--border-radius-medium);
}
</style>