From a6e162ec9e1223626ec5169e104d9077b7fc39f5 Mon Sep 17 00:00:00 2001 From: Javi Velasco Date: Sun, 10 Apr 2016 11:38:42 +0200 Subject: [PATCH] Update documentation dependencies --- docs/.eslintrc | 24 ++---- docs/app/components/layout/home/index.jsx | 2 +- .../layout/main/components/navigation.jsx | 78 ++++++++----------- .../layout/main/components/navigation.scss | 4 +- docs/app/components/layout/main/index.jsx | 20 +++-- docs/app/components/markdown/style.scss | 3 +- docs/app/index.jsx | 5 +- docs/package.json | 52 ++++++------- docs/server.js | 14 ++-- docs/webpack.config.development.js | 1 + docs/webpack.config.production.js | 1 + docs/www/index.html | 4 +- package.json | 14 ++-- 13 files changed, 101 insertions(+), 121 deletions(-) diff --git a/docs/.eslintrc b/docs/.eslintrc index 6f9f9cd8..1b11bd11 100644 --- a/docs/.eslintrc +++ b/docs/.eslintrc @@ -32,7 +32,7 @@ "comma-style": [2, "last"], "complexity": [0, 11], "constructor-super": [2], - "consistent-return": [2], + "consistent-return": [0], "consistent-this": [0, "that"], "curly": [2, "multi-line"], "default-case": [2], @@ -44,7 +44,6 @@ "func-names": [0], "func-style": [0, "declaration"], "generator-star-spacing": [2, "after"], - "strict": [2, "always"], "guard-for-in": [0], "handle-callback-err": [0], "key-spacing": [2, { @@ -79,7 +78,6 @@ "no-else-return": [0], "no-empty": [2], "no-empty-character-class": [2], - "no-empty-label": [2], "no-eq-null": [0], "no-eval": [2], "no-ex-assign": [2], @@ -149,7 +147,9 @@ "no-undefined": [0], "no-underscore-dangle": [0], "no-unreachable": [2], - "no-unused-expressions": [2], + "no-unused-expressions": [2, { + "allowShortCircuit": true + }], "no-unused-vars": [1, { "vars": "all", "args": "after-used" @@ -164,23 +164,16 @@ "no-with": [2], "one-var": [0], "operator-assignment": [0, "always"], - "operator-linebreak": [2, "after"], + "operator-linebreak": [2, "before"], "padded-blocks": [0], "prefer-const": [2], "prefer-spread": [2], "quote-props": [0], "radix": [0], "semi": [2], - "semi-spacing": [2, { - "before": false, - "after": true - }], "sort-vars": [0], - "space-after-keywords": [2, "always"], - "space-before-function-paren": [2, { - "anonymous": "always", - "named": "always" - }], + "keyword-spacing": [2, {"after": true}], + "space-before-function-paren": [2, { "anonymous": "always", "named": "always" }], "space-before-blocks": [0, "always"], "space-in-brackets": [0, "never", { "singleValue": true, @@ -192,7 +185,6 @@ }], "space-in-parens": [2, "never"], "space-infix-ops": [2], - "space-return-throw-case": [2], "space-unary-ops": [2, { "words": true, "nonwords": false @@ -218,7 +210,7 @@ "react/jsx-no-duplicate-props": 1, "react/jsx-no-undef": 1, "react/jsx-pascal-case": 1, - "react/jsx-sort-prop-types": 1, + "react/sort-prop-types": 1, "react/jsx-sort-props": 0, "react/jsx-uses-react": 1, "react/jsx-uses-vars": 1, diff --git a/docs/app/components/layout/home/index.jsx b/docs/app/components/layout/home/index.jsx index 8614b117..86b01151 100644 --- a/docs/app/components/layout/home/index.jsx +++ b/docs/app/components/layout/home/index.jsx @@ -81,7 +81,7 @@ const Home = () => ( diff --git a/docs/app/components/layout/main/components/navigation.jsx b/docs/app/components/layout/main/components/navigation.jsx index facb3ff6..8d6a5a24 100644 --- a/docs/app/components/layout/main/components/navigation.jsx +++ b/docs/app/components/layout/main/components/navigation.jsx @@ -1,53 +1,41 @@ -import React from 'react'; -import { History } from 'react-router'; +import React, { PropTypes } from 'react'; import { List, ListItem } from 'react-toolbox'; +import classnames from 'classnames'; import components from '../modules/components'; import style from './navigation.scss'; -const MainNavigation = React.createClass({ - propTypes: { - active: React.PropTypes.bool, - className: React.PropTypes.string - }, - - mixins: [History], - - renderDrawerItems () { - return Object.keys(components).map((key) => { - const ToolboxComponent = components[key]; - const to = this.context.history.createHref(ToolboxComponent.path); - let className = style.item; - if (this.context.history.isActive(ToolboxComponent.path)) { - className += ` ${style.active}`; - } - - return ( - - ); - }); - }, - - render () { - let className = style.root; - if (this.props.className) className += ` ${this.props.className}`; - +const MainNavigation = ({ className }, { router }) => { + const drawerItems = Object.keys(components).map((key) => { + const isActive = router.isActive(components[key].path); return ( - + { router.push(components[key].path);}} + /> ); - } -}); + }); + + return ( + + ); +}; + +MainNavigation.propTypes = { + className: PropTypes.string +}; + +MainNavigation.contextTypes = { + router: PropTypes.object +}; export default MainNavigation; diff --git a/docs/app/components/layout/main/components/navigation.scss b/docs/app/components/layout/main/components/navigation.scss index 53931234..37203cc2 100644 --- a/docs/app/components/layout/main/components/navigation.scss +++ b/docs/app/components/layout/main/components/navigation.scss @@ -14,10 +14,10 @@ } .item { - a > span{ + > span{ padding: $navigation-v-padding $navigation-h-padding; } - > span > span { + [data-react-toolbox="list-item-text"] { font-size: $font-size-small; font-weight: $font-weight-semi-bold; } diff --git a/docs/app/components/layout/main/index.jsx b/docs/app/components/layout/main/index.jsx index 84e40e5d..66d9b2fb 100644 --- a/docs/app/components/layout/main/index.jsx +++ b/docs/app/components/layout/main/index.jsx @@ -9,17 +9,15 @@ import BaseDocs from './modules/components.md'; import components from './modules/components.js'; import style from './style'; -const LoadExampleButton = (props) => { - return ( -