changes in phase 2
This commit is contained in:
parent
5e61c94f23
commit
59927c28be
@ -1,6 +1,7 @@
|
|||||||
import React, { useRef, useEffect } from 'react';
|
import React, { useRef, useEffect } from 'react';
|
||||||
import { NavLink, useNavigate } from 'react-router-dom';
|
import { NavLink, useNavigate } from 'react-router-dom';
|
||||||
import { logout as logoutApi } from '@/services/auth/authService';
|
import { logout as logoutApi } from '@/services/auth/authService';
|
||||||
|
import { TbReport } from "react-icons/tb";
|
||||||
|
|
||||||
const logoSrc = '/assets/images/FCSCLogo.svg';
|
const logoSrc = '/assets/images/FCSCLogo.svg';
|
||||||
const dashboardIconActiveSrc = '/assets/images/cuida_dashboard-outline.svg';
|
const dashboardIconActiveSrc = '/assets/images/cuida_dashboard-outline.svg';
|
||||||
@ -8,42 +9,58 @@ const dashboardIconInactiveSrc = '/assets/images/cuida_dashboard-outline-inactiv
|
|||||||
const checkCircleActiveSrc = '/assets/images/CheckCircle-active.svg';
|
const checkCircleActiveSrc = '/assets/images/CheckCircle-active.svg';
|
||||||
const configActiveSrc = '/assets/images/configrationicon-active.svg';
|
const configActiveSrc = '/assets/images/configrationicon-active.svg';
|
||||||
const configInactiveSrc = '/assets/images/configrationicon-inactive.svg';
|
const configInactiveSrc = '/assets/images/configrationicon-inactive.svg';
|
||||||
|
const manufacturingIndexActive = <TbReport className="text-[#92722A]" />;
|
||||||
|
const manufacturingIndexInactive = <TbReport className="text-[#232528]" />;
|
||||||
const userActiveSrc = '/assets/images/User-active.svg';
|
const userActiveSrc = '/assets/images/User-active.svg';
|
||||||
const userInactiveSrc = '/assets/images/User-inactive.svg';
|
const userInactiveSrc = '/assets/images/User-inactive.svg';
|
||||||
const manageSubmissionInactiveSrc = '/assets/images/managesubmission - inactive.svg';
|
const manageSubmissionInactiveSrc = '/assets/images/managesubmission - inactive.svg';
|
||||||
const bellIconSrc = '/assets/images/Bell.svg';
|
const bellIconSrc = '/assets/images/Bell.svg';
|
||||||
|
|
||||||
const NavItem = ({ label, to, iconActive, iconInactive, end = false }) => (
|
const NavItem = ({ label, to, iconActive, iconInactive, end = false }) => {
|
||||||
<NavLink
|
const isReactElement = React.isValidElement(iconActive) || React.isValidElement(iconInactive);
|
||||||
to={to}
|
|
||||||
end={end}
|
return (
|
||||||
className={({ isActive }) =>
|
<NavLink
|
||||||
`inline-flex items-center gap-2 pb-1 border-b-2 text-[14px] leading-5 ` +
|
to={to}
|
||||||
(isActive
|
end={end}
|
||||||
? 'text-[#92722A] font-medium border-[#92722A]'
|
className={({ isActive }) =>
|
||||||
: 'text-[#232528] border-transparent hover:text-gray-900')
|
`inline-flex items-center gap-2 pb-1 border-b-2 text-[14px] leading-5 ` +
|
||||||
}
|
(isActive
|
||||||
>
|
? 'text-[#92722A] font-medium border-[#92722A]'
|
||||||
{({ isActive }) => (
|
: 'text-[#232528] border-transparent hover:text-gray-900')
|
||||||
<>
|
}
|
||||||
{iconActive && iconInactive ? (
|
>
|
||||||
<img
|
{({ isActive }) => {
|
||||||
src={isActive ? iconActive : iconInactive}
|
const icon = isActive ? iconActive : iconInactive;
|
||||||
alt={label}
|
|
||||||
className="h-[18px] w-[18px]"
|
return (
|
||||||
/>
|
<>
|
||||||
) : (
|
{isReactElement ? (
|
||||||
<span
|
<span className={`h-[18px] w-[18px] flex items-center justify-center ${
|
||||||
className={`inline-block h-[18px] w-[18px] rounded ${
|
isActive ? 'text-[#92722A]' : 'text-[#6B7280]'
|
||||||
isActive ? 'bg-[#92722A]' : 'bg-[#C9CDD1]'
|
}`}>
|
||||||
}`}
|
{React.cloneElement(icon, { style: { fontSize: 18 } })}
|
||||||
/>
|
</span>
|
||||||
)}
|
) : icon ? (
|
||||||
<span>{label}</span>
|
<img
|
||||||
</>
|
src={icon}
|
||||||
)}
|
alt={label}
|
||||||
</NavLink>
|
className="h-[18px] w-[18px]"
|
||||||
);
|
/>
|
||||||
|
) : (
|
||||||
|
<span
|
||||||
|
className={`inline-block h-[18px] w-[18px] rounded ${
|
||||||
|
isActive ? 'bg-[#92722A]' : 'bg-[#C9CDD1]'
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<span>{label}</span>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</NavLink>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const AdminHeader = () => {
|
const AdminHeader = () => {
|
||||||
const [open, setOpen] = React.useState(false);
|
const [open, setOpen] = React.useState(false);
|
||||||
@ -149,8 +166,8 @@ const AdminHeader = () => {
|
|||||||
<NavItem
|
<NavItem
|
||||||
to="/manufacturing-index"
|
to="/manufacturing-index"
|
||||||
label="Manufacturing Index"
|
label="Manufacturing Index"
|
||||||
iconActive={configActiveSrc}
|
iconActive={manufacturingIndexActive}
|
||||||
iconInactive={configInactiveSrc}
|
iconInactive={manufacturingIndexInactive}
|
||||||
/>
|
/>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,8 @@ import {
|
|||||||
InfoOutlined as InfoOutlinedIcon,
|
InfoOutlined as InfoOutlinedIcon,
|
||||||
NavigateNext as NavigateNextIcon
|
NavigateNext as NavigateNextIcon
|
||||||
} from '@mui/icons-material';
|
} from '@mui/icons-material';
|
||||||
import { Breadcrumbs, Link } from '@mui/material';
|
import { Breadcrumbs } from '@mui/material';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import Card from '@/components/common/Card';
|
import Card from '@/components/common/Card';
|
||||||
import { getManufacturingIndex, getManufacturingMonthlyOverview } from '@/services/manufacturingIndex/ManufacturingIndex';
|
import { getManufacturingIndex, getManufacturingMonthlyOverview } from '@/services/manufacturingIndex/ManufacturingIndex';
|
||||||
|
|
||||||
@ -453,7 +454,7 @@ const ManufacturingIndex = () => {
|
|||||||
<nav className="mb-6 text-sm text-[#8F9299] flex items-center gap-2">
|
<nav className="mb-6 text-sm text-[#8F9299] flex items-center gap-2">
|
||||||
<Link
|
<Link
|
||||||
to="/admin/dashboard"
|
to="/admin/dashboard"
|
||||||
className="font-bold flex items-center gap-1 !text-black no-underline hover:underline hover:!text-black"
|
className="font-bold flex items-center gap-1 !text-black no-underline hover:underline hover:!text-black cursor-pointer"
|
||||||
>
|
>
|
||||||
Dashboard
|
Dashboard
|
||||||
<img src="/assets/images/Breadcrumb-vector.svg" alt="" className="ml-1 w-3 h-3" />
|
<img src="/assets/images/Breadcrumb-vector.svg" alt="" className="ml-1 w-3 h-3" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user