Skip to content

Commit 3375770

Browse files
committed
Pastebin revamp from Marlin project.
1 parent 5d7cdc8 commit 3375770

File tree

22 files changed

+12060
-14929
lines changed

22 files changed

+12060
-14929
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# Pastebin
2-
This project serves as the front-end for the pastebin project (https://github.com/dannyhp1/pastebin).
2+
###### Production
3+
{Insert build tag here.}
4+
5+
## What is it?
6+
Pastebin is a text storage application for all of your snippets.

package-lock.json

Lines changed: 0 additions & 14446 deletions
This file was deleted.

package.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
{
2-
"name": "pastebin-client",
2+
"name": "core",
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@babel/helper-builder-react-jsx": "^7.12.13",
7+
"@babel/helper-call-delegate": "^7.12.13",
8+
"@babel/helper-define-map": "^7.12.13",
9+
"@babel/helper-regex": "^7.10.5",
10+
"@material-ui/core": "^4.9.5",
11+
"@material-ui/icons": "^5.0.0-alpha.24",
612
"@testing-library/jest-dom": "^4.2.4",
7-
"@testing-library/react": "^9.4.0",
8-
"@testing-library/user-event": "^7.2.1",
9-
"copy-to-clipboard": "^3.2.0",
10-
"react": "^16.12.0",
11-
"react-dom": "^16.12.0",
12-
"react-notifications-component": "^2.2.4",
13+
"@testing-library/react": "^9.3.2",
14+
"@testing-library/user-event": "^7.1.2",
15+
"aphrodite": "^2.4.0",
16+
"axios": "^0.19.2",
17+
"copy-to-clipboard": "^3.3.1",
18+
"eslint": "^6.8.0",
19+
"react": "^16.13.0",
20+
"react-ace": "^8.1.0",
21+
"react-dom": "^16.13.0",
22+
"react-notifications-component": "^3.0.3",
1323
"react-router-dom": "^5.1.2",
14-
"react-scripts": "3.3.0"
24+
"react-scripts": "3.4.0",
25+
"typescript": "^3.8.3"
1526
},
1627
"scripts": {
1728
"start": "react-scripts start",
@@ -33,10 +44,5 @@
3344
"last 1 firefox version",
3445
"last 1 safari version"
3546
]
36-
},
37-
"devDependencies": {
38-
"@material-ui/core": "^4.8.0",
39-
"axios": "^0.19.0",
40-
"react-ace": "^8.0.0"
4147
}
4248
}

