-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated React sample (moved to functional components)
- Loading branch information
1 parent
55a5c70
commit 6ac9590
Showing
17 changed files
with
565 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,47 @@ | ||
.body { | ||
color: aquamarine; | ||
} | ||
|
||
.error { | ||
color: red; | ||
margin: 0.5rem; | ||
display: block; | ||
} | ||
|
||
.errors { | ||
padding: 1rem; | ||
background-color: lightblue; | ||
margin: 1rem; | ||
max-width: 50%; | ||
} | ||
|
||
|
||
h3 { | ||
text-align: center; | ||
padding: 0.3rem; | ||
} | ||
|
||
ul { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
background-color: #333; | ||
} | ||
|
||
li { | ||
float: left; | ||
} | ||
|
||
li a { | ||
display: block; | ||
color: white; | ||
text-align: center; | ||
padding: 14px 16px; | ||
text-decoration: none; | ||
} | ||
|
||
/* Change the link color to #111 (black) on hover */ | ||
li a:hover { | ||
background-color: #111; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import { BrowserRouter, Routes, Route, Outlet, Link } from 'react-router-dom'; | ||
import Customers from './components/customers/Customers'; | ||
import Customer from './components/customer/Customer'; | ||
import About from './components/about/About'; | ||
|
||
const Holder = () => { | ||
return <div> | ||
<nav className="navbar navbar-light bg-light justify-content-between"> | ||
<span>🧭 React DelphiMVCFramework Sample</span> | ||
<ul> | ||
<li > | ||
<Link to={'/customer'}>Add</Link> | ||
</li> | ||
<li > | ||
<Link to={'/about'}>About</Link> | ||
</li> | ||
</ul> | ||
</nav> | ||
<Outlet></Outlet> | ||
</div> | ||
} | ||
|
||
const Layout = () => { | ||
return <BrowserRouter> | ||
<Routes> | ||
<Route path='/' element={<Holder></Holder>} > | ||
<Route index path='/' element={<Customers></Customers>} /> | ||
<Route path='/customer/:id' element={<Customer></Customer>} /> | ||
<Route path='/customer' element={<Customer></Customer>} /> | ||
<Route path='/about' element={<About></About>} /> | ||
<Route path='*' element={<div>Not Found</div>} /> | ||
</Route> | ||
</Routes> | ||
</BrowserRouter> | ||
}; | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from "react"; | ||
const About = () => { | ||
return <h3>DelphiMVCFramework React Sample</h3> | ||
} | ||
|
||
export default About; |
Oops, something went wrong.