Skip to content

Commit

Permalink
Merge pull request #573 from captain-Akshay/captain/learningpath
Browse files Browse the repository at this point in the history
feat(components): enchancement
  • Loading branch information
leecalcote authored Apr 18, 2024
2 parents 7983d49 + 6395f08 commit 4c86edf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
18 changes: 14 additions & 4 deletions src/custom/StyledChapter/StyledChapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@ const StyledChapter = styled('div')(({ theme }) => ({
color: 'gray'
},

a: {
'&:hover': {
color: KEPPEL
}
'& a': {
color: KEPPEL
},
'& pre': {
backgroundColor: '#011627',
padding: '1em',
borderRadius: '0.5rem',
overflowX: 'auto',
color: '#d6deeb',
position: 'relative',
textAlign: 'left',
width: '100%',
margin: '1rem auto autocompleteClasses',
fontFamily: 'Courier New, Courier, monospace'
}
}));
export default StyledChapter;
14 changes: 5 additions & 9 deletions src/custom/TOCChapter/TOCChapter.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import React from 'react';
import { TOCWrapper } from './style';

interface TOCDataItem {
chapter: string;
}

interface TOCProps {
availableChapters: TOCDataItem[];
availableChapters: string[];
currentChapter: string | undefined | null;
onClick: (item: string, e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
}
Expand All @@ -24,13 +20,13 @@ const TOC: React.FC<TOCProps> = ({ availableChapters, currentChapter, onClick })
<ul className={`toc-ul toc-ul-open`}>
{availableChapters.map((item) => (
<li
key={item.chapter}
className={item.chapter === currentChapter ? 'active-link' : ''}
key={item}
className={item + '.mdx' === currentChapter ? 'active-link' : ''}
onClick={(e) => {
onClick(item.chapter, e);
onClick(item, e);
}}
>
<p className="toc-item"> {reformatTOC(item.chapter)}</p>
<p className="toc-item"> {reformatTOC(item)}</p>
</li>
))}
</ul>
Expand Down

0 comments on commit 4c86edf

Please sign in to comment.