ionian/src/client/app.tsx

26 lines
881 B
TypeScript
Raw Normal View History

2021-01-08 10:46:19 +09:00
import React, { useRef, useState } from 'react';
2020-12-31 03:06:16 +09:00
import ReactDom from 'react-dom';
2021-01-05 17:42:41 +09:00
import {BrowserRouter, Route, Switch as RouterSwitch} from 'react-router-dom';
2021-01-08 10:46:19 +09:00
import { Gallery, ContentAbout} from './page/mod';
2021-01-05 04:02:43 +09:00
2021-01-06 20:16:27 +09:00
import './css/style.css';
2021-01-05 04:02:43 +09:00
2021-01-05 17:42:41 +09:00
const FooProfile = ()=><div>test profile</div>;
2021-01-08 10:46:19 +09:00
const App = () => {
return (<BrowserRouter>
2021-01-05 17:42:41 +09:00
<RouterSwitch>
2021-01-08 10:46:19 +09:00
<Route path="/" exact render={()=><Gallery />}></Route>
<Route path="/search" render={()=><Gallery />}></Route>
<Route path="/doc" render={(prop)=><ContentAbout {...prop}/>}></Route>
2021-01-06 20:16:27 +09:00
<Route path="/profile" component={FooProfile}></Route>
2021-01-05 17:42:41 +09:00
<Route>
<div>404 Not Found</div>
</Route>
</RouterSwitch>
2021-01-08 10:46:19 +09:00
</BrowserRouter>);
};
2020-12-31 03:06:16 +09:00
ReactDom.render(
2021-01-05 04:02:43 +09:00
<App/>,
2020-12-31 03:06:16 +09:00
document.getElementById("root")
)