New Changes in login and title menu.
needed fix the reactive actions in user profilepull/14/head^2
parent
a6d380862f
commit
87e0d61281
|
@ -1,4 +1,5 @@
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
import { color } from "../../../style/varibles";
|
||||||
|
|
||||||
const MainContainerStyled = styled.main`
|
const MainContainerStyled = styled.main`
|
||||||
padding-left: 97px;
|
padding-left: 97px;
|
||||||
|
@ -21,6 +22,9 @@ const ContentContainerStyled = styled.div`
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: ${color.complement.azulOscuro};
|
||||||
|
padding: 6px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default MainContainerStyled;
|
export default MainContainerStyled;
|
||||||
|
|
|
@ -9,14 +9,11 @@ import logo from "../../assets/images/Logo.png";
|
||||||
|
|
||||||
const PageTitle = () => {
|
const PageTitle = () => {
|
||||||
const path = useLocation();
|
const path = useLocation();
|
||||||
const [title,setTitle] = React.useState()
|
const [title, setTitle] = React.useState();
|
||||||
const [modal, setModal] = React.useState(false);
|
const [modal, setModal] = React.useState(false);
|
||||||
const { user } = React.useContext(AuthContext);
|
const { user } = React.useContext(AuthContext);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
console.log(path.pathname);
|
|
||||||
|
|
||||||
React.useEffect(()=>{
|
|
||||||
switch (path.pathname) {
|
switch (path.pathname) {
|
||||||
case "/tickets":
|
case "/tickets":
|
||||||
setTitle("Tickets");
|
setTitle("Tickets");
|
||||||
|
@ -51,7 +48,7 @@ const PageTitle = () => {
|
||||||
default:
|
default:
|
||||||
setTitle("Dashboard");
|
setTitle("Dashboard");
|
||||||
}
|
}
|
||||||
},[path])
|
}, [path]);
|
||||||
|
|
||||||
const handleModal = () => {
|
const handleModal = () => {
|
||||||
setModal(!modal);
|
setModal(!modal);
|
||||||
|
|
|
@ -34,7 +34,7 @@ const UserBtn = ({ user, img, modal, modalSet }) => {
|
||||||
<UserItem title="Sair" icon={<Signoff />} onClick={handleModal} />
|
<UserItem title="Sair" icon={<Signoff />} onClick={handleModal} />
|
||||||
</UserModalListStyled>
|
</UserModalListStyled>
|
||||||
</UserModalStyled>
|
</UserModalStyled>
|
||||||
<UserModal modal={modalUser} click={handleModalUser}/>
|
<UserModal modal={modalUser} click={handleModalUser} userId={user.id}/>
|
||||||
<ConfirmationModal title="Sair?" modal={modalConfirm} click={{ handleModal, handleLogout }}>
|
<ConfirmationModal title="Sair?" modal={modalConfirm} click={{ handleModal, handleLogout }}>
|
||||||
Deseja Sair do sistema?
|
Deseja Sair do sistema?
|
||||||
</ConfirmationModal>
|
</ConfirmationModal>
|
||||||
|
|
|
@ -7,8 +7,7 @@ import { i18n } from "../translate/i18n";
|
||||||
import MenuComponent from "../components/Menu/MenuComponent";
|
import MenuComponent from "../components/Menu/MenuComponent";
|
||||||
|
|
||||||
const LoggedInLayout = ({ children }) => {
|
const LoggedInLayout = ({ children }) => {
|
||||||
const { handleLogout, loading, isAuth } = React.useContext(AuthContext);
|
const { loading, user } = React.useContext(AuthContext);
|
||||||
|
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
|
|
Loading…
Reference in New Issue