From ec3c6cef9655497b783728aaa1245f1f5b52a3f5 Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Levesque" Date: Mon, 18 Dec 2017 17:47:00 -0500 Subject: [PATCH 01/10] #3155: svg-pencil-note.jsx, add 'SvgPencilNoteIcon' --- src/jsx/import/svg/svg-pencil-note.jsx | 83 ++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/jsx/import/svg/svg-pencil-note.jsx diff --git a/src/jsx/import/svg/svg-pencil-note.jsx b/src/jsx/import/svg/svg-pencil-note.jsx new file mode 100644 index 000000000..90d169f82 --- /dev/null +++ b/src/jsx/import/svg/svg-pencil-note.jsx @@ -0,0 +1,83 @@ +/** + * svg-pencil-note.jsx: append pencil note icon. + * + * @SvgPencilNoteIcon, must be capitalized in order for reactjs to render it as a + * component. Otherwise, the variable is rendered as a dom node. + * + * Note: this script implements jsx (reactjs) syntax. + */ + +import colors from '../general/colors.js'; +import React, { Component } from 'react'; + +class SvgPencilNoteIcon extends Component { + // initial 'state properties' + constructor() { + super(); + this.state = { + body_color: colors['gray-5'], + head_color: colors['gray-6'], + } + this.mouseOverHome = this.mouseOverHome.bind(this); + this.mouseOutHome = this.mouseOutHome.bind(this); + } + // callback for mouseOver svg + mouseOverHome(event) { + this.setState({ body_color: colors['green-3'] }); + } + // callback for mouseOut svg + mouseOutHome(event) { + this.setState({ body_color: colors['gray-5'] }); + } + // triggered when 'state properties' change + render() { + return( + + + + + + + + + + ); + } +} + +// indicate which class can be exported, and instantiated via 'require' +export default SvgPencilNoteIcon; From 057e48c850ec15fc872d05825b207d6839419b60 Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Levesque" Date: Mon, 18 Dec 2017 17:47:25 -0500 Subject: [PATCH 02/10] #3155: headere-menu.jsx, implement 'SvgPencilNoteIcon' --- src/jsx/import/navigation/header-menu.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jsx/import/navigation/header-menu.jsx b/src/jsx/import/navigation/header-menu.jsx index 6b55c8be6..5e63b3358 100644 --- a/src/jsx/import/navigation/header-menu.jsx +++ b/src/jsx/import/navigation/header-menu.jsx @@ -8,6 +8,7 @@ import React, { Component } from 'react'; import SvgHome from '../svg/svg-home.jsx'; import SvgBooksIcon from '../svg/svg-books.jsx'; import SvgUserIcon from '../svg/svg-user.jsx'; +import SvgPencilNoteIcon from '../svg/svg-pencil-note.jsx'; import { Link } from 'react-router-dom' import HomeLink from './menu-items/home.jsx'; import LoginLinkState from '../redux/container/login-link.jsx'; @@ -69,7 +70,10 @@ class HeaderMenu extends Component { - Register + + + Register + From 31df2e2de374bb323130dae3e48bfc6c6aa75c17 Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Levesque" Date: Mon, 18 Dec 2017 19:13:03 -0500 Subject: [PATCH 03/10] #3155: svg-pencil-note.jsx, define 'pencil_color' --- src/jsx/import/svg/svg-pencil-note.jsx | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/jsx/import/svg/svg-pencil-note.jsx b/src/jsx/import/svg/svg-pencil-note.jsx index 90d169f82..2101ffdfe 100644 --- a/src/jsx/import/svg/svg-pencil-note.jsx +++ b/src/jsx/import/svg/svg-pencil-note.jsx @@ -15,19 +15,20 @@ class SvgPencilNoteIcon extends Component { constructor() { super(); this.state = { - body_color: colors['gray-5'], - head_color: colors['gray-6'], + pencil_color: colors['gray-5'], + inner_color: colors['gray-5'], + outer_color: colors['gray-6'], } this.mouseOverHome = this.mouseOverHome.bind(this); this.mouseOutHome = this.mouseOutHome.bind(this); } // callback for mouseOver svg mouseOverHome(event) { - this.setState({ body_color: colors['green-3'] }); + this.setState({ inner_color: colors['green-3'] }); } // callback for mouseOut svg mouseOutHome(event) { - this.setState({ body_color: colors['gray-5'] }); + this.setState({ inner_color: colors['gray-5'] }); } // triggered when 'state properties' change render() { @@ -36,7 +37,7 @@ class SvgPencilNoteIcon extends Component { version='1.1' xmlns='http://www.w3.org/2000/svg' width='45px' - height='45px' + height='28px' x='0px' y='0px' viewBox='0 0 512 512' @@ -47,6 +48,7 @@ class SvgPencilNoteIcon extends Component { > - + ); From c0cf6e420c0a2a423fc0b180c23fce874831cf6d Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Levesque" Date: Mon, 18 Dec 2017 19:15:35 -0500 Subject: [PATCH 04/10] #3155: implement 'header-font-color[-hover]' classes --- src/scss/_navigation.scss | 13 ++++++++++++- src/scss/_variables.scss | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/scss/_navigation.scss b/src/scss/_navigation.scss index 77e8a161a..105b83efc 100644 --- a/src/scss/_navigation.scss +++ b/src/scss/_navigation.scss @@ -31,10 +31,12 @@ .dropdown-menu { a { + color: $header-font-color; background-color: transparent; } a:hover { + color: $header-font-color-hover; text-decoration: none; } } @@ -53,10 +55,16 @@ } .menu-label { + color: $header-font-color; position: relative; + text-decoration: none top: -.55em; } + .menu-label:hover { + color: $header-font-color-hover; + } + #basic-nav-dropdown { color: $gray-1; text-decoration: none; @@ -71,8 +79,11 @@ padding: 0; } .nav-item { + padding-top: $gutter-1 / 4 + a { - padding: 0; + padding-left: 0; + color: $header-font-color; } } diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index 23757e6dc..8babe3e5e 100644 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -36,3 +36,5 @@ $red-1: #800000; $red-2: #86181d; $red-3: #ffdce0; $lcol-width: 16rem; +$header-font-color: #ddd; +$header-font-color-hover: #fff; From 8c5a67bff8342fd2436e20b07a771fe18ca1f670 Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Levesque" Date: Mon, 18 Dec 2017 19:24:47 -0500 Subject: [PATCH 05/10] #3155: _navigation.scss, add missing ';' --- src/scss/_navigation.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/_navigation.scss b/src/scss/_navigation.scss index 105b83efc..42e697cb1 100644 --- a/src/scss/_navigation.scss +++ b/src/scss/_navigation.scss @@ -57,7 +57,7 @@ .menu-label { color: $header-font-color; position: relative; - text-decoration: none + text-decoration: none; top: -.55em; } From db66339f942c3ef7000c3b4888237a79b0b27690 Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Levesque" Date: Mon, 18 Dec 2017 19:40:12 -0500 Subject: [PATCH 06/10] #3155: consistently apply, and remove 'Icon' suffix --- src/jsx/import/navigation/header-menu.jsx | 12 ++++++------ src/jsx/import/navigation/user-menu.jsx | 12 ++++++------ src/jsx/import/svg/svg-books.jsx | 18 +++++++++--------- src/jsx/import/svg/svg-home.jsx | 12 ++++++------ src/jsx/import/svg/svg-pencil-note.jsx | 18 +++++++++--------- src/jsx/import/svg/svg-user.jsx | 18 +++++++++--------- 6 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/jsx/import/navigation/header-menu.jsx b/src/jsx/import/navigation/header-menu.jsx index 5e63b3358..78ddf6869 100644 --- a/src/jsx/import/navigation/header-menu.jsx +++ b/src/jsx/import/navigation/header-menu.jsx @@ -6,9 +6,9 @@ import React, { Component } from 'react'; import SvgHome from '../svg/svg-home.jsx'; -import SvgBooksIcon from '../svg/svg-books.jsx'; -import SvgUserIcon from '../svg/svg-user.jsx'; -import SvgPencilNoteIcon from '../svg/svg-pencil-note.jsx'; +import SvgBooks from '../svg/svg-books.jsx'; +import SvgUser from '../svg/svg-user.jsx'; +import SvgPencilNote from '../svg/svg-pencil-note.jsx'; import { Link } from 'react-router-dom' import HomeLink from './menu-items/home.jsx'; import LoginLinkState from '../redux/container/login-link.jsx'; @@ -30,7 +30,7 @@ class HeaderMenu extends Component { } showMobileHeader() { const session = - + Session return ( @@ -65,13 +65,13 @@ class HeaderMenu extends Component {