Skip to content

Commit

Permalink
refactor(modal): adjust display for modal editing summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Oct 4, 2024
1 parent 810d1a3 commit 9364e7d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/settings/modals/list_changed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ListChangedFiles extends Modal {

displayListOfFile(toDisplay: string[], contentEl: HTMLElement) {
if (!toDisplay.length) return;
const ul = contentEl.createEl("ul");
const ul = contentEl.createEl("ul", {cls: "list"});
toDisplay.forEach((file) => {
let emoji = "❓";
const ext = file.split(".").pop() ?? "";
Expand Down Expand Up @@ -61,33 +61,33 @@ export class ListChangedFiles extends Modal {
text: `🗑️ ${i18next.t("modals.listChangedFiles.deleted")}`,
});
this.displayListOfFile(this.listChanged.deleted, contentEl);

contentEl.createEl("h2", {

const span = contentEl.createDiv({cls: "error"});
span.createEl("h2", {
text: `❌ ${i18next.t("modals.listChangedFiles.error")}`,
cls: "error",
});
contentEl.createEl("h3", {
span.createEl("h3", {
text: `📤 ${i18next.t("modals.listChangedFiles.unpublished")}`,
});
this.displayListOfFile(this.listChanged.unpublished, contentEl);
contentEl.createEl("h3", {
this.displayListOfFile(this.listChanged.unpublished, span);
span.createEl("h3", {
text: `♻️ ${i18next.t("modals.listChangedFiles.notDeleted")}`,
});
this.displayListOfFile(this.listChanged.notDeleted, contentEl);
this.displayListOfFile(this.listChanged.notDeleted, span);
} else {
this.listChanged = this.listChanged as Deleted;
contentEl.createEl("h3", {
text: `🗑️ ${i18next.t("modals.listChangedFiles.deleted")}`,
});
this.displayListOfFile(this.listChanged.deleted, contentEl);
contentEl.createEl("h3", {
const span = contentEl.createSpan({cls: "error"});
span.createEl("h3", {
text: `❌ ${i18next.t("modals.listChangedFiles.error")}`,
cls: "error",
});
contentEl.createEl("h3", {
span.createEl("h3", {
text: `♻️ ${i18next.t("modals.listChangedFiles.notDeleted")}`,
});
this.displayListOfFile(this.listChanged.undeleted, contentEl);
this.displayListOfFile(this.listChanged.undeleted, span);
}
}

Expand Down
21 changes: 19 additions & 2 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,26 @@ span.enveloppe.icons {
color: var(--color-green);
}

.enveloppe.list-changed h2.error {
.enveloppe.list-changed .error {
color: var(--text-error);
padding: 10px 10px;
border-radius: 5px;
background-color: rgba(var(--color-red-rgb), 0.1);
box-shadow: none;
margin-top: 3px;
padding-bottom: 10px;
}

.enveloppe.list-changed .error h3 {
margin-left: 1em;
}

.enveloppe.list-changed .error .list {
margin-left: 1em;
}

.enveloppe.list-changed .error h2 {
padding-top: 10px;
margin-left: 3px;
}

.enveloppe.list-changed .emoji {
Expand Down

0 comments on commit 9364e7d

Please sign in to comment.