File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ json.array! items do |item|
5
5
json . path item [ :path ]
6
6
json . icon item [ :icon ]
7
7
json . unread item [ :unread ] if item [ :unread ] &.nonzero?
8
+ json . exact item [ :exact ] . presence
8
9
end
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ const SidebarItem = (props: SidebarItemProps): JSX.Element => {
21
21
const location = useLocation ( ) ;
22
22
const activeUrl = activePath ?? location . pathname + location . search ;
23
23
24
- const isActive = exact
25
- ? activeUrl === item . path
26
- : activeUrl . startsWith ( item . path ) ;
24
+ const isActive =
25
+ exact || item . exact
26
+ ? activeUrl === item . path
27
+ : activeUrl . startsWith ( item . path ) ;
27
28
28
29
const Icon = defensivelyGetIcon ( item . icon , isActive ? 'filled' : 'outlined' ) ;
29
30
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ export interface SidebarItemData {
81
81
path : string ;
82
82
icon : CourseComponentIconName ;
83
83
unread ?: number ;
84
+ exact ?: boolean ;
84
85
}
85
86
86
87
export interface CourseUserProgressData {
You can’t perform that action at this time.
0 commit comments