more add
parent
390772eb91
commit
0d0d23657a
Binary file not shown.
After Width: | Height: | Size: 517 KiB |
|
@ -2,11 +2,11 @@ import React from "react";
|
||||||
import LabelComponent from "../Label/LabelComponent";
|
import LabelComponent from "../Label/LabelComponent";
|
||||||
import { InputComponentStyled, InputContainerStyled } from "./InputComponent.style";
|
import { InputComponentStyled, InputContainerStyled } from "./InputComponent.style";
|
||||||
|
|
||||||
const InputComponent = ({ type, id, label, ...props }) => {
|
const InputComponent = ({ type, id, label, value, ...props }) => {
|
||||||
return (
|
return (
|
||||||
<InputContainerStyled>
|
<InputContainerStyled>
|
||||||
<LabelComponent forhtml={id} label={label} />
|
<LabelComponent forhtml={id} label={label} />
|
||||||
<InputComponentStyled type={type} id={id} {...props} />
|
<InputComponentStyled type={type} id={id} value={value} {...props} />
|
||||||
</InputContainerStyled>
|
</InputContainerStyled>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,6 +9,9 @@ const MainContainerStyled = styled.main`
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
height: 96vh;
|
height: 96vh;
|
||||||
|
@media only screen and (max-height: 790px) {
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
const TitleContainerStyled = styled.div`
|
const TitleContainerStyled = styled.div`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -73,6 +73,9 @@ const MenuListItemStyled = styled.li`
|
||||||
fill: ${color.pricinpal.naranja};
|
fill: ${color.pricinpal.naranja};
|
||||||
transition: all 0.1s linear;
|
transition: all 0.1s linear;
|
||||||
}
|
}
|
||||||
|
@media only screen and (max-height: 790px) {
|
||||||
|
margin: 6px 28px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export { MenuStyled, MenuListStyled, MenuListItemStyled };
|
export { MenuStyled, MenuListStyled, MenuListItemStyled };
|
||||||
|
|
|
@ -40,6 +40,7 @@ const UserModalStyled = styled.div`
|
||||||
right: 2rem;
|
right: 2rem;
|
||||||
top: 5.5rem;
|
top: 5.5rem;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
z-index: 999;
|
||||||
box-shadow: ${color.shadow.dark} ${color.gradient.bgOpacity};
|
box-shadow: ${color.shadow.dark} ${color.gradient.bgOpacity};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,16 @@ import UserModal from "../../UserModal/UserModal";
|
||||||
|
|
||||||
const UserBtn = ({ user, img, modal, modalSet }) => {
|
const UserBtn = ({ user, img, modal, modalSet }) => {
|
||||||
const [modalConfirm, setModalConfirm] = React.useState(false);
|
const [modalConfirm, setModalConfirm] = React.useState(false);
|
||||||
|
const [modalUser, setModalUser] = React.useState(false);
|
||||||
const { handleLogout } = React.useContext(AuthContext);
|
const { handleLogout } = React.useContext(AuthContext);
|
||||||
|
|
||||||
const handleModal = () => {
|
const handleModal = () => {
|
||||||
setModalConfirm(!modalConfirm);
|
setModalConfirm(!modalConfirm);
|
||||||
};
|
};
|
||||||
|
const handleModalUser = (e)=>{
|
||||||
|
e.preventDefault()
|
||||||
|
setModalUser(!modalUser)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -23,13 +28,13 @@ const UserBtn = ({ user, img, modal, modalSet }) => {
|
||||||
<img src={img} alt={user ? user.name : null} width="24px" />
|
<img src={img} alt={user ? user.name : null} width="24px" />
|
||||||
Bem Vindo, {user ? user.name : null}
|
Bem Vindo, {user ? user.name : null}
|
||||||
</UserBtnStyled>
|
</UserBtnStyled>
|
||||||
<UserModalStyled modal={modal}>
|
<UserModalStyled modal={modal} onMouseLeave={modalSet}>
|
||||||
<UserModalListStyled>
|
<UserModalListStyled>
|
||||||
<UserItem title="Perfil" icon={<Perfil />} />
|
<UserItem title="Perfil" icon={<Perfil />} onClick={handleModalUser} />
|
||||||
<UserItem title="Sair" icon={<Signoff />} onClick={handleModal} />
|
<UserItem title="Sair" icon={<Signoff />} onClick={handleModal} />
|
||||||
</UserModalListStyled>
|
</UserModalListStyled>
|
||||||
</UserModalStyled>
|
</UserModalStyled>
|
||||||
<UserModal />
|
<UserModal modal={modalUser} click={handleModalUser}/>
|
||||||
<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>
|
||||||
|
|
|
@ -1,37 +1,43 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { color } from "../../style/varibles";
|
||||||
import { ModalOverlayStyled, UserModalStyled, UserBtns } from "./UserModal.style";
|
import { ModalOverlayStyled, UserModalStyled, UserBtns } from "./UserModal.style";
|
||||||
|
|
||||||
import api from "../../services/api";
|
import api from "../../services/api";
|
||||||
import { AuthContext } from "../../context/Auth/AuthContext";
|
import { AuthContext } from "../../context/Auth/AuthContext";
|
||||||
import { Can } from "../Can";
|
import { Can } from "../Can";
|
||||||
import BtnComponent from "../Base/BTN/Btn";
|
|
||||||
|
|
||||||
|
import BtnComponent from "../Base/BTN/Btn";
|
||||||
import FormComponent from "../Base/Form/FormComponent";
|
import FormComponent from "../Base/Form/FormComponent";
|
||||||
import InputComponent from "../Base/Form/Input/InputComponent";
|
import InputComponent from "../Base/Form/Input/InputComponent";
|
||||||
|
import UserModalComponent from "./UserModalImg/UserModalComponent";
|
||||||
|
|
||||||
const style = {
|
import UserImg from "../../assets/images/User/user.jpg";
|
||||||
width: "100%",
|
|
||||||
justifyContent: "flex-start",
|
const UserModal = ({ modal, click }) => {
|
||||||
display: "flex",
|
const { user } = React.useContext(AuthContext);
|
||||||
flexDirection: "column",
|
|
||||||
alignItems: "center",
|
const initalData = {
|
||||||
}
|
name: user.name,
|
||||||
|
email: user.email,
|
||||||
|
perfil:user.profile,
|
||||||
|
}
|
||||||
|
console.log(user);
|
||||||
|
|
||||||
const UserModal = () => {
|
|
||||||
return (
|
return (
|
||||||
<ModalOverlayStyled>
|
<ModalOverlayStyled modal={modal}>
|
||||||
<UserModalStyled>
|
<UserModalStyled>
|
||||||
<div style={style}>
|
<UserModalComponent img={UserImg} desc="Clique na imagem para alterar" />
|
||||||
<h1>Imagem</h1>
|
|
||||||
<p>Desc</p>
|
|
||||||
</div>
|
|
||||||
<FormComponent method="get">
|
<FormComponent method="get">
|
||||||
<InputComponent id="nome" label="Nome" type="text" />
|
<InputComponent id="nome" label="Nome" type="text" value={initalData.name}/>
|
||||||
<InputComponent id="email" label="E-mail" type="email" />
|
<InputComponent id="email" label="E-mail" type="email" value={initalData.email}/>
|
||||||
<InputComponent id="password" label="Senha" type="password" />
|
<InputComponent id="password" label="Senha" type="password" />
|
||||||
<UserBtns>
|
<UserBtns>
|
||||||
<BtnComponent text="Cancelar" />
|
<BtnComponent text="Cancelar" onClick={click} />
|
||||||
<BtnComponent text="Salvar" />
|
<BtnComponent
|
||||||
|
text="Salvar"
|
||||||
|
bgcolor={color.status.yes}
|
||||||
|
fontcolor={color.pricinpal.blanco}
|
||||||
|
/>
|
||||||
</UserBtns>
|
</UserBtns>
|
||||||
</FormComponent>
|
</FormComponent>
|
||||||
</UserModalStyled>
|
</UserModalStyled>
|
||||||
|
@ -41,3 +47,10 @@ const UserModal = () => {
|
||||||
|
|
||||||
export default UserModal;
|
export default UserModal;
|
||||||
|
|
||||||
|
/*{name: 'teste', id: 2, email: 'teste@teste.com', profile: 'master', tokenVersion: 0, …}
|
||||||
|
email: "teste@teste.com"
|
||||||
|
id: 2
|
||||||
|
name: "teste"
|
||||||
|
profile: "master"
|
||||||
|
queues: []
|
||||||
|
tokenVersion: 0 */
|
|
@ -2,15 +2,14 @@ import styled from "styled-components";
|
||||||
import { color } from "../../style/varibles";
|
import { color } from "../../style/varibles";
|
||||||
|
|
||||||
const ModalOverlayStyled = styled.div`
|
const ModalOverlayStyled = styled.div`
|
||||||
/* display: ${({ modal }) => (modal ? "flex" : "none")}; */
|
display: ${({ modal }) => (modal ? "flex" : "none")};
|
||||||
display: flex;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #00000050;
|
background-color: #00000050;
|
||||||
z-index: 9999;
|
z-index: 100;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
`;
|
`;
|
||||||
|
@ -20,15 +19,16 @@ const UserModalStyled = styled.div`
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
z-index: 10000;
|
z-index: 101;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: ${color.pricinpal.grisOscuro};
|
background-color: ${color.pricinpal.grisOscuro};
|
||||||
width: 50%;
|
width: 650px;
|
||||||
`;
|
`;
|
||||||
const UserBtns = styled.div`
|
const UserBtns = styled.div`
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
`;
|
`;
|
||||||
export { ModalOverlayStyled, UserModalStyled,UserBtns };
|
export { ModalOverlayStyled, UserModalStyled, UserBtns };
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import UserModalComponentStyled from "./UserModalComponent.style"
|
||||||
|
|
||||||
|
const UserModalComponent = ({img, desc}) => {
|
||||||
|
return (
|
||||||
|
<UserModalComponentStyled>
|
||||||
|
<img src={img} alt="" />
|
||||||
|
<p>{desc}</p>
|
||||||
|
</UserModalComponentStyled>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default UserModalComponent;
|
|
@ -0,0 +1,27 @@
|
||||||
|
import styled from "styled-components";
|
||||||
|
import { color } from "../../../style/varibles";
|
||||||
|
|
||||||
|
const UserModalComponentStyled = styled.div`
|
||||||
|
width: 100%;
|
||||||
|
max-width: 250px;
|
||||||
|
min-width: 250px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 21px;
|
||||||
|
margin-top: 16px;
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: ${color.pricinpal.blanco};
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Helvetica55";
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default UserModalComponentStyled;
|
||||||
|
|
Loading…
Reference in New Issue