chg url / redirect /search

This commit is contained in:
monoid 2021-01-09 23:38:27 +09:00
parent a72225aff7
commit f14ee322e3

View File

@ -1,6 +1,6 @@
import React, { createContext, useRef, useState } from 'react'; import React, { createContext, useRef, useState } from 'react';
import ReactDom from 'react-dom'; import ReactDom from 'react-dom';
import {BrowserRouter, Route, Switch as RouterSwitch} from 'react-router-dom'; import {BrowserRouter, Redirect, Route, Switch as RouterSwitch} from 'react-router-dom';
import { Gallery, ContentAbout, LoginPage, NotFoundPage} from './page/mod'; import { Gallery, ContentAbout, LoginPage, NotFoundPage} from './page/mod';
import {UserContext} from './state'; import {UserContext} from './state';
@ -18,7 +18,7 @@ const App = () => {
setPermission:setUserPermission}}> setPermission:setUserPermission}}>
<BrowserRouter> <BrowserRouter>
<RouterSwitch> <RouterSwitch>
<Route path="/" exact render={()=><Gallery />}></Route> <Route path="/" exact render={()=><Redirect to='/search?'/>}></Route>
<Route path="/search" render={()=><Gallery />}></Route> <Route path="/search" render={()=><Gallery />}></Route>
<Route path="/doc" render={(prop)=><ContentAbout {...prop}/>}></Route> <Route path="/doc" render={(prop)=><ContentAbout {...prop}/>}></Route>
<Route path="/login" render={()=><LoginPage></LoginPage>}/> <Route path="/login" render={()=><LoginPage></LoginPage>}/>