Skip to content

Commit

Permalink
fix progress bar width and sticky table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Jan 19, 2024
1 parent 13d4b01 commit a0cebbc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
26 changes: 14 additions & 12 deletions src/components/Blog/ContentTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ const ContentTable = ({ content }: { content: ContentfulDocument }) => {
)

return (
<ul className={css.contentTable}>
{headings.map((heading) => {
const headingKey = kebabCase(heading.id)
<aside className={css.contentTable}>
<ul>
{headings.map((heading) => {
const headingKey = kebabCase(heading.id)

return (
<li key={headingKey}>
<a onClick={(e) => handleContentTableClick(e, headingKey)} href={`#${headingKey}`}>
{heading.text}
</a>
</li>
)
})}
</ul>
return (
<li key={headingKey}>
<a onClick={(e) => handleContentTableClick(e, headingKey)} href={`#${headingKey}`}>
{heading.text}
</a>
</li>
)
})}
</ul>
</aside>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Blog/ProgressBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ProgressBar = () => {

return (
<div className={css.progressBar}>
<LinearProgress variant="determinate" color="primary" value={readProgress} />
<LinearProgress variant="determinate" color="primary" value={readProgress} style={{ left: '0' }} />
</div>
)
}
Expand Down
6 changes: 6 additions & 0 deletions src/components/Blog/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.breadcrumbs,
.breadcrumbs a {
color: var(--mui-palette-text-primary);
margin-bottom: 24px;
}

.avatarGroup {
Expand Down Expand Up @@ -59,6 +60,11 @@
}

.contentTable {
position: sticky;
top: calc(var(--header-height) + 24px);
}

.contentTable ul {
list-style: none;
}

Expand Down

0 comments on commit a0cebbc

Please sign in to comment.