Changeset 800779d for reactapp/src


Ignore:
Timestamp:
08/07/22 18:55:02 (2 years ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Children:
6eba109
Parents:
3e98cea
Message:

created login page

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";
     1import Professor from "./Pages/Professor";
     2import SearchResults from "./Pages/SearchResults";
     3import Login from "./Pages/Login";
     4import { BrowserRouter, Routes, Route } from "react-router-dom";
     5import Home from "./Pages/Home";
    46
    57export default function App() {
    6   //document.body.style = "background: red;";
    78  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>
    2420  );
    2521}
  • reactapp/src/index.js

    r3e98cea r800779d  
    11import ReactDOM from "react-dom/client";
    2 import { BrowserRouter, Routes, Route } from "react-router-dom";
    32import App from "./App";
    4 import Professor from "./Pages/Professor";
    5 import SearchResults from "./Pages/SearchResults";
    63
    74const 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 );
     5root.render(<App />);
Note: See TracChangeset for help on using the changeset viewer.