Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored and astrobot-houston committed Nov 29, 2022
1 parent 58e78f3 commit fd59296
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions src/components/RightSidebar/TableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ interface Props {
isMobile?: boolean;
}

const TableOfContents: FunctionalComponent<Props> = ({
toc = [],
labels,
isMobile,
}) => {
const TableOfContents: FunctionalComponent<Props> = ({ toc = [], labels, isMobile }) => {
const [currentHeading, setCurrentHeading] = useState({
slug: toc[0].slug,
text: toc[0].text
text: toc[0].text,
});
const [open, setOpen] = useState(!isMobile);
const onThisPageID = 'on-this-page-heading';
Expand Down Expand Up @@ -71,7 +67,7 @@ const TableOfContents: FunctionalComponent<Props> = ({
if (id === onThisPageID) continue;
setCurrentHeading({
slug: entry.target.id,
text: entry.target.textContent || ''
text: entry.target.textContent || '',
});
break;
}
Expand Down Expand Up @@ -99,7 +95,7 @@ const TableOfContents: FunctionalComponent<Props> = ({
setOpen(false);
setCurrentHeading({
slug: e.target.getAttribute('href').replace('#', ''),
text: e.target.textContent || ''
text: e.target.textContent || '',
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const headings = content.astro?.headings;
const t = useTranslations(Astro);
const { previous, next } = await getNavLinks(Astro);
const githubEditUrl = getGithubEditUrl(Astro);
const overview = t('rightSidebar.overview')
const overview = t('rightSidebar.overview');
---

<BaseLayout {...Astro.props}>
Expand Down
2 changes: 1 addition & 1 deletion src/util/generateToc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ export default function generateToc(headings: MarkdownHeading[], title = 'Overvi
}
}
}
return toc
return toc;
}

0 comments on commit fd59296

Please sign in to comment.