diff options
Diffstat (limited to 'frontend/src/App.js')
| -rw-r--r-- | frontend/src/App.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/frontend/src/App.js b/frontend/src/App.js deleted file mode 100644 index 0a47baa..0000000 --- a/frontend/src/App.js +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react'; -import NewPaste from './components/pages/NewPaste' -import ViewPaste from './components/pages/ViewPaste' -import styled from 'styled-components' -import { - BrowserRouter as Router, - Switch, - Route, - useParams -} from "react-router-dom"; -import Raw from './components/pages/Raw' -import ThemeProvider from './theme/ThemeProvider' -import GlobalStyle from './theme/GlobalStyle' -import {Watermark} from "./components/Watermark"; - -const Main = styled.div` - margin-top: 10vh; - padding: 0 20vw 30px 20vw; -` - -const GetPasteWithParam = () => { - let { hash } = useParams(); - return <ViewPaste hash = {hash} />; -} - -const GetRawWithParam = () => { - let { hash } = useParams(); - return <Raw hash={hash} />; -} - -const App = () => { - return ( - <ThemeProvider> - <GlobalStyle /> - <Router> - <Switch> - <Route path="/raw/:hash"><GetRawWithParam /></Route> - <Route> - <Watermark/> - <Main id="appElement"> - <Switch> - <Route path="/:hash"> - <GetPasteWithParam /> - </Route> - <Route path="/"> - <NewPaste /> - </Route> - </Switch> - </Main> - </Route> - </Switch> - </Router> - </ThemeProvider> - ); -} - - -export default App; |