From 1f750b3ef0e4e3c0153006551c4449eabb10d1e5 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Mon, 11 May 2020 20:47:11 -0700 Subject: add basic link + route --- frontend/package.json | 1 + frontend/src/components/App.js | 45 +++++++++++++++++++++++++++++++++------ frontend/src/components/Header.js | 20 ----------------- frontend/src/css/index.css | 35 ++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 26 deletions(-) delete mode 100644 frontend/src/components/Header.js diff --git a/frontend/package.json b/frontend/package.json index d32e1cc..390e3f5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,6 +13,7 @@ "react-dom": "^16.13.1", "react-dropdown": "^1.7.0", "react-modal": "^3.11.2", + "react-router-dom": "^5.2.0", "react-scripts": "3.4.1", "styled-components": "^5.1.0" }, diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js index 17240f5..2f438e9 100644 --- a/frontend/src/components/App.js +++ b/frontend/src/components/App.js @@ -1,15 +1,48 @@ import React from 'react'; -import Header from './Header' import PasteArea from './PasteArea' import Footer from './Footer' +import styled from 'styled-components' +import { + BrowserRouter as Router, + Switch, + Route, + Link +} from "react-router-dom"; + +const SpacedTitle = styled.div` + margin-top: 10vh +` + +const Inline = styled.div` + display: inline-block +` + +const Desc = () => { + return ( +

a modern, open-source pastebin with latex and markdown rendering support

+ ); +} function App() { return ( -
-
- -
-
+ +
+ + + + + + +
+
+
); } diff --git a/frontend/src/components/Header.js b/frontend/src/components/Header.js deleted file mode 100644 index a0c5ee8..0000000 --- a/frontend/src/components/Header.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import styled from 'styled-components' - -const SpacedTitle = styled.div` - margin-top: 10vh -` - -const Header = () => { - return ( - -

- 📋  - ctrl-v -

-

a modern, open-source pastebin with latex and markdown rendering support

-
- ); -} - -export default Header; \ No newline at end of file diff --git a/frontend/src/css/index.css b/frontend/src/css/index.css index 3d05fa0..3279aac 100644 --- a/frontend/src/css/index.css +++ b/frontend/src/css/index.css @@ -94,4 +94,39 @@ input[type=submit] { padding: 0.8em 2em; margin: 2em 0; outline: 0; +} + +ul { + list-style-type: none; + display: inline-block; +} + +li { + display: inline-block; + margin: 0 1em; +} + +.mainLogo { + display: inline-block; +} + +.mainLogo a { + text-decoration: none; + position: relative; + margin: 3px; +} + +.mainLogo a::after { + content: ""; + position: absolute; + left: 0; + bottom: 0; + height: 4px; + background-color: #111111; + width: 0; + transition: width 0.25s ease; +} + +.mainLogo:hover a::after { + width: 100%; } \ No newline at end of file -- cgit v1.2.3 From 433466a3947e75a36b811795bc21be1fff10b5e8 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Mon, 11 May 2020 21:11:16 -0700 Subject: backend redir --- frontend/src/components/App.js | 27 +++-- frontend/src/components/CharLimit.js | 37 ------ frontend/src/components/FloatingLabel.js | 34 ------ frontend/src/components/Inputs.js | 4 +- frontend/src/components/NewPaste.js | 124 +++++++++++++++++++++ frontend/src/components/PasteArea.js | 113 ------------------- frontend/src/components/ViewPaste.js | 16 +++ frontend/src/components/decorators/CharLimit.js | 37 ++++++ .../src/components/decorators/FloatingLabel.js | 34 ++++++ 9 files changed, 233 insertions(+), 193 deletions(-) delete mode 100644 frontend/src/components/CharLimit.js delete mode 100644 frontend/src/components/FloatingLabel.js create mode 100644 frontend/src/components/NewPaste.js delete mode 100644 frontend/src/components/PasteArea.js create mode 100644 frontend/src/components/ViewPaste.js create mode 100644 frontend/src/components/decorators/CharLimit.js create mode 100644 frontend/src/components/decorators/FloatingLabel.js diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js index 2f438e9..605903e 100644 --- a/frontend/src/components/App.js +++ b/frontend/src/components/App.js @@ -1,28 +1,34 @@ import React from 'react'; -import PasteArea from './PasteArea' +import NewPaste from './NewPaste' +import ViewPaste from './ViewPaste' import Footer from './Footer' import styled from 'styled-components' import { BrowserRouter as Router, Switch, Route, - Link + Link, + useParams } from "react-router-dom"; const SpacedTitle = styled.div` margin-top: 10vh ` -const Inline = styled.div` - display: inline-block -` - const Desc = () => { return (

a modern, open-source pastebin with latex and markdown rendering support

); } +const GetPasteWithParam = () => { + let { hash } = useParams(); + + return ( + + ); +} + function App() { return ( @@ -38,7 +44,14 @@ function App() { - + + } + /> + + + +