@@ -3,11 +3,15 @@ import { Redirect, withRouter, Route, Switch } from "react-router-dom";
33import DocumentTitle from "react-document-title" ;
44import { connect } from "react-redux" ;
55import { CSSTransition , TransitionGroup } from "react-transition-group" ;
6+ import NProgress from "nprogress" ; // progress bar
7+ import "nprogress/nprogress.css" ; // progress bar style
8+
69import { Layout } from "antd" ;
710import { getMenuItemInMenuListByProperty } from "@/utils" ;
811import routeList from "@/config/routeMap" ;
912import menuList from "@/config/menuConfig" ;
1013const { Content } = Layout ;
14+ NProgress . configure ( { showSpinner : false } ) ; // NProgress Configuration
1115
1216const getPageTitle = ( menuList , pathname ) => {
1317 let title = "Ant Design Pro" ;
@@ -29,7 +33,14 @@ const LayoutContent = (props) => {
2933 < DocumentTitle title = { getPageTitle ( menuList , pathname ) } >
3034 < Content style = { { height : "calc(100% - 100px)" } } >
3135 < TransitionGroup >
32- < CSSTransition key = { location . pathname } timeout = { 500 } classNames = "fade" exit = { false } >
36+ < CSSTransition
37+ key = { location . pathname }
38+ timeout = { 500 }
39+ classNames = "fade"
40+ exit = { false }
41+ onEnter = { ( ) => NProgress . start ( ) }
42+ onEntered = { ( ) => NProgress . done ( ) }
43+ >
3344 < Switch location = { location } >
3445 < Redirect exact from = "/" to = "/dashboard" />
3546 { routeList . map ( ( route ) => {
0 commit comments