Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/src/apps/main/scenes/learn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export const LearnScene = (props: LearnSceneProps) => {
<Grid container className="learn">
{/* Sidebar */}
<Grid item xs={false} md={3} style={{ paddingTop: "1rem" }}>
<Sidebar tree={props.sidebarTree} expanded={props.expanded} />
<Sidebar
tree={props.sidebarTree}
expanded={props.expanded}
selected={props.currentDocument ? props.currentDocument.slug : ""}
/>
</Grid>
{/* Content */}
<Grid item xs>
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/apps/main/scenes/learn/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const useStyles = makeStyles((theme: Theme) =>
export const Sidebar = (props: {
tree: SidebarTreeItem[] | null;
expanded: string[];
selected: string;
}) => {
const classes = useStyles();
const theme = useTheme();
Expand Down Expand Up @@ -98,7 +99,7 @@ export const Sidebar = (props: {

if (md) {
return (
<TreeView expanded={props.expanded}>
<TreeView expanded={props.expanded} selected={props.selected}>
{props.tree
? props.tree.map((tree) => renderTree(tree))
: SidebarSkeleton}
Expand All @@ -117,7 +118,11 @@ export const Sidebar = (props: {
onClick={handleOpen}
/>
<Drawer anchor="bottom" onClose={handleClose} open={open}>
<TreeView expanded={props.expanded} onClick={handleClose}>
<TreeView
expanded={props.expanded}
selected={props.selected}
onClick={handleClose}
>
{props.tree
? props.tree.map((tree) => renderTree(tree))
: SidebarSkeleton}
Expand Down