Changeset 800779d for reactapp/src
- Timestamp:
- 08/07/22 18:55:02 (2 years ago)
- Branches:
- main
- Children:
- 6eba109
- Parents:
- 3e98cea
- Location:
- reactapp/src
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/App.js
r3e98cea r800779d 1 import { Outlet } from "react-router-dom"; 2 import { MainWrapper, MainTitle } from "./Components/Styled/Main.style"; 3 import Search from "./Components/Search.js"; 1 import Professor from "./Pages/Professor"; 2 import SearchResults from "./Pages/SearchResults"; 3 import Login from "./Pages/Login"; 4 import { BrowserRouter, Routes, Route } from "react-router-dom"; 5 import Home from "./Pages/Home"; 4 6 5 7 export default function App() { 6 //document.body.style = "background: red;";7 8 return ( 8 <MainWrapper> 9 <style> 10 @import 11 url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap'); 12 </style> 13 <style> 14 { 15 "body { background-color: papayawhip;} * {margin: 0; padding: 0; box-sizing: border-box;}" 16 } 17 </style> 18 <a href="/"> 19 <MainTitle>profesori.mk</MainTitle> 20 </a>{" "} 21 <Search /> 22 <Outlet /> 23 </MainWrapper> 9 <BrowserRouter> 10 <Routes> 11 <Route path="/" element={<Home />}> 12 <Route path="login" element={<Login />}></Route> 13 <Route path="professor"> 14 <Route path=":professorId" element={<Professor />} /> 15 </Route> 16 <Route path="search" element={<SearchResults />}></Route> 17 </Route> 18 </Routes> 19 </BrowserRouter> 24 20 ); 25 21 } -
reactapp/src/index.js
r3e98cea r800779d 1 1 import ReactDOM from "react-dom/client"; 2 import { BrowserRouter, Routes, Route } from "react-router-dom";3 2 import App from "./App"; 4 import Professor from "./Pages/Professor";5 import SearchResults from "./Pages/SearchResults";6 3 7 4 const root = ReactDOM.createRoot(document.getElementById("root")); 8 root.render( 9 <BrowserRouter> 10 <Routes> 11 <Route path="/" element={<App />}> 12 <Route path="professor"> 13 <Route path=":professorId" element={<Professor />} /> 14 </Route> 15 <Route path="search" element={<SearchResults />}></Route> 16 </Route> 17 </Routes> 18 </BrowserRouter> 19 ); 5 root.render(<App />);
Note:
See TracChangeset
for help on using the changeset viewer.