diff options
| author | Ryan Mehri <[email protected]> | 2020-05-09 21:46:06 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-09 21:46:06 -0600 |
| commit | 3f2759dbe300058c77f70ab585a96e65c7cd091b (patch) | |
| tree | d6d82a8aa1c9e1bf14ca0f25781eba45e671916d | |
| parent | Merge pull request #4 from jackyzha0/folder-refactor (diff) | |
| parent | add react setup (diff) | |
| download | ctrl-v-3f2759dbe300058c77f70ab585a96e65c7cd091b.tar.xz ctrl-v-3f2759dbe300058c77f70ab585a96e65c7cd091b.zip | |
Merge pull request #5 from jackyzha0/react
add react setup
| -rw-r--r-- | .gitignore | 12 | ||||
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | frontend/package.json | 34 | ||||
| -rw-r--r-- | frontend/public/index.html | 29 | ||||
| -rw-r--r-- | frontend/public/logo192.png | bin | 0 -> 5347 bytes | |||
| -rw-r--r-- | frontend/public/logo512.png | bin | 0 -> 9664 bytes | |||
| -rw-r--r-- | frontend/src/components/App.js | 15 | ||||
| -rw-r--r-- | frontend/src/css/index.css | 13 | ||||
| -rw-r--r-- | frontend/src/index.js | 11 |
9 files changed, 118 insertions, 2 deletions
@@ -1,4 +1,14 @@ .env .idea go.sum -.DS_Store
\ No newline at end of file +.DS_Store + +frontend/node_modules +frontend/build +frontend/.pnp +frontend/yarn.lock +.pnp.js + +npm-debug.log* +yarn-debug.log* +yarn-error.log* @@ -8,4 +8,8 @@ docker-run: docker run -p 8080:8080 jzhao2k19/ctrl-v:latest docker-all: docker-build docker-run docker-push: - docker push jzhao2k19/ctrl-v:latest
\ No newline at end of file + docker push jzhao2k19/ctrl-v:latest +fe-run: + cd frontend && yarn start +fe-build: + cd frontend && yarn build
\ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..4ff295a --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,34 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.3.2", + "@testing-library/user-event": "^7.1.2", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-scripts": "3.4.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/frontend/public/index.html b/frontend/public/index.html new file mode 100644 index 0000000..18f4c64 --- /dev/null +++ b/frontend/public/index.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="theme-color" content="#000000" /> + <meta + name="ctrl-v" + content="some_description" + /> + <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> + <title>📋 ctrl-v</title> + </head> + <body> + <noscript>You need to enable JavaScript to run this app.</noscript> + <div id="root"></div> + <!-- + This HTML file is a template. + If you open it directly in the browser, you will see an empty page. + + You can add webfonts, meta tags, or analytics to this file. + The build step will place the bundled scripts into the <body> tag. + + To begin the development, run `npm start` or `yarn start`. + To create a production bundle, use `npm run build` or `yarn build`. + --> + </body> +</html> diff --git a/frontend/public/logo192.png b/frontend/public/logo192.png Binary files differnew file mode 100644 index 0000000..fc44b0a --- /dev/null +++ b/frontend/public/logo192.png diff --git a/frontend/public/logo512.png b/frontend/public/logo512.png Binary files differnew file mode 100644 index 0000000..a4e47a6 --- /dev/null +++ b/frontend/public/logo512.png diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js new file mode 100644 index 0000000..3614fe1 --- /dev/null +++ b/frontend/src/components/App.js @@ -0,0 +1,15 @@ +import React from 'react'; + +function App() { + return ( + <div className="App"> + <header className="App-header"> + <p> + Edit <code>src/App.js</code> and save to reload. + </p> + </header> + </div> + ); +} + +export default App; diff --git a/frontend/src/css/index.css b/frontend/src/css/index.css new file mode 100644 index 0000000..ec2585e --- /dev/null +++ b/frontend/src/css/index.css @@ -0,0 +1,13 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + monospace; +} diff --git a/frontend/src/index.js b/frontend/src/index.js new file mode 100644 index 0000000..437fe03 --- /dev/null +++ b/frontend/src/index.js @@ -0,0 +1,11 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import './css/index.css'; +import App from './components/App'; + +ReactDOM.render( + <React.StrictMode> + <App /> + </React.StrictMode>, + document.getElementById('root') +);
\ No newline at end of file |