ui Updated
Some checks failed
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled

This commit is contained in:
ROSHAN GARG 2024-12-26 15:27:45 +05:30
parent 48fd705288
commit 1cf4c1e8a0
11 changed files with 135 additions and 18 deletions

BIN
src/assets/Cheminova.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -3,7 +3,7 @@ import { CFooter } from '@coreui/react'
const AppFooter = () => { const AppFooter = () => {
return ( return (
<CFooter className="px-4"> <CFooter style={{ background: '#179FAF' }} className="px-4">
{/* <div> {/* <div>
<a href="https://coreui.io" target="_blank" rel="noopener noreferrer"> <a href="https://coreui.io" target="_blank" rel="noopener noreferrer">
CoreUI CoreUI

View File

@ -45,7 +45,18 @@ const AppHeader = () => {
}, []) }, [])
return ( return (
<CHeader position="sticky" className="mb-4 p-0" ref={headerRef}> <CHeader
position="sticky"
style={{
background: '#B4D1E5',
border: 'none',
marginLeft: '2rem',
marginRight: '2rem',
borderRadius: '20px',
marginTop: '1rem',
marginBottom: '2rem',
}}
>
<CContainer className="border-bottom px-4" fluid> <CContainer className="border-bottom px-4" fluid>
<CHeaderToggler <CHeaderToggler
onClick={() => dispatch({ type: 'set', sidebarShow: !sidebarShow })} onClick={() => dispatch({ type: 'set', sidebarShow: !sidebarShow })}

View File

@ -13,7 +13,7 @@ import CIcon from '@coreui/icons-react'
import { AppSidebarNav } from './AppSidebarNav' 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' import { sygnet } from 'src/assets/brand/sygnet'
// sidebar nav config // sidebar nav config
@ -31,18 +31,19 @@ const AppSidebar = () => {
position="fixed" position="fixed"
unfoldable={unfoldable} unfoldable={unfoldable}
visible={sidebarShow} visible={sidebarShow}
style={{ background: '#179FAF' }}
onVisibleChange={(visible) => { onVisibleChange={(visible) => {
dispatch({ type: 'set', sidebarShow: visible }) dispatch({ type: 'set', sidebarShow: visible })
}} }}
> >
<CSidebarHeader className="border-bottom"> <CSidebarHeader>
<CSidebarBrand to="/"> <CSidebarBrand to="/">
{/* <CIcon customClassName="sidebar-brand-full" icon={logo} height={32} /> */} {/* <CIcon customClassName="sidebar-brand-full" icon={logo} height={32} /> */}
<img <img
className="sidebar-brand-full" className="sidebar-brand-full"
src={logo} src={logo}
height={32} height={40}
style={{ marginLeft: '-0.8rem' }} // style={{ marginLeft: '-0.8rem' }}
/> />
<CIcon customClassName="sidebar-brand-narrow" icon={sygnet} height={32} /> <CIcon customClassName="sidebar-brand-narrow" icon={sygnet} height={32} />
</CSidebarBrand> </CSidebarBrand>
@ -52,7 +53,18 @@ const AppSidebar = () => {
onClick={() => dispatch({ type: 'set', sidebarShow: false })} onClick={() => dispatch({ type: 'set', sidebarShow: false })}
/> />
</CSidebarHeader> </CSidebarHeader>
<div
style={{
background: '#B4D1E5',
margin: '0.5rem',
border: 'none',
borderRadius: '20px',
height: '100%',
}}
>
<AppSidebarNav items={navigation} /> <AppSidebarNav items={navigation} />
</div>
<CSidebarFooter className="border-top d-none d-lg-flex"> <CSidebarFooter className="border-top d-none d-lg-flex">
<CSidebarToggler <CSidebarToggler
onClick={() => dispatch({ type: 'set', sidebarUnfoldable: !unfoldable })} onClick={() => dispatch({ type: 'set', sidebarUnfoldable: !unfoldable })}

View File

@ -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 && (
// <span className="nav-icon" >
// <span className="nav-icon-bullet"></span>
// </span>
// )}
// {name && name}
// {badge && (
// <CBadge color={badge.color} style={{ color: 'red' }} className="ms-auto">
// {badge.text}
// </CBadge>
// )}
// </>
// )
// }
// const navItem = (item, index, indent = false) => {
// const { component, name, badge, icon, ...rest } = item
// const Component = component
// return (
// <Component as="div" key={index}>
// {rest.to || rest.href ? (
// <CNavLink style={{ background: 'blue' }} {...(rest.to && { as: NavLink })} {...rest}>
// {navLink(name, icon, badge, indent)}
// </CNavLink>
// ) : (
// navLink(name, icon, badge, indent)
// )}
// </Component>
// )
// }
// const navGroup = (item, index) => {
// const { component, name, icon, items, to, ...rest } = item
// const Component = component
// return (
// <Component
// style={{ background: 'blue' }}
// compact
// as="div"
// key={index}
// toggler={navLink(name, icon)}
// {...rest}
// >
// {item.items?.map((item, index) =>
// item.items ? navGroup(item, index) : navItem(item, index, true),
// )}
// </Component>
// )
// }
// return (
// <CSidebarNav as={SimpleBar}>
// {items &&
// items.map((item, index) => (item.items ? navGroup(item, index) : navItem(item, index)))}
// </CSidebarNav>
// )
// }
// AppSidebarNav.propTypes = {
// items: PropTypes.arrayOf(PropTypes.any).isRequired,
// }
import React from 'react' import React from 'react'
import { NavLink } from 'react-router-dom' import { NavLink } from 'react-router-dom'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
@ -34,7 +110,19 @@ export const AppSidebarNav = ({ items }) => {
return ( return (
<Component as="div" key={index}> <Component as="div" key={index}>
{rest.to || rest.href ? ( {rest.to || rest.href ? (
<CNavLink {...(rest.to && { as: NavLink })} {...rest}> <CNavLink
as={NavLink}
{...rest}
style={({ isActive }) => ({
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)} {navLink(name, icon, badge, indent)}
</CNavLink> </CNavLink>
) : ( ) : (
@ -45,12 +133,12 @@ export const AppSidebarNav = ({ items }) => {
} }
const navGroup = (item, index) => { const navGroup = (item, index) => {
const { component, name, icon, items, to, ...rest } = item const { component, name, icon, items, ...rest } = item
const Component = component const Component = component
return ( return (
<Component compact as="div" key={index} toggler={navLink(name, icon)} {...rest}> <Component compact as="div" key={index} toggler={navLink(name, icon)} {...rest}>
{item.items?.map((item, index) => {items?.map((subItem, subIndex) =>
item.items ? navGroup(item, index) : navItem(item, index, true), subItem.items ? navGroup(subItem, subIndex) : navItem(subItem, subIndex, true),
)} )}
</Component> </Component>
) )

View File

@ -10,7 +10,7 @@ const DocsCallout = (props) => {
const _href = `https://coreui.io/react/docs/${href}` const _href = `https://coreui.io/react/docs/${href}`
return ( return (
<CCallout color="info" className="bg-white"> <CCallout>
{content {content
? content ? content
: `A React ${name} component ${ : `A React ${name} component ${

View File

@ -40,13 +40,13 @@ const AppHeaderDropdown = () => {
const [user, setUser] = useState(null) const [user, setUser] = useState(null)
const token = isAutheticated() const token = isAutheticated()
const getData = async () => { const getData = async () => {
let res = await Axios.get(`/api/rd-get-me`, { let res = await Axios.get(`/api/v1/user/details`, {
headers: { headers: {
Authorization: `Bearer ${token}`, Authorization: `Bearer ${token}`,
}, },
}) })
if (res.status === 200) { if (res.data.success) {
setUser({ ...res.data.myData }) setUser({ ...res.data.user })
} }
} }
useEffect(() => { useEffect(() => {

View File

@ -3,7 +3,7 @@ import { AppContent, AppSidebar, AppFooter, AppHeader } from '../components/inde
const DefaultLayout = () => { const DefaultLayout = () => {
return ( return (
<div> <div style={{ background: '#179FAF' }}>
<AppSidebar /> <AppSidebar />
<div className="wrapper d-flex flex-column min-vh-100"> <div className="wrapper d-flex flex-column min-vh-100">
<AppHeader /> <AppHeader />

View File

@ -43,7 +43,10 @@ const ForgetPassword = () => {
} }
return ( return (
<> <>
<div className="bg-body-tertiary min-vh-100 d-flex flex-row align-items-center"> <div
style={{ background: '#179FAF' }}
className="min-vh-100 d-flex flex-row align-items-center"
>
<CContainer> <CContainer>
<CRow className="justify-content-center"> <CRow className="justify-content-center">
<CCol md={8}> <CCol md={8}>

View File

@ -116,7 +116,10 @@ const Login = () => {
} }
return ( return (
<div className="bg-body-tertiary min-vh-100 d-flex flex-row align-items-center"> <div
style={{ background: '#179FAF' }}
className=" min-vh-100 d-flex flex-row align-items-center"
>
<CContainer> <CContainer>
<CRow className="justify-content-center"> <CRow className="justify-content-center">
<CCol md={8}> <CCol md={8}>