main
Rev | Line | |
---|
[9bf1f8d] | 1 | import React, { useContext, useEffect, useState } from "react";
|
---|
| 2 | import { MainWrapper, MainTitle } from "./Styled/Main.style";
|
---|
| 3 | import { Outlet } from "react-router-dom";
|
---|
| 4 | import Search from "./Search";
|
---|
| 5 | import UserHeader from "./UserHeader";
|
---|
| 6 | import AuthApi from "../api/AuthApi";
|
---|
| 7 | import Logout from "./Logout";
|
---|
| 8 | import {LogoutButton} from "./Styled/UserDetails.style";
|
---|
| 9 |
|
---|
| 10 | function Root({ user, userLoaded }) {
|
---|
| 11 | const { auth, setAuth } = useContext(AuthApi);
|
---|
| 12 |
|
---|
| 13 | return (
|
---|
| 14 | <MainWrapper>
|
---|
| 15 | <style>
|
---|
| 16 | @import
|
---|
| 17 | 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');
|
---|
| 18 | </style>
|
---|
| 19 | <style>
|
---|
| 20 | {
|
---|
| 21 | "body { background-color: papayawhip;} * {margin: 0; padding: 0; box-sizing: border-box;}"
|
---|
| 22 | }
|
---|
| 23 | </style>
|
---|
| 24 | <a href="/">
|
---|
| 25 | <MainTitle>profesori.mk</MainTitle>
|
---|
| 26 | </a>{" "}
|
---|
| 27 | <div style={{ float: "left", marginTop: 20, marginLeft: 40 }}>
|
---|
| 28 | {!auth && <a href="/login"><LogoutButton style={{textDecoration:"underline", color:"black"}}>Најава/регистрација</LogoutButton></a>}{" "}
|
---|
| 29 | </div>
|
---|
| 30 | <Search />
|
---|
| 31 | {auth && <UserHeader />}
|
---|
| 32 | <div style={{ marginTop: "140px" }}/>
|
---|
| 33 | <Outlet />
|
---|
| 34 | </MainWrapper>
|
---|
| 35 | );
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | export default Root;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.