Added tech routing paths and basic structure of landing page + sign in + reducers BOD-95
This commit is contained in:
67
client/src/components/tech-sider/tech-sider.component.jsx
Normal file
67
client/src/components/tech-sider/tech-sider.component.jsx
Normal file
@@ -0,0 +1,67 @@
|
||||
import Icon, { SearchOutlined } from "@ant-design/icons";
|
||||
import { Layout, Menu } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FiLogIn, FiLogOut } from "react-icons/fi";
|
||||
import { MdTimer, MdTimerOff } from "react-icons/md";
|
||||
import { connect } from "react-redux";
|
||||
import { Link } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||
const { Sider } = Layout;
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
technician: selectTechnician,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
|
||||
export function TechSider({ technician }) {
|
||||
const [collapsed, setCollapsed] = useState(true);
|
||||
const { t } = useTranslation();
|
||||
const onCollapse = (collapsed) => {
|
||||
setCollapsed(collapsed);
|
||||
};
|
||||
|
||||
return (
|
||||
<Sider collapsible collapsed={collapsed} onCollapse={onCollapse}>
|
||||
<Menu theme='dark' defaultSelectedKeys={["1"]} mode='inline'>
|
||||
<Menu.Item
|
||||
key='1'
|
||||
disabled={!!technician}
|
||||
icon={<Icon component={FiLogIn} />}>
|
||||
<Link to={`/tech/login`}>{t("menus.tech.login")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key='2' disabled={!!!technician} icon={<SearchOutlined />}>
|
||||
<Link to={`/tech/lookup`}>{t("menus.tech.joblookup")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key='3'
|
||||
disabled={!!!technician}
|
||||
icon={<Icon component={MdTimer} />}>
|
||||
<Link to={`/tech/clockin`}>{t("menus.tech.clockin")}</Link>
|
||||
</Menu.Item>{" "}
|
||||
<Menu.Item
|
||||
key='4'
|
||||
disabled={!!!technician}
|
||||
icon={<Icon component={MdTimerOff} />}>
|
||||
<Link to={`/tech/clockout`}>{t("menus.tech.clockout")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key='5' disabled={!!!technician} icon={<SearchOutlined />}>
|
||||
<Link to={`/tech/list`}>{t("menus.tech.productionlist")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key='6' disabled={!!!technician} icon={<SearchOutlined />}>
|
||||
<Link to={`/tech/board`}> {t("menus.tech.productionboard")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key='7'
|
||||
disabled={!!!technician}
|
||||
icon={<Icon component={FiLogOut} />}>
|
||||
<Link to={`/tech/logout`}>{t("menus.tech.logout")}</Link>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
</Sider>
|
||||
);
|
||||
}
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(TechSider);
|
||||
Reference in New Issue
Block a user