Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

UserProfile.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Button, Typography } from "@mui/material";
  2. import { Box } from "@mui/system";
  3. import LogoutIcon from "@mui/icons-material/Logout";
  4. import React from "react";
  5. import { useTranslation } from "react-i18next";
  6. import avatarLogo from "../../assets/images/Avatar.png";
  7. import PropTypes from "prop-types";
  8. import { userSelector } from "../../store/selectors/userSelectors";
  9. import { useSelector } from "react-redux";
  10. const UserProfile = ({ show, innerRef }) => {
  11. const { t } = useTranslation();
  12. // const theme = useTheme();
  13. // const matches = useMediaQuery(theme.breakpoints.down("sm"));
  14. const user = useSelector(userSelector);
  15. return (
  16. <Box className={`user-view flex-center ${show && "active"}`}>
  17. <div
  18. ref={innerRef}
  19. className="flex-center flex-col"
  20. style={{ width: "90%" }}
  21. >
  22. <img src={avatarLogo} width="64px" height="64px" />
  23. <Typography
  24. variant="h5"
  25. sx={{ fontSize: "18px", marginTop: "15px" }}
  26. className="text-blue"
  27. >
  28. {user.firstName + " " + user.lastName}
  29. </Typography>
  30. <Typography
  31. variant="body1"
  32. sx={{ fontSize: "14px", marginTop: "8px" }}
  33. className="text-grey9d"
  34. >
  35. HR Specialist
  36. </Typography>
  37. {/* <div className="hr" style={{ width: "90%", marginTop: "18px" }}></div> */}
  38. <Button
  39. sx={{
  40. padding: "18px 72px",
  41. border: "1px solid #226cb0",
  42. borderRadius: "9px",
  43. background: "white",
  44. width: "90%",
  45. marginTop: "50px",
  46. }}
  47. startIcon={<LogoutIcon />}
  48. >
  49. {t("nav.signOut")}
  50. </Button>
  51. </div>
  52. </Box>
  53. );
  54. };
  55. UserProfile.propTypes = {
  56. show: PropTypes.any,
  57. innerRef: PropTypes.any,
  58. };
  59. export default UserProfile;