From 3648937eac8fee941b87242ef0a95143ee2b942d Mon Sep 17 00:00:00 2001 From: Geir Okkenhaug Jerstad Date: Wed, 25 Sep 2024 14:42:53 +0200 Subject: [PATCH] test spa with react --- react_test/spa_react/src/About.js | 41 +++++++++++++++++++++++ react_test/spa_react/src/App.js | 51 ++++++++++++++++------------- react_test/spa_react/src/Contact.js | 20 +++++++++++ react_test/spa_react/src/Home.js | 13 ++++++++ 4 files changed, 103 insertions(+), 22 deletions(-) create mode 100644 react_test/spa_react/src/About.js create mode 100644 react_test/spa_react/src/Contact.js create mode 100644 react_test/spa_react/src/Home.js diff --git a/react_test/spa_react/src/About.js b/react_test/spa_react/src/About.js new file mode 100644 index 0000000..b35c8f9 --- /dev/null +++ b/react_test/spa_react/src/About.js @@ -0,0 +1,41 @@ +import React, { Component } from "react"; + +class About extends Component { + render() { + return ( +
+

SPA App - About

+

This is a paragraph on the About of the SPA App.

+

The Team of SPA App.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
IDNameEmail
1John Doejohndoe@example.com
2Jane Doejanedoe@example.com
3Bob Smithbobsmith@example.com
+
+ ); + } +} + +export default About; \ No newline at end of file diff --git a/react_test/spa_react/src/App.js b/react_test/spa_react/src/App.js index 3784575..a27987c 100644 --- a/react_test/spa_react/src/App.js +++ b/react_test/spa_react/src/App.js @@ -1,25 +1,32 @@ -import logo from './logo.svg'; -import './App.css'; +import React, { Component } from "react"; +import { Route, NavLink, HashRouter, Routes } from "react-router-dom"; -function App() { - return ( -
-
- logo -

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

- - Learn React - -
-
- ); +import Home from "./Home"; +import About from "./About"; +import Contact from "./Contact"; + +class App extends Component { + render() { + return ( + +
+

A Simple SPA made using React

+
    +
  • Home
  • +
  • About
  • +
  • Contact
  • +
+
+ + }> + }> + }> + +
+
+
+ ); + } } -export default App; +export default App; \ No newline at end of file diff --git a/react_test/spa_react/src/Contact.js b/react_test/spa_react/src/Contact.js new file mode 100644 index 0000000..5bf788e --- /dev/null +++ b/react_test/spa_react/src/Contact.js @@ -0,0 +1,20 @@ +import React, { Component } from "react"; + +class Contact extends Component { + render() { + return ( +
+

SPA App - Contact

+

Please feel free to contact us with any questions or inquiries you may have. We are always happy to help!

+

Contact Details:

+ +
+ ); + } +} + +export default Contact; \ No newline at end of file diff --git a/react_test/spa_react/src/Home.js b/react_test/spa_react/src/Home.js new file mode 100644 index 0000000..939989d --- /dev/null +++ b/react_test/spa_react/src/Home.js @@ -0,0 +1,13 @@ +import React, { Component } from "react"; + +class Home extends Component { + render() { + return ( +
+

SPA App - Home

+

This is a paragraph on the HomePAge of the SPA App.

+
+ ); + } +} +export default Home; \ No newline at end of file