|
1 | | -import ContactForm from './ContactForm'; |
2 | | -import ProjectList from './ProjectList'; |
3 | | -import maxtekLogo from './assets/logo.jpeg' |
4 | | -import './App.css' |
| 1 | +import { Content, Theme } from '@carbon/react' |
| 2 | +import { |
| 3 | + Navigate, |
| 4 | + Outlet, |
| 5 | + RouterProvider, |
| 6 | + createHashRouter, |
| 7 | +} from 'react-router-dom' |
| 8 | +import AppHeader from './components/AppHeader' |
| 9 | +import AppContent from './components/AppContent' |
| 10 | +import Home from './content/Home' |
| 11 | +import Projects from './content/Projects' |
| 12 | +import Contact from './content/Contact' |
| 13 | +import { enable } from '@carbon/feature-flags'; |
| 14 | +import { useState } from 'react' |
5 | 15 |
|
6 | | -function App() { |
| 16 | +const AppLayout = () => { |
| 17 | + const defaultDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches |
| 18 | + const [darkMode, setDarkMode] = useState(defaultDarkMode); |
| 19 | + |
| 20 | + enable('enable-tile-contrast'); |
7 | 21 |
|
8 | 22 | return ( |
9 | | - <> |
10 | | - <title>Maxtek Consulting</title> |
11 | | - <div className="logo-container"> |
12 | | - <img src={maxtekLogo} className="logo" alt="Maxtek logo" /> |
13 | | - <h1>Maxtek Consulting</h1> |
14 | | - </div> |
| 23 | + <Theme theme={darkMode ? 'g100' : 'g10'}> |
| 24 | + <AppHeader darkMode={darkMode} setDarkMode={setDarkMode} /> |
| 25 | + <AppContent><Outlet /></AppContent> |
| 26 | + </Theme> |
| 27 | + ); |
| 28 | +}; |
15 | 29 |
|
16 | | - <div className="container"> |
17 | | - <div className="box"> |
18 | | - <h2>Services</h2> |
19 | | - <p>We can provide expertise in the following areas:</p> |
20 | | - <ul> |
21 | | - <li>C, C++, and Go</li> |
22 | | - <li>CMake build systems</li> |
23 | | - <li>Linux kernel development</li> |
24 | | - <li>Embedded systems</li> |
25 | | - <li>Open source projects</li> |
26 | | - <li>CI/CD integration</li> |
27 | | - </ul> |
28 | | - </div> |
29 | | - <div className="box"> |
30 | | - <h2>Projects</h2> |
31 | | - <p>Here are some of our active projects:</p> |
32 | | - <ProjectList /> |
33 | | - <p>Check out our <a href="https://github.com/maxtek6">GitHub</a> for more projects.</p> |
34 | | - </div> |
35 | | - <div className="box"> |
36 | | - <h2>Contact</h2> |
37 | | - <p>For help with custom software or open source development.</p> |
| 30 | +const router = createHashRouter([ |
| 31 | + { |
| 32 | + path: '/', |
| 33 | + element: <AppLayout />, |
| 34 | + children: [ |
| 35 | + { index: true, element: <Home /> }, |
| 36 | + { path: 'projects', element: <Projects /> }, |
| 37 | + { path: 'contact', element: <Contact /> }, |
| 38 | + { path: '*', element: <Navigate to="/" replace /> }, |
| 39 | + ], |
| 40 | + }, |
| 41 | +]) |
38 | 42 |
|
39 | | - <ContactForm /> |
40 | | - </div> |
41 | | - </div> |
42 | | - </> |
43 | | - ) |
| 43 | +function App() { |
| 44 | + return <RouterProvider router={router} /> |
44 | 45 | } |
45 | 46 |
|
46 | 47 | export default App |
0 commit comments