-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f61a1e
commit 32f1b5e
Showing
8 changed files
with
127 additions
and
67 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
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,11 +1,19 @@ | ||
import * as React from "react"; | ||
import { NextUIProvider } from "@nextui-org/react"; | ||
import { Home } from "./pages/Home"; | ||
import { Outlet } from 'react-router-dom'; | ||
import { Header } from "@/components/Header/Header"; | ||
import { Footer } from "@/components/Footer/Footer"; | ||
|
||
export const App = () => { | ||
const App = () => { | ||
return ( | ||
<NextUIProvider> | ||
<Home/> | ||
</NextUIProvider> | ||
<div className="container"> | ||
<NextUIProvider> | ||
<Header/> | ||
<Outlet/> | ||
<Footer/> | ||
</NextUIProvider> | ||
</div> | ||
|
||
); | ||
} | ||
}; | ||
|
||
export default App; |
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,7 +1,30 @@ | ||
import { App } from './App'; | ||
import { createRoot } from 'react-dom/client'; | ||
import { createBrowserRouter, RouterProvider } from 'react-router-dom' | ||
import App from './App'; | ||
import Error from './pages/Error'; | ||
import Home from '@/pages/Home'; | ||
import './globals.css'; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: '/', | ||
element: <App/>, | ||
errorElement: <Error/>, | ||
children: [ | ||
{ | ||
index: true, | ||
element: <Home/>, | ||
}, | ||
{ | ||
path: '/test', | ||
element: <h1>Testing 1 2 3</h1>, | ||
}, | ||
], | ||
}, | ||
]); | ||
|
||
// Render your React component instead | ||
const root = createRoot(document.getElementById('root')); | ||
root.render(<App />); | ||
root.render( | ||
<RouterProvider router={ router }/> | ||
); |
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,19 @@ | ||
import { Header } from "@/components/Header/Header"; | ||
import { Outlet } from "react-router-dom"; | ||
import { Footer } from "@/components/Footer/Footer"; | ||
|
||
const Error = () => { | ||
return ( | ||
<div className="container"> | ||
<Header/> | ||
<div className="row"> | ||
<div className="col-12"> | ||
<h1>Error!</h1> | ||
</div> | ||
</div> | ||
<Footer/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Error; |
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,35 +1,31 @@ | ||
import { useState } from 'react'; | ||
import { Header } from "@/components/Header/Header"; | ||
import { Footer } from "@/components/Footer/Footer"; | ||
import { Button } from "@nextui-org/react"; | ||
|
||
export const Home = () => { | ||
const Home = () => { | ||
const [count, setCount] = useState(0); | ||
const tester = "Victor E"; | ||
|
||
return ( | ||
<div className="container"> | ||
<Header/> | ||
<div className="row"> | ||
<div className="col-12"> | ||
<h1>Hello, Cloudflare Workers!</h1> | ||
<br/> | ||
<h3>This is a basic React page deployed on Cloudflare Workers.</h3> | ||
<br/> | ||
<pre><strong>Your name:</strong> { tester }</pre> | ||
<div className="row"> | ||
<div className="col-12"> | ||
<h1>Hello, Cloudflare Workers!</h1> | ||
<br/> | ||
<h3>This is a basic React page deployed on Cloudflare Workers.</h3> | ||
<br/> | ||
<pre><strong>Your name:</strong> { tester }</pre> | ||
|
||
<p>Count: { count }</p> | ||
<br/> | ||
<Button | ||
color="primary" | ||
|
||
onClick={ () => setCount(count + 1) } | ||
> | ||
Increase | ||
</Button> | ||
</div> | ||
<p>Count: { count }</p> | ||
<br/> | ||
<Button | ||
color="primary" | ||
type="button" | ||
onClick={ () => setCount(count + 1) } | ||
> | ||
Increase | ||
</Button> | ||
</div> | ||
<Footer/> | ||
</div> | ||
); | ||
}; | ||
}; | ||
|
||
export default Home; |
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