diff --git a/SAS/TMSS/frontend/tmss_webapp/src/App.js b/SAS/TMSS/frontend/tmss_webapp/src/App.js index 19b52034e062358c8184afeb71088f3c05b89c67..c35c53eb52332208aedc3a128117ee9fadaf1bc0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/App.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/App.js @@ -23,7 +23,7 @@ class App extends Component { layoutMode: 'static', currentMenu: '', currentPath: '/', - currentPageName:'', + PageTitle:'', staticMenuInactive: false, overlayMenuActive: false, mobileMenuActive: false, @@ -32,7 +32,7 @@ class App extends Component { this.onToggleMenu = this.onToggleMenu.bind(this); this.onSidebarClick = this.onSidebarClick.bind(this); this.onMenuItemClick = this.onMenuItemClick.bind(this); - this.setCurrentPageName = this.setCurrentPageName.bind(this); + this.setPageTitle = this.setPageTitle.bind(this); this.menu = [ {label: 'Dashboard', icon: 'pi pi-fw pi-home', to:'/dashboard'}, @@ -90,9 +90,9 @@ class App extends Component { return window.innerWidth > 1024; } - setCurrentPageName(currentPageName) { - if (currentPageName !== this.state.currentPageName) { - this.setState({ currentPageName }) + setPageTitle(PageTitle) { + if (PageTitle !== this.state.PageTitle) { + this.setState({ PageTitle }) } } @@ -116,9 +116,9 @@ class App extends Component { <Router basename={ this.state.currentPath }> <AppMenu model={this.menu} onMenuItemClick={this.onMenuItemClick} /> <div className="layout-main"> - <AppBreadCrumbWithRouter setCurrentPageName={this.setCurrentPageName} /> + <AppBreadCrumbWithRouter setPageTitle={this.setPageTitle} /> {/* Display current pagename */} - <h2>{this.state.currentPageName}</h2> + <h2>{this.state.PageTitle}</h2> <RoutedContent /> </div> </Router> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js index eec54bcbc70e7698dd220580e569bbbcbc597a53..7c966d34bb8190efdab77a9c5211691f48ce2a77 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js @@ -27,13 +27,13 @@ export class AppBreadcrumb extends Component { onRoute() { const { breadcrumbs } = this.state; - const { setCurrentPageName } = this.props; + const { setPageTitle } = this.props; const currentRoute = routes.find(route => matchPath(this.props.location.pathname, {path: route.path, exact: true, strict: true})); //for intial route ,there wont be any route object so it failed if(!currentRoute){ return; } - setCurrentPageName(currentRoute.pageTitle); + setPageTitle(currentRoute.pageTitle); if (!breadcrumbs.length) { this.setState({ breadcrumbs: [{...this.props.location, name: currentRoute.name}] }); return;