diff options
Diffstat (limited to 'paste-ui/src')
| -rw-r--r-- | paste-ui/src/App.css | 38 | ||||
| -rw-r--r-- | paste-ui/src/App.js | 20 | ||||
| -rw-r--r-- | paste-ui/src/App.test.js | 8 | ||||
| -rw-r--r-- | paste-ui/src/api.js | 0 | ||||
| -rw-r--r-- | paste-ui/src/index.css | 13 | ||||
| -rw-r--r-- | paste-ui/src/index.js | 17 | ||||
| -rw-r--r-- | paste-ui/src/list.js | 46 | ||||
| -rw-r--r-- | paste-ui/src/reportWebVitals.js | 13 | ||||
| -rw-r--r-- | paste-ui/src/setupTests.js | 5 | ||||
| -rw-r--r-- | paste-ui/src/stateExample.js | 32 | ||||
| -rw-r--r-- | paste-ui/src/style.css | 71 | ||||
| -rw-r--r-- | paste-ui/src/view.js | 54 |
12 files changed, 0 insertions, 317 deletions
diff --git a/paste-ui/src/App.css b/paste-ui/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/paste-ui/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/paste-ui/src/App.js b/paste-ui/src/App.js deleted file mode 100644 index 215de9c..0000000 --- a/paste-ui/src/App.js +++ /dev/null @@ -1,20 +0,0 @@ -import './style.css'; - -import List from './list'; -import View from './view'; - -import MovingDot from './stateExample'; - - -function App() { - let asdf = "aasdf"; - return ( - <div className="container"> - <List></List> - - <View id="dZ3mGNs"></View> - </div> - ); -} - -export default App; diff --git a/paste-ui/src/App.test.js b/paste-ui/src/App.test.js deleted file mode 100644 index 1f03afe..0000000 --- a/paste-ui/src/App.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(<App />); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/paste-ui/src/api.js b/paste-ui/src/api.js deleted file mode 100644 index e69de29..0000000 --- a/paste-ui/src/api.js +++ /dev/null diff --git a/paste-ui/src/index.css b/paste-ui/src/index.css deleted file mode 100644 index ec2585e..0000000 --- a/paste-ui/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -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/paste-ui/src/index.js b/paste-ui/src/index.js deleted file mode 100644 index d563c0f..0000000 --- a/paste-ui/src/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; - -const root = ReactDOM.createRoot(document.getElementById('root')); -root.render( - <React.StrictMode> - <App /> - </React.StrictMode> -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/paste-ui/src/list.js b/paste-ui/src/list.js deleted file mode 100644 index 9371367..0000000 --- a/paste-ui/src/list.js +++ /dev/null @@ -1,46 +0,0 @@ -import { useState } from "react"; -import { useEffect } from "react"; - - -export default function List() { - const [error, setError] = useState(null); - const [isLoaded, setIsLoaded] = useState(false); - const [items, setItems] = useState([]); - - // Note: the empty deps array [] means - // this useEffect will run once - // similar to componentDidMount() - useEffect(() => { - fetch("http://localhost:6130/api/v1/list") - .then(res => res.json()) - .then( - (result) => { - setIsLoaded(true); - setItems(result); - }, - // Note: it's important to handle errors here - // instead of a catch() block so that we don't swallow - // exceptions from actual bugs in components. - (error) => { - setIsLoaded(true); - setError(error); - } - ) - }, []) - - if (error) { - return <div>Error: {error.message}</div>; - } else if (!isLoaded) { - return <div>Loading...</div>; - } else { - return ( - <ul> - {items.map(item => ( - <li> - ID: {item.id} Size: {item.size} - </li> - ))} - </ul> - ); - } -}
\ No newline at end of file diff --git a/paste-ui/src/reportWebVitals.js b/paste-ui/src/reportWebVitals.js deleted file mode 100644 index 5253d3a..0000000 --- a/paste-ui/src/reportWebVitals.js +++ /dev/null @@ -1,13 +0,0 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/paste-ui/src/setupTests.js b/paste-ui/src/setupTests.js deleted file mode 100644 index 8f2609b..0000000 --- a/paste-ui/src/setupTests.js +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom'; diff --git a/paste-ui/src/stateExample.js b/paste-ui/src/stateExample.js deleted file mode 100644 index 91fee18..0000000 --- a/paste-ui/src/stateExample.js +++ /dev/null @@ -1,32 +0,0 @@ -import { useState } from 'react'; -export default function MovingDot() { - const [position, setPosition] = useState({ - x: 0, - y: 0 - }); - return ( - <div - onPointerMove={e => { - setPosition({ - x: e.clientX, - y: e.clientY - }); - }} - style={{ - position: 'relative', - width: '100vw', - height: '100vh', - }}> - <div style={{ - position: 'absolute', - backgroundColor: 'red', - borderRadius: '50%', - transform: `translate(${position.x}px, ${position.y}px)`, - left: -10, - top: -10, - width: 20, - height: 20, - }} /> - </div> - ); -}
\ No newline at end of file diff --git a/paste-ui/src/style.css b/paste-ui/src/style.css deleted file mode 100644 index 472b18c..0000000 --- a/paste-ui/src/style.css +++ /dev/null @@ -1,71 +0,0 @@ -nav { - border-bottom: 3px solid #000; - padding-bottom: 10px; -} -a { - text-decoration: none; - color: #268bd2; -} -a:visited { - color: #d22653; -} -a:hover { - text-decoration: underline; -} - -code { - color: #9672d5; - /* background-color: #ff000020; */ - /* padding: 2px; */ - font-size: .8em; - font-family: "Roboto Mono", "Monaco", "Lucida Console", "DejaVu Sans Mono", "monospace"; -} - -pre code { - color: #000; - background-color: #FFFFEA; - display: block; - padding: 10px; - border: 1px solid; - line-height: 1.1; - overflow: auto; -} - - -blockquote { - border-left: 4px solid #aaa; - padding-left: 1em; -} - -/* - * The following was shamelessly ripped from: - * http://bettermotherfuckingwebsite.com/ - * And subsequently modified to suit my needs - */ - -body { - margin: 40px auto; - max-width: 80%; - line-height: 1.6; - font-size: 1em; - color: #444; - padding: 0 10px; - /* Added because some browsers don't default to white */ - background-color: #fff; -} - -img { - width: 100%; - height: auto; -} - -h1,h2,h3 { - line-height: 1.2 -} - -@media screen and (min-width: 960px) { - body { - max-width: 768px; - } -} - diff --git a/paste-ui/src/view.js b/paste-ui/src/view.js deleted file mode 100644 index e3bf0df..0000000 --- a/paste-ui/src/view.js +++ /dev/null @@ -1,54 +0,0 @@ -import { useState } from "react"; -import { useEffect } from "react"; - - -export default function View(props) { - const [error, setError] = useState(null); - const [isLoaded, setIsLoaded] = useState(false); - const [item, setItems] = useState([]); - - // Note: the empty deps array [] means - // this useEffect will run once - // similar to componentDidMount() - useEffect(() => { - fetch("http://localhost:6130/api/v1/view/" + props.id) - .then(res => res.json()) - .then( - (result) => { - setIsLoaded(true); - setItems(result); - }, - // Note: it's important to handle errors here - // instead of a catch() block so that we don't swallow - // exceptions from actual bugs in components. - (error) => { - setIsLoaded(true); - setError(error); - } - ) - }, []) - - if (error) { - return <div>Error: {error.message}</div>; - } else if (!isLoaded) { - return <div>Loading...</div>; - } else { - if ('Code' in item && item.Code != 200) { - return ( - <p> - Error: {item.Code} {item.Msg} - </p> - ); - } - return ( - <div className="content"> - <h2>ID: {props.id}</h2> - <pre> - <code> - {item.Content} - </code> - </pre> - </div> - ); - } -}
\ No newline at end of file |
