diff --git a/.all-contributorsrc b/.all-contributorsrc index f22966f..4e9ff79 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7,7 +7,7 @@ "imageSize": 100, "commit": true, "contributors": [ - { + { "login": "ritz078", "name": "Ritesh Kumar", "avatar_url": "https://avatars3.githubusercontent.com/u/5389035?v=4", @@ -73,6 +73,15 @@ "contributions": [ "code" ] + }, + { + "login": "gyandeeps", + "name": "Gyandeep Singh", + "avatar_url": "https://avatars2.githubusercontent.com/u/5554486?v=4", + "profile": "https://gyandeeps.com", + "contributions": [ + "code" + ] } ] } diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/components/Layout.js b/components/Layout.js index 3900ecd..7aa90ab 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -7,7 +7,6 @@ import Router from "next/router"; import GithubCorner from "react-github-corner"; import FuzzyPicker, { FuzzyWrapper } from "react-fuzzy-picker"; import Collapse, { Panel } from "rc-collapse"; -import flatten from "lodash/flatten"; import findIndex from "lodash/findIndex"; import { categorizedRoutes, routes, activeRouteData } from "../utils/routes"; @@ -89,6 +88,10 @@ export default class Layout extends PureComponent { this.setKey(this.props.pathname); } + componentDidMount () { + routes.forEach(({path}) => Router.prefetch(path)) + } + componentWillReceiveProps({ pathname }) { this.setKey(pathname); } @@ -128,6 +131,19 @@ export default class Layout extends PureComponent { href="https://cdnjs.cloudflare.com/ajax/libs/font-mfizz/2.4.1/font-mfizz.min.css" /> + + + + + + + + + + + + +