Added login functionality for tech BOD-95

This commit is contained in:
Patrick Fic
2020-06-29 15:24:04 -07:00
parent 2edfadce3a
commit 0e9cc9620b
27 changed files with 552 additions and 115 deletions

View File

@@ -8,16 +8,17 @@ import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import { selectTechnician } from "../../redux/tech/tech.selectors";
import { techLogout } from "../../redux/tech/tech.actions";
const { Sider } = Layout;
const mapStateToProps = createStructuredSelector({
technician: selectTechnician,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
techLogout: () => dispatch(techLogout()),
});
export function TechSider({ technician }) {
export function TechSider({ technician, techLogout }) {
const [collapsed, setCollapsed] = useState(true);
const { t } = useTranslation();
const onCollapse = (collapsed) => {
@@ -57,8 +58,9 @@ export function TechSider({ technician }) {
<Menu.Item
key='7'
disabled={!!!technician}
onClick={() => techLogout()}
icon={<Icon component={FiLogOut} />}>
<Link to={`/tech/logout`}>{t("menus.tech.logout")}</Link>
{t("menus.tech.logout")}
</Menu.Item>
</Menu>
</Sider>