From 53e86faa9ff9a1e8f6ecbc2a5d9588d34c9aa18e Mon Sep 17 00:00:00 2001 From: Kathleen McMahon Date: Fri, 29 Dec 2017 16:17:00 -0500 Subject: [PATCH] Feature/km/style prev next citation (#20) * styles prev/next buttons, drawer button, moves footnote * styles prev/next buttons, tweaks button text * styles citation button and drawer-close button * adds aria label to drawer, minor linting * update tests; add aria-hidden attribute to drawer --- client/js/components/book/page.jsx | 127 +- client/js/components/book/page.spec.jsx | 25 +- client/js/components/chrome/sidebar.jsx | 4 + client/js/locales/en.js | 6 +- client/js/locales/hi.js | 8 +- client/js/locales/te.js | 8 +- client/package-lock.json | 1584 ++- client/package.json | 4 +- .../components/_components.container.scss | 3 +- .../styles/components/_components.page.scss | 308 +- .../components/_components.side-bar.scss | 23 +- client/styles/themes/_themes.mit.scss | 27 +- client/styles/tools/_tools.mixins.scss | 18 + client/yarn.lock | 10438 ---------------- package-lock.json | 187 + yarn.lock | 145 - 16 files changed, 1550 insertions(+), 11365 deletions(-) delete mode 100644 client/yarn.lock create mode 100644 package-lock.json delete mode 100644 yarn.lock diff --git a/client/js/components/book/page.jsx b/client/js/components/book/page.jsx index a8d48e5..f604a98 100644 --- a/client/js/components/book/page.jsx +++ b/client/js/components/book/page.jsx @@ -28,6 +28,13 @@ const select = (state) => { }; }; +const svg = ( + + + +); + + export class Page extends React.Component { static propTypes = { @@ -36,7 +43,6 @@ export class Page extends React.Component { tocMeta: React.PropTypes.shape({ gradeUnit: React.PropTypes.string, subjectLesson: React.PropTypes.string, - lastModified: React.PropTypes.string, }), locale: React.PropTypes.string, videoPlay: React.PropTypes.func, @@ -288,9 +294,6 @@ export class Page extends React.Component { } render() { - const lastModified = this.props.tocMeta.lastModified; - const footerText = lastModified ? `CLIx release date: ${lastModified}` : undefined; - let previousButton; let nextButton; const { tableOfContents, params } = this.props; @@ -300,69 +303,96 @@ export class Page extends React.Component { item => item.id === params.pageId ); - if (currentPageIndex > -1 && currentPageIndex !== 0) { + if (currentPageIndex > -1) { // show Previous button - previousButton = ( - - ); - } + previousButton = (currentPageIndex === 0) + ? ( + + ) : + ( + + ); - if (currentPageIndex > -1 && currentPageIndex !== tableOfContents.length - 1) { // show Next button - nextButton = ( - - ); + nextButton = (currentPageIndex === tableOfContents.length - 1) + ? ( + + ) : + ( + + ); } } let bibliography; + let drawer; if (this.props.bibliography) { bibliography = ( ); - } - let drawer; - - if (this.props.bibliography) { drawer = ( - - - -