File tree Expand file tree Collapse file tree 6 files changed +20
-16
lines changed
Expand file tree Collapse file tree 6 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ import { RESTORE_PASSWORD_PAGE } from "../../root/root.constants.js";
1212
1313import "./login.css" ;
1414
15+ import {
16+ HOME_PAGE
17+ } from "../../root/root.constants" ;
18+
1519const authService = AuthService . getInstance ( ) ;
1620
1721class Login extends Component {
@@ -30,7 +34,7 @@ class Login extends Component {
3034 this . setState ( {
3135 loading : false ,
3236 } ) ;
33- history . replace ( "/home" ) ;
37+ history . replace ( HOME_PAGE ) ;
3438 } )
3539 . catch ( ( error ) => {
3640 this . setState ( {
Original file line number Diff line number Diff line change 11import React , { Component } from "react" ;
22import { withTranslation } from "react-i18next" ;
3-
3+ import { withRouter } from "react-router" ;
44import history from "../../../root/root.history" ;
55
66import { resetSearch } from "./../../../helpers/get-data" ;
@@ -24,21 +24,21 @@ class CustomSelect extends Component {
2424 } ;
2525
2626 setSelected = ( option ) => {
27- const currentPath = history . location . pathname ;
27+ const { currentPath} = this . props ;
2828 const newPath = option === "All" ? "home" : option . toLowerCase ( ) ;
2929
3030 if ( `/${ newPath } ` !== currentPath ) {
31- history . replace ( ` /${ newPath } `) ;
31+ history . push ( `# /${ newPath } `) ;
3232 }
3333 resetSearch ( ) ;
3434
3535 this . setState ( { selected : option } ) ;
3636 } ;
3737
38- componentDidMount ( ) {
39- const currentLocation = history . location . pathname . match ( / [ a - z A - Z ] + / g ) [ 0 ] ;
38+ componentDidMount ( ) {
39+ const { currentPath } = this . props ;
4040 this . setState ( {
41- selected : currentLocation === "home" ? "All" : currentLocation ,
41+ selected : currentPath === "home" ? "All" : currentPath ,
4242 } ) ;
4343 }
4444
@@ -73,4 +73,4 @@ class CustomSelect extends Component {
7373 }
7474}
7575
76- export default withTranslation ( "translation" ) ( CustomSelect ) ;
76+ export default withTranslation ( "translation" ) ( withRouter ( CustomSelect ) ) ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class SearchPanel extends Component {
7171 onChange = { this . setSearch }
7272 onFocus = { ( ) => this . setState ( { isFocused : true } ) }
7373 > </ input >
74- < CustomSelect />
74+ < CustomSelect currentPath = "home" />
7575 </ div >
7676 { isAutofill && ! ! value && (
7777 < Autofill
Original file line number Diff line number Diff line change 11import React from "react" ;
22import ReactDOM from "react-dom" ;
3- import { Router } from "react-router-dom" ;
3+ import { Router , HashRouter } from "react-router-dom" ;
44import { renderRoutes } from "react-router-config" ;
55import { I18nextProvider } from "react-i18next" ;
66import i18next from "./helpers/i18n/index" ;
77
8- import history from "./root/root.history" ;
8+ import hashHistory from "./root/root.history" ;
99import routes from "./root/root.routes" ;
1010
1111import * as serviceWorker from "./serviceWorker" ;
@@ -15,7 +15,7 @@ import "./styles/shared.css";
1515
1616ReactDOM . render (
1717 < I18nextProvider i18n = { i18next } >
18- < Router history = { history } > { renderRoutes ( routes ) } </ Router >
18+ < HashRouter basename = "/" history = { hashHistory } > { renderRoutes ( routes ) } </ HashRouter >
1919 </ I18nextProvider > ,
2020 document . getElementById ( "root" )
2121) ;
Original file line number Diff line number Diff line change 1- import { createBrowserHistory } from 'history' ;
1+ import { createHashHistory } from 'history' ;
22
3- const history = createBrowserHistory ( ) ;
4- export default history ;
3+ const history = createHashHistory ( ) ;
4+ export default history ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ const routes = [
9797 path : EDIT_BOARDING_PAGE ,
9898 component : BoardingEditPage ,
9999 exact : true ,
100- } ,
100+ } ,
101101 {
102102 path : NEW_BOARDING_PAGE ,
103103 component : BoardingEditPage ,
You can’t perform that action at this time.
0 commit comments