diff --git a/src/assets/Cheminova.png b/src/assets/Cheminova.png new file mode 100644 index 0000000..be511ec Binary files /dev/null and b/src/assets/Cheminova.png differ diff --git a/src/assets/logo.jpg b/src/assets/logo.jpg deleted file mode 100644 index fff78c4..0000000 Binary files a/src/assets/logo.jpg and /dev/null differ diff --git a/src/components/AppFooter.js b/src/components/AppFooter.js index a058e3d..d5376f0 100644 --- a/src/components/AppFooter.js +++ b/src/components/AppFooter.js @@ -3,7 +3,7 @@ import { CFooter } from '@coreui/react' const AppFooter = () => { return ( - + {/*
CoreUI diff --git a/src/components/AppHeader.js b/src/components/AppHeader.js index d2a24e4..2ebac5a 100644 --- a/src/components/AppHeader.js +++ b/src/components/AppHeader.js @@ -45,7 +45,18 @@ const AppHeader = () => { }, []) return ( - + dispatch({ type: 'set', sidebarShow: !sidebarShow })} diff --git a/src/components/AppSidebar.js b/src/components/AppSidebar.js index 3b99a74..0ff11e2 100644 --- a/src/components/AppSidebar.js +++ b/src/components/AppSidebar.js @@ -13,7 +13,7 @@ import CIcon from '@coreui/icons-react' import { AppSidebarNav } from './AppSidebarNav' -import logo from 'src/assets/logo.jpg' +import logo from 'src/assets/Cheminova.png' import { sygnet } from 'src/assets/brand/sygnet' // sidebar nav config @@ -31,18 +31,19 @@ const AppSidebar = () => { position="fixed" unfoldable={unfoldable} visible={sidebarShow} + style={{ background: '#179FAF' }} onVisibleChange={(visible) => { dispatch({ type: 'set', sidebarShow: visible }) }} > - + {/* */} @@ -52,7 +53,18 @@ const AppSidebar = () => { onClick={() => dispatch({ type: 'set', sidebarShow: false })} /> - +
+ +
+ dispatch({ type: 'set', sidebarUnfoldable: !unfoldable })} diff --git a/src/components/AppSidebarNav.js b/src/components/AppSidebarNav.js index 6b73cec..3f603c8 100644 --- a/src/components/AppSidebarNav.js +++ b/src/components/AppSidebarNav.js @@ -1,3 +1,79 @@ +// import React from 'react' +// import { NavLink } from 'react-router-dom' +// import PropTypes from 'prop-types' + +// import SimpleBar from 'simplebar-react' +// import 'simplebar-react/dist/simplebar.min.css' + +// import { CBadge, CNavLink, CSidebarNav } from '@coreui/react' + +// export const AppSidebarNav = ({ items }) => { +// const navLink = (name, icon, badge, indent = false) => { +// return ( +// <> +// {icon +// ? icon +// : indent && ( +// +// +// +// )} +// {name && name} +// {badge && ( +// +// {badge.text} +// +// )} +// +// ) +// } + +// const navItem = (item, index, indent = false) => { +// const { component, name, badge, icon, ...rest } = item +// const Component = component +// return ( +// +// {rest.to || rest.href ? ( +// +// {navLink(name, icon, badge, indent)} +// +// ) : ( +// navLink(name, icon, badge, indent) +// )} +// +// ) +// } + +// const navGroup = (item, index) => { +// const { component, name, icon, items, to, ...rest } = item +// const Component = component +// return ( +// +// {item.items?.map((item, index) => +// item.items ? navGroup(item, index) : navItem(item, index, true), +// )} +// +// ) +// } + +// return ( +// +// {items && +// items.map((item, index) => (item.items ? navGroup(item, index) : navItem(item, index)))} +// +// ) +// } + +// AppSidebarNav.propTypes = { +// items: PropTypes.arrayOf(PropTypes.any).isRequired, +// } import React from 'react' import { NavLink } from 'react-router-dom' import PropTypes from 'prop-types' @@ -34,7 +110,19 @@ export const AppSidebarNav = ({ items }) => { return ( {rest.to || rest.href ? ( - + ({ + backgroundColor: isActive ? '#0B0689' : 'white', + color: isActive ? 'white' : 'black', + display: 'flex', + alignItems: 'center', + padding: '10px 15px', + textDecoration: 'none', + marginBottom: '0.3rem', + })} + > {navLink(name, icon, badge, indent)} ) : ( @@ -45,12 +133,12 @@ export const AppSidebarNav = ({ items }) => { } const navGroup = (item, index) => { - const { component, name, icon, items, to, ...rest } = item + const { component, name, icon, items, ...rest } = item const Component = component return ( - {item.items?.map((item, index) => - item.items ? navGroup(item, index) : navItem(item, index, true), + {items?.map((subItem, subIndex) => + subItem.items ? navGroup(subItem, subIndex) : navItem(subItem, subIndex, true), )} ) diff --git a/src/components/DocsCallout.js b/src/components/DocsCallout.js index 926ebfc..43b1ec4 100644 --- a/src/components/DocsCallout.js +++ b/src/components/DocsCallout.js @@ -10,7 +10,7 @@ const DocsCallout = (props) => { const _href = `https://coreui.io/react/docs/${href}` return ( - + {content ? content : `A React ${name} component ${ diff --git a/src/components/header/AppHeaderDropdown.js b/src/components/header/AppHeaderDropdown.js index d992b72..d5171b4 100644 --- a/src/components/header/AppHeaderDropdown.js +++ b/src/components/header/AppHeaderDropdown.js @@ -40,13 +40,13 @@ const AppHeaderDropdown = () => { const [user, setUser] = useState(null) const token = isAutheticated() const getData = async () => { - let res = await Axios.get(`/api/rd-get-me`, { + let res = await Axios.get(`/api/v1/user/details`, { headers: { Authorization: `Bearer ${token}`, }, }) - if (res.status === 200) { - setUser({ ...res.data.myData }) + if (res.data.success) { + setUser({ ...res.data.user }) } } useEffect(() => { diff --git a/src/layout/DefaultLayout.js b/src/layout/DefaultLayout.js index 19fbf22..1c8fe3e 100644 --- a/src/layout/DefaultLayout.js +++ b/src/layout/DefaultLayout.js @@ -3,7 +3,7 @@ import { AppContent, AppSidebar, AppFooter, AppHeader } from '../components/inde const DefaultLayout = () => { return ( -
+
diff --git a/src/views/pages/forgetPassword.js b/src/views/pages/forgetPassword.js index 59fad2b..d41d93b 100644 --- a/src/views/pages/forgetPassword.js +++ b/src/views/pages/forgetPassword.js @@ -43,7 +43,10 @@ const ForgetPassword = () => { } return ( <> -
+
diff --git a/src/views/pages/login/Login.js b/src/views/pages/login/Login.js index 3c83678..f1eb7ef 100644 --- a/src/views/pages/login/Login.js +++ b/src/views/pages/login/Login.js @@ -116,7 +116,10 @@ const Login = () => { } return ( -
+