Skip to content

Commit

Permalink
feat: Set up React Router
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-merlin committed Feb 22, 2024
1 parent b0b073f commit 97c4a14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
25 changes: 7 additions & 18 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { Box, Container, Spinner } from '@chakra-ui/react'
import React from 'react'
import { Routes, Route } from 'react-router-dom'
import HomePage from '../pages/HomePage'

function App (): JSX.Element {
return (
<div style={{ height: '100vh' }}>
<Container height="100%" display="flex" justifyContent="center" alignItems="center">
<Box
display="flex"
justifyContent="center"
alignItems="center"
height="100px"
>
<Spinner
thickness='4px'
speed='0.65s'
emptyColor='gray.200'
color='blue.500'
size='xl'
/>
</Box>
</Container>
<div>
<Routes>
<Route path="/" element={<HomePage />} />
</Routes>
</div>
)
}
Expand Down
3 changes: 3 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import ReactDOM from 'react-dom/client'
import App from './app/App'
import reportWebVitals from './reportWebVitals'
import { ChakraProvider } from '@chakra-ui/react'
import { BrowserRouter } from 'react-router-dom'

const rootElement = document.getElementById('root')

if (rootElement !== null) {
const root = ReactDOM.createRoot(rootElement)
root.render(
<React.StrictMode>
<BrowserRouter>
<ChakraProvider>
<App />
</ChakraProvider>
</BrowserRouter>
</React.StrictMode>
)
} else {
Expand Down

0 comments on commit 97c4a14

Please sign in to comment.