diff --git a/pairent_frontend_react/src/API/IAPIObject.js b/pairent_frontend_react/src/API/IAPIObject.js index e4a1af8..be9061b 100644 --- a/pairent_frontend_react/src/API/IAPIObject.js +++ b/pairent_frontend_react/src/API/IAPIObject.js @@ -30,7 +30,7 @@ class IAPIObject { _checkStorageSupport(); if (!window.sessionStorage.getItem(this.storage_key)) return false; - return new APIToken(window.sessionStorage.getItem(this.storage_key)); + return new APIToken(JSON.parse(window.sessionStorage.getItem(this.storage_key))); } /** @returns {boolean} */ diff --git a/pairent_frontend_react/src/components/CardApartament/index.jsx b/pairent_frontend_react/src/components/CardApartament/index.jsx index 057a901..a1be279 100644 --- a/pairent_frontend_react/src/components/CardApartament/index.jsx +++ b/pairent_frontend_react/src/components/CardApartament/index.jsx @@ -159,8 +159,7 @@ const CardApartament = function (props) { } -
{props.results.address}, {props.results.floor} этаж из {props.results.floorHouse}
- +
{props.results.address}, {props.results.floor} этаж из {props.results.floorHouse}
diff --git a/pairent_frontend_react/src/components/Header/index.jsx b/pairent_frontend_react/src/components/Header/index.jsx index 145edf9..7222576 100644 --- a/pairent_frontend_react/src/components/Header/index.jsx +++ b/pairent_frontend_react/src/components/Header/index.jsx @@ -3,7 +3,7 @@ import { Link } from "react-router-dom"; import styled from 'styled-components'; import SVGIcon from '../UI/Icon/SVGIcon'; -// import './styles/Header.css'; +import { User } from '../../API/User'; const HeaderElement = styled.header` min-width: 950px; @@ -56,6 +56,9 @@ const Navbar = styled.nav` `; const Header = function () { + + const user = User.restoreFromLocalStorage(); + return (