@@ -63,7 +63,7 @@ class App extends Component<AppProps, AppState> {
6363 }
6464
6565 isCoursePage ( ) {
66- return location . pathname . startsWith ( '/courses ' )
66+ return location . pathname . startsWith ( '/course ' )
6767 }
6868
6969 componentDidMount ( ) {
@@ -172,24 +172,14 @@ class App extends Component<AppProps, AppState> {
172172 id : 'courses1' ,
173173 label : 'Courses1' ,
174174 onClick : ( ) => {
175- this . props . navigate ( '/courses/course1' , { replace : true } )
176- setTimeout ( ( ) => {
177- window . location . reload ( )
178- } , 50 ) // Small delay ensures React updates before reloading
179-
180- // window.location.reload()
175+ this . props . navigate ( '/course1' , { replace : true } )
181176 }
182177 } ,
183178 {
184179 id : 'courses2' ,
185180 label : 'Courses2' ,
186181 onClick : ( ) => {
187- this . props . navigate ( '/courses/course2' , { replace : true } )
188- setTimeout ( ( ) => {
189- window . location . reload ( )
190- } , 50 ) // Small delay ensures React updates before reloading
191-
192- // window.location.reload()
182+ this . props . navigate ( '/course2' , { replace : true } )
193183 }
194184 }
195185 ]
@@ -226,12 +216,16 @@ class App extends Component<AppProps, AppState> {
226216 < SideNavBar . Item
227217 icon = { < IconUserLine /> }
228218 label = "Account"
229- href = "/account"
219+ onClick = { ( ) =>
220+ this . props . navigate ( '/account' , { replace : true } )
221+ }
230222 />
231223 < SideNavBar . Item
232224 icon = { < IconCoursesLine /> }
233225 label = "Courses"
234- href = "/courses"
226+ onClick = { ( ) =>
227+ this . props . navigate ( '/course1' , { replace : true } )
228+ }
235229 />
236230 < SideNavBar . Item
237231 icon = { < IconDashboardLine /> }
@@ -243,7 +237,7 @@ class App extends Component<AppProps, AppState> {
243237 < SideNavBar . Item
244238 icon = { < IconQuestionLine /> }
245239 label = "Help"
246- href = "#"
240+ onClick = { ( ) => alert ( 'Help clicked' ) }
247241 />
248242 </ SideNavBar >
249243 ) }
@@ -254,6 +248,7 @@ class App extends Component<AppProps, AppState> {
254248 < CanvasTopNav
255249 brand = { brandSvg }
256250 lti = { false }
251+ showDesktopView = { this . isCoursePage ( ) }
257252 buttons = { [
258253 {
259254 label : 'AddLine' ,
@@ -269,11 +264,12 @@ class App extends Component<AppProps, AppState> {
269264 breadcrumb = { {
270265 label : 'You are here:' ,
271266 links : [
272- { href : '#' , label : 'Student Forecast ' } ,
273- { href : '#' , label : 'University of Utah ' } ,
274- { label : 'University of Colleges ' }
267+ { href : '#' , label : 'Crumb 1 ' } ,
268+ { href : '#' , label : 'Crumb 2 ' } ,
269+ { label : 'Home ' }
275270 ]
276271 } }
272+ hamburgerLabel = "Open the main menu"
277273 hamburgerOnClick = { ( ) => alert ( 'Hamburger clicked' ) }
278274 mobileButtons = { [
279275 {
@@ -311,8 +307,12 @@ class App extends Component<AppProps, AppState> {
311307 element = { < h1 > This is the account page</ h1 > }
312308 />
313309 < Route
314- path = "/courses"
315- element = { < h1 > This is a course home page</ h1 > }
310+ path = "/course1"
311+ element = { < h1 > This is the first course home page</ h1 > }
312+ />
313+ < Route
314+ path = "/course2"
315+ element = { < h1 > This is the second course home page</ h1 > }
316316 />
317317 </ Routes >
318318 </ div >
0 commit comments