From f8f7a89996c2c93523a3bf9c113b722a51611449 Mon Sep 17 00:00:00 2001 From: RailTH Date: Thu, 1 Feb 2024 18:37:03 +1100 Subject: [PATCH] Full integration react & django --- reactapp/public/index.html | 23 -------------------- reactapp/src/App.css | 38 --------------------------------- reactapp/src/App.js | 21 ++---------------- reactapp/src/App.test.js | 8 ------- reactapp/src/index.css | 13 ----------- reactapp/src/index.js | 10 ++------- reactapp/src/logo.svg | 1 - reactapp/src/reportWebVitals.js | 13 ----------- reactapp/src/setupTests.js | 5 ----- reactapp/src/style.css | 0 10 files changed, 4 insertions(+), 128 deletions(-) delete mode 100644 reactapp/src/App.css delete mode 100644 reactapp/src/App.test.js delete mode 100644 reactapp/src/index.css delete mode 100644 reactapp/src/logo.svg delete mode 100644 reactapp/src/reportWebVitals.js delete mode 100644 reactapp/src/setupTests.js create mode 100644 reactapp/src/style.css diff --git a/reactapp/public/index.html b/reactapp/public/index.html index aa069f2..9b54e4e 100644 --- a/reactapp/public/index.html +++ b/reactapp/public/index.html @@ -10,34 +10,11 @@ content="Web site created using create-react-app" /> - - React App
- diff --git a/reactapp/src/App.css b/reactapp/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/reactapp/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/reactapp/src/App.js b/reactapp/src/App.js index 3784575..4aaf9b9 100644 --- a/reactapp/src/App.js +++ b/reactapp/src/App.js @@ -1,24 +1,7 @@ -import logo from './logo.svg'; -import './App.css'; - function App() { return ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
-
+ <> + ); } diff --git a/reactapp/src/App.test.js b/reactapp/src/App.test.js deleted file mode 100644 index 1f03afe..0000000 --- a/reactapp/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(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/reactapp/src/index.css b/reactapp/src/index.css deleted file mode 100644 index ec2585e..0000000 --- a/reactapp/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/reactapp/src/index.js b/reactapp/src/index.js index d563c0f..13ab9cb 100644 --- a/reactapp/src/index.js +++ b/reactapp/src/index.js @@ -1,17 +1,11 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import './index.css'; +import './style.css'; import App from './App'; -import reportWebVitals from './reportWebVitals'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( -); - -// 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(); +); \ No newline at end of file diff --git a/reactapp/src/logo.svg b/reactapp/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/reactapp/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/reactapp/src/reportWebVitals.js b/reactapp/src/reportWebVitals.js deleted file mode 100644 index 5253d3a..0000000 --- a/reactapp/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/reactapp/src/setupTests.js b/reactapp/src/setupTests.js deleted file mode 100644 index 8f2609b..0000000 --- a/reactapp/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/reactapp/src/style.css b/reactapp/src/style.css new file mode 100644 index 0000000..e69de29