public/_redirects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/* /index.html 200
1+
/* /index.html 200

public/index.html

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<!-- Global site tag (gtag.js) - Google Analytics -->
5-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-129689668-7"></script>
6-
<script>
7-
window.dataLayer = window.dataLayer || [];
8-
function gtag(){dataLayer.push(arguments);}
9-
gtag('js', new Date());
10-
11-
gtag('config', 'UA-129689668-7');
12-
</script>
13-
144
<meta charset="utf-8" />
155
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
166
<meta name="viewport" content="width=device-width, initial-scale=1" />
177
<meta name="theme-color" content="#000000" />
188
<meta
19-
name="Pastebin by Danny Pham"
20-
content="Pastebin to create and share text/code snippets."
9+
name="Pastebin"
10+
content="Text storage application for all of your snippets"
2111
/>
22-
<link rel="apple-touch-icon" href="logo.png" />
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.ico" />
2313
<!--
2414
manifest.json provides metadata used when your web app is installed on a
2515
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
2616
-->
2717
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
28-
2918
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
3019
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
3120
<!--
@@ -37,7 +26,7 @@
3726
work correctly both with client-side routing and a non-root public URL.
3827
Learn how to configure a non-root public URL by running `npm run build`.
3928
-->
40-
<title>Pastebin - Danny Pham</title>
29+
<title>Pastebin | Danny Pham</title>
4130
</head>
4231
<body>
4332
<noscript>You need to enable JavaScript to run this app.</noscript>

public/logo.png

-156 KB
Binary file not shown.

public/robots.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# https://www.robotstxt.org/robotstxt.html
22
User-agent: *
3+
Disallow:

src/App/App.css

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
1-
.App {
2-
background-color: #282A36;
3-
color: #ffffff;
1+
body {
2+
background-color: #282c34;
3+
}
4+
5+
.App-logo {
6+
height: 40vmin;
7+
pointer-events: none;
8+
}
9+
10+
@media (prefers-reduced-motion: no-preference) {
11+
.App-logo {
12+
animation: App-logo-spin infinite 20s linear;
13+
}
414
}
515

616
.App-header {
7-
background-color: #282A36;
8-
min-height: 100vh;
17+
background-color: #282c34;
18+
min-height: 80vh;
919
display: flex;
1020
flex-direction: column;
1121
align-items: center;
1222
justify-content: center;
1323
font-size: calc(10px + 2vmin);
1424
color: white;
25+
text-align: center;
1526
}
1627

1728
.App-link {
1829
color: #61dafb;
19-
}
30+
}
31+
32+
@keyframes App-logo-spin {
33+
from {
34+
transform: rotate(0deg);
35+
}
36+
to {
37+
transform: rotate(360deg);
38+
}
39+
}

src/App/App.js

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
1-
import React, { Component } from 'react';
1+
import React from 'react';
2+
import routes from '../routes/routes';
23
import { BrowserRouter as Router, Route } from 'react-router-dom';
34
import ReactNotification from 'react-notifications-component';
4-
import Header from '../components/Header';
5-
import Paste from '../components/Paste';
6-
import Editor from '../components/Editor';
5+
import NavigationBar from '../components/navigation/NavigationBar';
6+
import PastebinEditor from '../components/pastebin/PastebinEditor';
7+
import PastebinPaste from '../components/pastebin/PastebinPaste';
78
import 'react-notifications-component/dist/theme.css'
89
import './App.css';
910

10-
// Backend endpoint to save data.
11-
const DEV_POST_URL = 'http://localhost:5000/pastebin/save'
12-
const PROD_POST_URL = 'https://aws.dannyhp.com/pastebin/save'
13-
const POST_URL = PROD_POST_URL
14-
15-
// Backend endpoint to load data.
16-
const DEV_GET_URL = 'http://localhost:5000/pastebin/load/%s'
17-
const PROD_GET_URL= 'https://aws.dannyhp.com/pastebin/load/%s'
18-
const GET_URL = PROD_GET_URL
19-
20-
class App extends Component {
21-
render() {
22-
return (
23-
<div>
24-
<ReactNotification />
25-
<div className='App'>
26-
<Header />
27-
<Router>
28-
<div>
29-
<Route
30-
exact
31-
path='/'
32-
render={(props) => <Editor {...props} post_url={POST_URL} get_url={GET_URL} />}
33-
/>
34-
</div>
35-
<div>
36-
<Route
37-
exact
38-
path='/:id'
39-
render={(props) => <Paste {...props} get_url={GET_URL} />}
40-
/>
41-
</div>
42-
</Router>
43-
</div>
44-
</div>
45-
)
46-
}
11+
function App() {
12+
return (
13+
<div className="App">
14+
<ReactNotification />
15+
<Router>
16+
<NavigationBar />
17+
<Route
18+
exact
19+
path={routes['default']}
20+
render={(props) => <PastebinPaste {...props} />}
21+
/>
22+
<Route
23+
exact
24+
path={routes['pastebin']}
25+
render={(props) => <PastebinEditor {...props} />}
26+
/>
27+
<Route
28+
exact
29+
path={routes['pastebinId']}
30+
render={(props) => <PastebinPaste {...props} />}
31+
/>
32+
<Route
33+
exact
34+
path={routes['sourceCode']}
35+
component={() => {
36+
window.location.href = 'https://github.com/dannyhp1/pastebin'
37+
}}
38+
/>
39+
</Router>
40+
</div>
41+
);
4742
}
4843

49-
export default App;
44+
export default App;

src/App/App.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)