@@ -28,6 +28,13 @@ const select = (state) => {
2828 } ;
2929} ;
3030
31+ const svg = (
32+ < svg xmlns = "http://www.w3.org/2000/svg" width = "48" height = "48" viewBox = "0 0 48 48" >
33+ < path d = "M14.83 16.42l9.17 9.17 9.17-9.17 2.83 2.83-12 12-12-12z" />
34+ </ svg >
35+ ) ;
36+
37+
3138export class Page extends React . Component {
3239
3340 static propTypes = {
@@ -36,7 +43,6 @@ export class Page extends React.Component {
3643 tocMeta : React . PropTypes . shape ( {
3744 gradeUnit : React . PropTypes . string ,
3845 subjectLesson : React . PropTypes . string ,
39- lastModified : React . PropTypes . string ,
4046 } ) ,
4147 locale : React . PropTypes . string ,
4248 videoPlay : React . PropTypes . func ,
@@ -288,9 +294,6 @@ export class Page extends React.Component {
288294 }
289295
290296 render ( ) {
291- const lastModified = this . props . tocMeta . lastModified ;
292- const footerText = lastModified ? `CLIx release date: ${ lastModified } ` : undefined ;
293-
294297 let previousButton ;
295298 let nextButton ;
296299 const { tableOfContents, params } = this . props ;
@@ -300,69 +303,96 @@ export class Page extends React.Component {
300303 item => item . id === params . pageId
301304 ) ;
302305
303- if ( currentPageIndex > - 1 && currentPageIndex !== 0 ) {
306+ if ( currentPageIndex > - 1 ) {
304307 // show Previous button
305- previousButton = (
306- < button
307- className = "page-nav-button"
308- onClick = { ( ) => this . props . selectPage ( tableOfContents [ currentPageIndex - 1 ] . id ) }
309- >
310- { this . props . localizedStrings . footer . previous }
311- </ button >
312- ) ;
313- }
308+ previousButton = ( currentPageIndex === 0 )
309+ ? (
310+ < button
311+ className = "c-btn-footer c-btn-footer--prev-page"
312+ disabled
313+ >
314+ { svg }
315+ { this . props . localizedStrings . footer . previous }
316+ </ button >
317+ ) :
318+ (
319+ < button
320+ className = "c-btn-footer c-btn-footer--prev-page"
321+ onClick = { ( ) => this . props . selectPage ( tableOfContents [ currentPageIndex - 1 ] . id ) }
322+ >
323+ { svg }
324+ { this . props . localizedStrings . footer . previous }
325+ </ button >
326+ ) ;
314327
315- if ( currentPageIndex > - 1 && currentPageIndex !== tableOfContents . length - 1 ) {
316328 // show Next button
317- nextButton = (
318- < button
319- className = "page-nav-button"
320- onClick = { ( ) => this . props . selectPage ( tableOfContents [ currentPageIndex + 1 ] . id ) }
321- >
322- { this . props . localizedStrings . footer . next }
323- </ button >
324- ) ;
329+ nextButton = ( currentPageIndex === tableOfContents . length - 1 )
330+ ? (
331+ < button
332+ className = "c-btn-footer c-btn-footer--next-page"
333+ disabled
334+ >
335+ { this . props . localizedStrings . footer . next }
336+ { svg }
337+ </ button >
338+ ) :
339+ (
340+ < button
341+ className = "c-btn-footer c-btn-footer--next-page"
342+ onClick = { ( ) => this . props . selectPage ( tableOfContents [ currentPageIndex + 1 ] . id ) }
343+ >
344+ { this . props . localizedStrings . footer . next }
345+ { svg }
346+ </ button >
347+ ) ;
325348 }
326349 }
327350
328351 let bibliography ;
352+ let drawer ;
329353
330354 if ( this . props . bibliography ) {
331355 bibliography = (
332356 < button
333357 onClick = { this . toggleDrawer }
334- className = "bibliography-btn"
358+ className = "c-btn-footer c-btn-footer--bibliography"
359+ aria-pressed = { this . state . drawerOpen }
360+ aria-expanded = { this . state . drawerOpen }
361+ aria-haspopup
362+ aria-controls = "citationsDrawer"
335363 >
336364 { this . props . localizedStrings . footer . bibliography }
337365 </ button >
338366 ) ;
339- }
340367
341- let drawer ;
342-
343- if ( this . props . bibliography ) {
344368 drawer = (
345- < FocusTrap
346- active = { this . state . activeTrap }
369+ < div
370+ aria-hidden = { ! this . state . drawerOpen }
371+ id = "citationsDrawer"
347372 >
348- < Drawer
349- docked = { false }
350- width = "75%"
351- openSecondary
352- open = { this . state . drawerOpen }
373+ < FocusTrap
374+ active = { this . state . activeTrap }
353375 >
354- < button
355- onClick = { this . toggleDrawer }
356- className = "close-bibliography-btn"
376+ < Drawer
377+ docked = { false }
378+ width = "75%"
379+ openSecondary
380+ open = { this . state . drawerOpen }
357381 >
358- X
359- </ button >
360- < iframe
361- title = "Citations"
362- src = { `${ this . props . contentPath } /${ this . props . bibliography . content } ` }
363- />
364- </ Drawer >
365- </ FocusTrap >
382+ < button
383+ onClick = { this . toggleDrawer }
384+ className = "c-drawer-btn-close"
385+ aria-label = "close drawer"
386+ >
387+ X
388+ </ button >
389+ < iframe
390+ title = "Citations"
391+ src = { `${ this . props . contentPath } /${ this . props . bibliography . content } ` }
392+ />
393+ </ Drawer >
394+ </ FocusTrap >
395+ </ div >
366396 ) ;
367397 }
368398
@@ -372,12 +402,11 @@ export class Page extends React.Component {
372402 < html lang = { this . props . locale } />
373403 </ Helmet >
374404 { this . iframe ( this . props ) }
375- < div className = "c-release " >
405+ < nav className = "c-page-nav " >
376406 { previousButton }
377- < span > { footerText } </ span >
378407 { bibliography }
379408 { nextButton }
380- </ div >
409+ </ nav >
381410 { drawer }
382411 </ section >
383412 ) ;
0 commit comments