diff --git a/src/components/Breadcrumbs/index.js b/src/components/Breadcrumbs/index.js
index 7cec983..a424bc3 100644
--- a/src/components/Breadcrumbs/index.js
+++ b/src/components/Breadcrumbs/index.js
@@ -16,7 +16,7 @@ import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
// @mui material components
-import { Breadcrumbs as MuiBreadcrumbs, Grid } from '@mui/material';
+import { Breadcrumbs as MuiBreadcrumbs, Grid, Toolbar } from '@mui/material';
import ArrowRight from 'assets/images/CarretArrowRightIcon';
// Material Dashboard 2 PRO React components
@@ -24,65 +24,64 @@ import MDBox from 'components/MDBox';
import MDTypography from 'components/MDTypography';
const buildBreadcrumbs = (route, light) => {
- if (route[0] === 'home') route = [];
- else if (route.length === 1) route = ['home'];
- else {
- route = ['home', ...route];
- route.pop();
- }
- return route.map((el) => (
-
+ return route.map((el) => {
+ return el.path ? (
+
+
+ {el.name}
+
+
+ ) : (
- {el}
+ {el.name}
-
- ));
+ );
+ });
};
-function Breadcrumbs({ title, route, light, children }) {
+function Breadcrumbs({ route, light, children }) {
return (
-
-
-
- (light ? white.main : grey[600]),
- padding: '0 8px'
- }
- }}
- separator={}
- >
- {buildBreadcrumbs(route, light)}
-
+
+
+
+ (light ? white.main : grey[600]),
+ padding: '0 8px'
+ }
+ }}
+ separator={}
>
- {title.replace('-', ' ')}
-
-
+ {buildBreadcrumbs(route, light)}
+
+
+
+ {children}
+
-
- {children}
-
-
-
+
+
);
}
@@ -93,7 +92,6 @@ Breadcrumbs.defaultProps = {
// Typechecking props for the Breadcrumbs
Breadcrumbs.propTypes = {
- title: PropTypes.string.isRequired,
route: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,
light: PropTypes.bool,
children: PropTypes.node
diff --git a/src/components/DashboardNavbar/index.js b/src/components/DashboardNavbar/index.js
index 301783e..7206949 100644
--- a/src/components/DashboardNavbar/index.js
+++ b/src/components/DashboardNavbar/index.js
@@ -17,7 +17,7 @@ import { useState, useEffect } from 'react';
// import Grid from '@mui/material/Grid';
// react-router components
-import { useLocation } from 'react-router-dom';
+// import { useLocation } from 'react-router-dom';
import { useDispatch } from 'react-redux';
import AuthActions from 'redux/AuthRedux';
@@ -40,7 +40,7 @@ import MDBox from 'components/MDBox';
// import MDBadge from 'components/MDBadge';
// Material Dashboard 2 PRO React example components
-import Breadcrumbs from 'components/Breadcrumbs';
+// import Breadcrumbs from 'components/Breadcrumbs';
import NotificationItem from 'components/NotificationItem';
// import InputAdornment from '@mui/material/InputAdornment';
@@ -49,7 +49,7 @@ import NotificationItem from 'components/NotificationItem';
import {
// navbar,
// navbarContainer,
- navbarRow,
+ // navbarRow,
navbarIconButton,
// navbarDesktopMenu,
navbarMobileMenu
@@ -81,14 +81,14 @@ const useStyles = makeStyles(() => ({
}
}));
-function DashboardNavbar({ absolute, light, isMini, children }) {
+function DashboardNavbar({ absolute, light, isMini /*, children*/ }) {
const [navbarType, setNavbarType] = useState();
const [controller, dispatch] = useMaterialUIController();
const { miniSidenav, transparentNavbar, fixedNavbar, /*openConfigurator,*/ darkMode } =
controller;
// const [openMenu, setOpenMenu] = useState(false);
const [openProfileMenu, setOpenProfileMenu] = useState(false);
- const route = useLocation().pathname.split('/').slice(1);
+ // const route = useLocation().pathname.split('/').slice(1);
const dispatchLogout = useDispatch();
const handleLogout = () => dispatchLogout(AuthActions.logout());
const classes = useStyles();
@@ -270,13 +270,13 @@ function DashboardNavbar({ absolute, light, isMini, children }) {
)}
-
+ {/*
navbarRow(theme, { isMini })}>
{children}
-
+ */}
);
}
diff --git a/src/pages/addNewProduct/index.js b/src/pages/addNewProduct/index.js
index 884350f..f7ec80a 100644
--- a/src/pages/addNewProduct/index.js
+++ b/src/pages/addNewProduct/index.js
@@ -19,6 +19,7 @@ import { useDispatch } from 'react-redux';
import ProductActions from 'redux/ProductsRedux';
import { API } from 'constant';
import LOGGER from 'services/Logger';
+import Breadcrumbs from 'components/Breadcrumbs';
const useStyles = makeStyles({
labelSize: {
@@ -118,6 +119,15 @@ function AddNewProduct() {
<>
+
diff --git a/src/pages/homepage/index.js b/src/pages/homepage/index.js
index f0d9509..6bbb8c7 100644
--- a/src/pages/homepage/index.js
+++ b/src/pages/homepage/index.js
@@ -5,6 +5,7 @@ import SearchInventoryIcon from 'assets/images/SearchInventoryIcon';
import ReportsIcon from 'assets/images/ReportsIcon';
import ScanIcon from 'assets/images/ScanIcon';
import TileBasic from 'components/TileBasic';
+import Breadcrumbs from 'components/Breadcrumbs';
function HomepageScreen() {
const data = [
@@ -36,6 +37,7 @@ function HomepageScreen() {
return (
+
);
diff --git a/src/pages/inventory/index.js b/src/pages/inventory/index.js
index d8fb38b..0fca129 100644
--- a/src/pages/inventory/index.js
+++ b/src/pages/inventory/index.js
@@ -15,6 +15,7 @@ import { API } from 'constant';
import { useDispatch } from 'react-redux';
import InventoryActions from 'redux/InventoryRedux';
import LOGGER from 'services/Logger';
+import Breadcrumbs from 'components/Breadcrumbs';
const customStyles = {
labelSize: {
@@ -158,6 +159,14 @@ function InventoryScreen() {
return (
+
diff --git a/src/pages/setup/index.js b/src/pages/setup/index.js
index 76e0622..8de29c1 100644
--- a/src/pages/setup/index.js
+++ b/src/pages/setup/index.js
@@ -5,6 +5,7 @@ import InventoryIcon from 'assets/images/InventoryIcon';
import ProfileCircleIcon from 'assets/images/ProfileCircleIcon';
import LabelIcon from 'assets/images/LabelIcon';
import TileBasic from 'components/TileBasic';
+import Breadcrumbs from 'components/Breadcrumbs';
function SetupHome() {
const data = [
@@ -32,6 +33,7 @@ function SetupHome() {
return (
+
);
diff --git a/src/pages/setupInventory/index.js b/src/pages/setupInventory/index.js
index 82b3f74..7cbac15 100644
--- a/src/pages/setupInventory/index.js
+++ b/src/pages/setupInventory/index.js
@@ -9,9 +9,9 @@ import { Grid } from '@mui/material';
import Tile from 'components/TileComponent';
import MDButton from 'components/Button';
import { useNavigate } from 'react-router-dom';
+import Breadcrumbs from 'components/Breadcrumbs';
-function SetupInventory()
-{
+function SetupInventory() {
const navigate = useNavigate();
const tiles = [
@@ -43,11 +43,22 @@ function SetupInventory()
];
return (
-
- navigate('/setup/inventory/inventory-new')}>
- Add new Inventory
+
+
+ navigate('/setup/inventory/inventory-new')}
+ >
+ Add new Inventory
-
+
{tiles &&
diff --git a/src/pages/warehouse/index.js b/src/pages/warehouse/index.js
index 33c679b..e034a9e 100644
--- a/src/pages/warehouse/index.js
+++ b/src/pages/warehouse/index.js
@@ -9,6 +9,7 @@ import { WarehouseSelectors } from 'redux/WarehouseRedux';
import WarehouseIcon from 'assets/images/WarehouseIcon';
import MDButton from 'components/Button';
import { useNavigate } from 'react-router-dom';
+import Breadcrumbs from 'components/Breadcrumbs';
function WarehouseScreen() {
const dispatch = useDispatch();
@@ -26,7 +27,14 @@ function WarehouseScreen() {
return (
-
+
+
Add new Warehouse
-
+
({
...warehouse,
diff --git a/src/services/ValidationServices.js b/src/services/ValidationServices.js
index 2fad8c9..58576bb 100644
--- a/src/services/ValidationServices.js
+++ b/src/services/ValidationServices.js
@@ -25,7 +25,7 @@ const schema = {
inventorytype: Yup.array('Enter inventory Type')
.of(Yup.string())
.required('inventory Type is required'),
- attributes: Yup.string('Enter other attributes').required('attributes is required')
+ attributes: Yup.string('Enter other attributes')
}),
addNewProduct: Yup.object({