Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 16, 2023
1 parent fb4738a commit 67d1c9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/renderer/src/stories/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,15 @@ export class Main extends LitElement {
if (section) {
if (capsules === true || !("capsules" in page)) {
let pages = Object.values(section.pages);
const pageIds = Object.keys(section.pages)
const pageIds = Object.keys(section.pages);
if (pages.length > 1) {
const capsulesProps = {
n: pages.length,
selected: pages.map((o) => o.pageLabel).indexOf(page.info.label),
};


capsules = new GuidedCapsules(capsulesProps)
capsules.onClick = (i) => this.toRender.page.to(pageIds[i])
capsules = new GuidedCapsules(capsulesProps);
capsules.onClick = (i) => this.toRender.page.to(pageIds[i]);
}
}

Expand Down
10 changes: 7 additions & 3 deletions src/renderer/src/stories/pages/guided-mode/GuidedCapsules.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ export class GuidedCapsules extends LitElement {
return this;
}

onClick = () => {}
onClick = () => {};

render() {
if (!this.n) return html``;

return html`
<div class="guided--capsule-container" >
<div class="guided--capsule-container">
<div class="guided--capsule-container-branch">
${Array.from(
{ length: this.n },
(_, i) => html`<div @click=${() => this.onClick(i)} class="guided--capsule ${i === this.selected ? `active` : ""}"></div>`
(_, i) =>
html`<div
@click=${() => this.onClick(i)}
class="guided--capsule ${i === this.selected ? `active` : ""}"
></div>`
)}
</div>
</div>
Expand Down

0 comments on commit 67d1c9a

Please sign in to comment.