|
|
|
@@ -7,9 +7,12 @@ import avatarLogo from "../../assets/images/Avatar.png"; |
|
|
|
import PropTypes from "prop-types"; |
|
|
|
import { useDispatch, useSelector } from "react-redux"; |
|
|
|
import { logoutUser } from "../../store/actions/login/loginActions"; |
|
|
|
import IconButton from "../IconButton/IconButton"; |
|
|
|
import en from "../../assets/images/en.png"; |
|
|
|
import rs from "../../assets/images/rs.png"; |
|
|
|
|
|
|
|
const UserProfile = ({ show, innerRef }) => { |
|
|
|
const { t } = useTranslation(); |
|
|
|
const { t, i18n } = useTranslation(); |
|
|
|
const dispatch = useDispatch(); |
|
|
|
// const theme = useTheme(); |
|
|
|
// const matches = useMediaQuery(theme.breakpoints.down("sm")); |
|
|
|
@@ -19,6 +22,12 @@ const UserProfile = ({ show, innerRef }) => { |
|
|
|
dispatch(logoutUser()); |
|
|
|
}; |
|
|
|
|
|
|
|
const changeLanguageHandler = () => { |
|
|
|
i18n.language === "en" |
|
|
|
? i18n.changeLanguage("rs") |
|
|
|
: i18n.changeLanguage("en"); |
|
|
|
}; |
|
|
|
|
|
|
|
return ( |
|
|
|
<Box className={`user-view flex-center ${show && "active"}`}> |
|
|
|
<div |
|
|
|
@@ -41,6 +50,46 @@ const UserProfile = ({ show, innerRef }) => { |
|
|
|
> |
|
|
|
HR {t("common.specialist")} |
|
|
|
</Typography> |
|
|
|
{/* <div> |
|
|
|
<Button |
|
|
|
type="button" |
|
|
|
variant="contained" |
|
|
|
className="c-btn c-btn--primary" |
|
|
|
onClick={changeLanguageHandler} |
|
|
|
> |
|
|
|
Change Language |
|
|
|
</Button> |
|
|
|
</div> */} |
|
|
|
<div className="change-language"> |
|
|
|
<IconButton |
|
|
|
className={`c-btn--primary-outlined c-btn ${ |
|
|
|
i18n.language === "rs" && "change-language-active-button" |
|
|
|
}`} |
|
|
|
onClick={changeLanguageHandler} |
|
|
|
> |
|
|
|
<img |
|
|
|
style={{ |
|
|
|
position: "relative", |
|
|
|
}} |
|
|
|
src={rs} |
|
|
|
/> |
|
|
|
RS |
|
|
|
</IconButton> |
|
|
|
<IconButton |
|
|
|
className={`c-btn--primary-outlined c-btn ${ |
|
|
|
i18n.language === "en" && "change-language-active-button" |
|
|
|
}`} |
|
|
|
onClick={changeLanguageHandler} |
|
|
|
> |
|
|
|
<img |
|
|
|
style={{ |
|
|
|
position: "relative", |
|
|
|
}} |
|
|
|
src={en} |
|
|
|
/> |
|
|
|
EN |
|
|
|
</IconButton> |
|
|
|
</div> |
|
|
|
{/* <div className="hr" style={{ width: "90%", marginTop: "18px" }}></div> */} |
|
|
|
|
|
|
|
<Button |
|
|
|
@@ -50,7 +99,7 @@ const UserProfile = ({ show, innerRef }) => { |
|
|
|
borderRadius: "9px", |
|
|
|
background: "white", |
|
|
|
width: "90%", |
|
|
|
marginTop: "50px", |
|
|
|
// marginTop: "50px", |
|
|
|
}} |
|
|
|
onClick={logout} |
|
|
|
startIcon={<LogoutIcon />} |