diff --git a/public/images/Logo.svg b/public/images/Logo.svg new file mode 100644 index 00000000..a570fd4d --- /dev/null +++ b/public/images/Logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 4acabe0a..42c308d5 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -12,5 +12,13 @@ "USERNAME_PASSWORD_NOT_CORRECT": "The username or password you entered is incorrect", "FORGOT_PASSWORD": "Forgot Password?", "REMEMBER_ME": "Remember Me" + }, + "DASHBOARD": + { + "HI":"hi", + "DASHBOARD":"Dashboard", + "MANAGE_USER":"Manage Users", + "COURSE_PLANNER":"Course Planner", + "COHORTS":"Cohorts" } } diff --git a/src/components/Layouts/UserDropdown.tsx b/src/components/Layouts/UserDropdown.tsx deleted file mode 100644 index 87c35813..00000000 --- a/src/components/Layouts/UserDropdown.tsx +++ /dev/null @@ -1,144 +0,0 @@ -'use client' - -// React Imports -import { useRef, useState } from 'react' -import type { MouseEvent } from 'react' - -// Next Imports -import { useRouter } from 'next/navigation' - -// MUI Imports -import { styled } from '@mui/material/styles' -import Badge from '@mui/material/Badge' -import Avatar from '@mui/material/Avatar' -import Popper from '@mui/material/Popper' -import Fade from '@mui/material/Fade' -import Paper from '@mui/material/Paper' -import ClickAwayListener from '@mui/material/ClickAwayListener' -import MenuList from '@mui/material/MenuList' -import Typography from '@mui/material/Typography' -import Divider from '@mui/material/Divider' -import MenuItem from '@mui/material/MenuItem' -import Button from '@mui/material/Button' - -// Styled component for badge content -const BadgeContentSpan = styled('span')({ - width: 8, - height: 8, - borderRadius: '50%', - cursor: 'pointer', - backgroundColor: 'var(--mui-palette-success-main)', - boxShadow: '0 0 0 2px var(--mui-palette-background-paper)' -}) - -const UserDropdown = () => { - // States - const [open, setOpen] = useState(false) - - // Refs - const anchorRef = useRef(null) - - // Hooks - const router = useRouter() - - const handleDropdownOpen = () => { - !open ? setOpen(true) : setOpen(false) - } - - const handleDropdownClose = (event?: MouseEvent | (MouseEvent | TouchEvent), url?: string) => { - if (url) { - router.push(url) - } - - if (anchorRef.current && anchorRef.current.contains(event?.target as HTMLElement)) { - return - } - - setOpen(false) - } - - return ( - <> - } - anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }} - className='mis-2' - > - - - - {({ TransitionProps, placement }) => ( - - - handleDropdownClose(e as MouseEvent | TouchEvent)}> - - - - - - Admin_name - - Admin - - - - handleDropdownClose(e)}> - - My Profile - - handleDropdownClose(e)}> - - Settings - - handleDropdownClose(e)}> - - Pricing - - handleDropdownClose(e)}> - - FAQ - - - } - onClick={e => handleDropdownClose(e, '/login')} - sx={{ '& .MuiButton-endIcon': { marginInlineStart: 1.5 } }} - > - Logout - - - - - - - )} - - > - ) -} - -export default UserDropdown diff --git a/src/components/Link.tsx b/src/components/Link.tsx new file mode 100644 index 00000000..3eeda464 --- /dev/null +++ b/src/components/Link.tsx @@ -0,0 +1,225 @@ +// import * as React from 'react'; +// import PropTypes from 'prop-types'; +// import clsx from 'clsx'; +// import { useRouter } from 'next/router'; +// import NextLink from 'next/link'; +// import MuiLink from '@mui/material/Link'; +// import { styled } from '@mui/material/styles'; + +// // Add support for the sx prop for consistency with the other branches. +// const Anchor = styled('a')({}); + +// export const NextLinkComposed = React.forwardRef(function NextLinkComposed(props, ref) { +// const { to, linkAs, href, replace, scroll, shallow, prefetch, locale, ...other } = props; + +// return ( +// +// +// +// ); +// }); + +// NextLinkComposed.propTypes = { +// href: PropTypes.any, +// linkAs: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), +// locale: PropTypes.string, +// passHref: PropTypes.bool, +// prefetch: PropTypes.bool, +// replace: PropTypes.bool, +// scroll: PropTypes.bool, +// shallow: PropTypes.bool, +// to: PropTypes.oneOfType([PropTypes.object, PropTypes.string]).isRequired, +// }; + +// // A styled version of the Next.js Link component: +// // https://nextjs.org/docs/api-reference/next/link +// const Link = React.forwardRef(function Link(props, ref) { +// const { +// activeClassName = 'active', +// as: linkAs, +// className: classNameProps, +// href, +// noLinkStyle, +// role, // Link don't have roles. +// ...other +// } = props; + +// const router = useRouter(); +// const pathname = typeof href === 'string' ? href : href.pathname; +// const className = clsx(classNameProps, { +// [activeClassName]: router.pathname === pathname && activeClassName, +// }); + +// const isExternal = +// typeof href === 'string' && (href.indexOf('http') === 0 || href.indexOf('mailto:') === 0); + +// if (isExternal) { +// if (noLinkStyle) { +// return ; +// } + +// return ; +// } + +// if (noLinkStyle) { +// return ; +// } + +// return ( +// +// ); +// }); + +// Link.propTypes = { +// activeClassName: PropTypes.string, +// as: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), +// className: PropTypes.string, +// href: PropTypes.any, +// linkAs: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), +// noLinkStyle: PropTypes.bool, +// role: PropTypes.string, +// }; + +// export default Link; + + + +import * as React from 'react'; +import PropTypes from 'prop-types'; +import clsx from 'clsx'; +import { useRouter } from 'next/router'; +import NextLink from 'next/link'; +import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link'; +import { styled } from '@mui/material/styles'; + +// Add support for the sx prop for consistency with the other branches. +const Anchor: any = styled('a')({}); + +export interface NextLinkComposedProps { + to: string | { pathname: string }; + linkAs?: string | object; + href?: any; + replace?: boolean; + scroll?: boolean; + shallow?: boolean; + prefetch?: boolean; + locale?: string; + passHref?: boolean; + className?: string; +} + +export const NextLinkComposed = React.forwardRef( + function NextLinkComposed(props, ref) { + const { to, linkAs, href, replace, scroll, shallow, prefetch, locale, ...other } = props; + + return ( + + } {...other} /> + + ); + } +); + +// NextLinkComposed.propTypes = { +// href: PropTypes.any, +// linkAs: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), +// locale: PropTypes.string, +// passHref: PropTypes.bool, +// prefetch: PropTypes.bool, +// replace: PropTypes.bool, +// scroll: PropTypes.bool, +// shallow: PropTypes.bool, +// to: PropTypes.oneOfType([PropTypes.object, PropTypes.string]).isRequired, +// }; + +export interface LinkProps extends MuiLinkProps { + activeClassName?: string; + as?: string | object; + noLinkStyle?: boolean; + role?: string; + href?: any; +} + +// A styled version of the Next.js Link component: +// https://nextjs.org/docs/api-reference/next/link +const Link = React.forwardRef(function Link(props, ref) { + const { + activeClassName = 'active', + as: linkAs, + className: classNameProps, + href, + noLinkStyle, + role, // Link don't have roles. + + ...other + } = props; + + const router = useRouter(); + const pathname = typeof href === 'string' ? href : href?.pathname; + const className = clsx(classNameProps, { + [activeClassName!]: router.pathname === pathname && activeClassName, + }); + + const isExternal = + typeof href === 'string' && (href.indexOf('http') === 0 || href.indexOf('mailto:') === 0); + + if (isExternal) { + if (noLinkStyle) { + return } {...other} />; + } + + return } {...other} />; + } + + if (noLinkStyle) { + return } to={href} {...other} />; + } + + return ( + } + to={href} + {...other} + /> + ); +}); + +// Link.propTypes = { +// activeClassName: PropTypes.string, +// as: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), +// className: PropTypes.string, +// href: PropTypes.any, +// linkAs: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), +// noLinkStyle: PropTypes.bool, +// role: PropTypes.string, +// }; + +export default Link; diff --git a/src/components/createEmotionCache.tsx b/src/components/createEmotionCache.tsx new file mode 100644 index 00000000..37fd756c --- /dev/null +++ b/src/components/createEmotionCache.tsx @@ -0,0 +1,5 @@ +import createCache from '@emotion/cache'; + +export default function createEmotionCache() { + return createCache({ key: 'css' }); +} diff --git a/src/components/layouts/FullLayout.tsx b/src/components/layouts/FullLayout.tsx new file mode 100644 index 00000000..a6158692 --- /dev/null +++ b/src/components/layouts/FullLayout.tsx @@ -0,0 +1,94 @@ +import React, { useState } from "react"; +import { + useMediaQuery, + Container, + Box, + ThemeProvider, + createTheme, + Theme, + styled, +} from "@mui/material"; +import Header from "./header/Header"; +import Sidebar from "./sidebar/Sidebar"; +import Footer from "./footer/Footer"; +import * as theme from '../theme/theme'; +import Dashboard from "@/pages/dashboard"; +import profile from "@/pages/profile"; +const MainWrapper = styled("div")(() => ({ + display: "flex", + minHeight: "100vh", + overflow: "hidden", + width: "100%", +})); + +const PageWrapper = styled("div")(({ theme }: { theme: Theme }) => ({ + display: "flex", + flex: "1 1 auto", + overflow: "hidden", + backgroundColor: theme.palette.background.default, + [theme.breakpoints.up("lg")]: { + paddingTop: "64px", + }, + [theme.breakpoints.down("lg")]: { + paddingTop: "64px", + }, +})); + +type RouteKey = '/' | '/manage-users' | '/course-planner' | '/cohorts'; + +const componentMapping: Record = { + "/": Dashboard, + "/manage-users": profile, + "/course-planner": Dashboard, + "/cohorts": Dashboard, +}; + +interface FullLayoutProps { + children?: React.ReactNode; +} + +const FullLayout: React.FC = () => { + const [isSidebarOpen, setSidebarOpen] = useState(true); + const [isMobileSidebarOpen, setMobileSidebarOpen] = useState(false); + const [activeComponent, setActiveComponent] = useState("/"); + + const lgUp = useMediaQuery((theme: any) => theme.breakpoints.up("lg")); + + const ActiveComponent = componentMapping[activeComponent]; + + return ( + + + setMobileSidebarOpen(true)} + /> + setMobileSidebarOpen(false)} + onMenuItemClick={(href: RouteKey) => setActiveComponent(href)} + /> + + + + + + + + + + + ); +}; + +export default FullLayout; diff --git a/src/components/layouts/footer/Footer.tsx b/src/components/layouts/footer/Footer.tsx new file mode 100644 index 00000000..61b58bad --- /dev/null +++ b/src/components/layouts/footer/Footer.tsx @@ -0,0 +1,14 @@ +import React from "react"; +import { Box, Typography } from "@mui/material"; +import Link from "next/link"; +const Footer = () => { + return ( + + + {/* Footer */} + + + ); +}; + +export default Footer; diff --git a/src/components/layouts/header/Header.tsx b/src/components/layouts/header/Header.tsx new file mode 100644 index 00000000..c600dd75 --- /dev/null +++ b/src/components/layouts/header/Header.tsx @@ -0,0 +1,53 @@ +import React from "react"; +import FeatherIcon from "feather-icons-react"; +import { AppBar, Box, IconButton, Toolbar } from "@mui/material"; +import PropTypes from "prop-types"; +// Dropdown Component +import SearchDD from "./SearchDD"; +// import ProfileDD from "./ProfileDD"; +import ProfileDD from "./ProfileDD"; + +const Header = ({ sx, customClass, toggleMobileSidebar, position }:any) => { + return ( + + + + + + {/* ------------------------------------------- */} + {/* Search Dropdown */} + {/* ------------------------------------------- */} + + {/* ------------ End Menu icon ------------- */} + + + + + {/* ------------------------------------------- */} + {/* Profile Dropdown */} + {/* ------------------------------------------- */} + + + ); +}; + +Header.propTypes = { + sx: PropTypes.object, + customClass: PropTypes.string, + position: PropTypes.string, + toggleSidebar: PropTypes.func, + toggleMobileSidebar: PropTypes.func, +}; + +export default Header; diff --git a/src/components/layouts/header/ProfileDD.tsx b/src/components/layouts/header/ProfileDD.tsx new file mode 100644 index 00000000..e9c1cfd1 --- /dev/null +++ b/src/components/layouts/header/ProfileDD.tsx @@ -0,0 +1,126 @@ +import React from "react"; +import FeatherIcon from "feather-icons-react"; +import Image from "next/image"; +// import userimg from "../../../assets/images/users/user2.jpg"; +import sidebarBuynowsvg from "../../../../public/images/users/user2.jpg"; +import AccountCircleIcon from '@mui/icons-material/AccountCircle'; + +import { + Box, + Menu, + Typography, + Link, + ListItemButton, + List, + ListItemText, + Button, + Divider, +} from "@mui/material"; +import { AnyARecord } from "dns"; +const ProfileDD = () => { + const [anchorEl4, setAnchorEl4] = React.useState(null); + + const handleClick4 = (event: any) => { + setAnchorEl4(event.currentTarget); + }; + + const handleClose4 = () => { + setAnchorEl4(null); + }; + return ( + <> + + + {/* */} + + + + Hi, + + + User + + + + + + + + + + + + + + + + + + + + + + + + + + + + Logout + + + + + + > + ); +}; + +export default ProfileDD; diff --git a/src/components/layouts/header/SearchDD.tsx b/src/components/layouts/header/SearchDD.tsx new file mode 100644 index 00000000..44fd29e5 --- /dev/null +++ b/src/components/layouts/header/SearchDD.tsx @@ -0,0 +1,57 @@ +import React, { useState } from "react"; +import FeatherIcon from "feather-icons-react"; +import { IconButton, Input, Box, Drawer } from "@mui/material"; + +const SearchDD = () => { + // drawer top + const [showDrawer2, setShowDrawer2] = useState(false); + + const handleDrawerClose2 = () => { + setShowDrawer2(false); + }; + return ( + <> + setShowDrawer2(true)} + size="large" + > + + + setShowDrawer2(false)} + sx={{ + "& .MuiDrawer-paper": { + padding: "15px 30px", + }, + }} + > + + + + theme.palette.grey.A200, + }} + onClick={handleDrawerClose2} + > + + + + + + > + ); +}; + +export default SearchDD; diff --git a/src/components/layouts/logo/LogoIcon.tsx b/src/components/layouts/logo/LogoIcon.tsx new file mode 100644 index 00000000..6b586f28 --- /dev/null +++ b/src/components/layouts/logo/LogoIcon.tsx @@ -0,0 +1,16 @@ +import React from "react"; +import { Link } from "@mui/material"; +import Image from "next/image"; +import LogoDark from "../../../../public/images/Logo.svg"; + +const LogoIcon = () => { + return ( + <> + + + > + + ); +}; + +export default LogoIcon; diff --git a/src/components/layouts/sidebar/Buynow.tsx b/src/components/layouts/sidebar/Buynow.tsx new file mode 100644 index 00000000..86c1ea1b --- /dev/null +++ b/src/components/layouts/sidebar/Buynow.tsx @@ -0,0 +1,22 @@ +import React from "react"; +import { Box } from "@mui/material"; +import sidebarBuynowsvg from "../../../../public/images/backgrounds/sidebar-buynow-bg.svg"; + + +const Buynow = () => ( + + theme.palette.secondary.light, + borderRadius: "10px", + overflow: "hidden", + }} + > + + +); +export default Buynow; diff --git a/src/components/layouts/sidebar/MenuItems.js b/src/components/layouts/sidebar/MenuItems.js new file mode 100644 index 00000000..efada2f4 --- /dev/null +++ b/src/components/layouts/sidebar/MenuItems.js @@ -0,0 +1,28 @@ + +const Menuitems = [ + { + title: "Dashbaord", + icon: "home", + href: "/", + }, + { + title: "Manage Users", + icon: "user", + href: "/manage-users", + + }, + { + title: "Course Planner", + icon: "calendar", + href: "/course-planner", + }, + { + title: "Cohorts", + icon: "users", + href: "/cohorts", + } + + +]; + +export default Menuitems; diff --git a/src/components/layouts/sidebar/Sidebar.tsx b/src/components/layouts/sidebar/Sidebar.tsx new file mode 100644 index 00000000..4a637a50 --- /dev/null +++ b/src/components/layouts/sidebar/Sidebar.tsx @@ -0,0 +1,121 @@ + +import React from "react"; +import NextLink from "next/link"; +import PropTypes from "prop-types"; +import { + Box, + Drawer, + useMediaQuery, + List, + ListItem, + ListItemIcon, + ListItemText, + useTheme +} from "@mui/material"; +import FeatherIcon from "feather-icons-react"; +import LogoIcon from "../logo/LogoIcon"; +import Menuitems from "./MenuItems"; + +import Buynow from "./Buynow"; +import { useRouter } from "next/router"; +import theme from "@/components/theme/theme"; +const Sidebar = ({ isMobileSidebarOpen, onSidebarClose, isSidebarOpen, onMenuItemClick }:any) => { + const [open, setOpen] = React.useState(true); + const lgUp = useMediaQuery((theme: any) => theme.breakpoints.up("lg")); + let curl = useRouter(); + const location = curl.pathname; + + const SidebarContent = ( + + + + {Menuitems?.map((item, index) => ( + + { + onMenuItemClick(item.href); + onSidebarClose(); + }} + button + selected={location === item.href} + sx={{ + mb: 1, + ...(location === item.href && { + color: "white", + backgroundColor: (theme) => + `${theme.palette.primary.main}!important`, + }), + }} + > + + + + + {item.title} + + + + ))} + + + + + ); + + if (lgUp) { + return ( + + {SidebarContent} + + ); + } + return ( + + {SidebarContent} + + ); +}; + +Sidebar.propTypes = { + isMobileSidebarOpen: PropTypes.bool, + onSidebarClose: PropTypes.func, + isSidebarOpen: PropTypes.bool, + onMenuItemClick: PropTypes.func, +}; + +export default Sidebar; diff --git a/src/components/theme/ComponentOverRide.ts b/src/components/theme/ComponentOverRide.ts new file mode 100644 index 00000000..54299f66 --- /dev/null +++ b/src/components/theme/ComponentOverRide.ts @@ -0,0 +1,126 @@ +import { Components, Theme } from "@mui/material"; + +const components: Components> = { + MuiCssBaseline: { + styleOverrides: { + "*": { + boxSizing: "border-box", + }, + html: { + height: "100%", + width: "100%", + }, + body: { + height: "100%", + margin: 0, + padding: 0, + }, + "#root": { + height: "100%", + }, + "*[dir='rtl'] .buyNowImg": { + transform: "scaleX(-1)", + }, + + ".buyNowImg": { + position: "absolute", + right: "-44px", + top: "-18px", + width: "143px", + height: "175px", + }, + ".MuiCardHeader-action": { + alignSelf: "center !important", + }, + ".scrollbar-container": { + borderRight: "0 !important", + }, + "*[dir='rtl'] .welcomebg:before": { + backgroundPosition: "top -24px left -9px !important", + }, + }, + }, + MuiContainer: { + styleOverrides: { + root: { + paddingLeft: "15px !important", + paddingRight: "15px !important", + maxWidth: "1600px", + }, + }, + }, + + MuiButton: { + styleOverrides: { + root: { + textTransform: "none", + boxShadow: "none", + + "&:hover": { + boxShadow: "none", + }, + }, + }, + }, + + MuiListItem: { + styleOverrides: { + root: { + borderRadius: "9px", + }, + }, + }, + + MuiCard: { + styleOverrides: { + root: { + borderRadius: "20px", + padding: "14px", + margin: "15px", + boxShadow: "0px 7px 30px 0px rgba(90, 114, 123, 0.11)", + }, + }, + }, + + MuiListItemIcon: { + styleOverrides: { + root: { + minWidth: "40px", + }, + }, + }, + + MuiGridItem: { + styleOverrides: { + root: { + paddingTop: "30px", + paddingLeft: "30px !important", + }, + }, + }, + MuiLinearProgress: { + styleOverrides: { + root: { + backgroundColor: "#ecf0f2", + borderRadius: "6px", + }, + }, + }, + MuiMenuItem: { + styleOverrides: { + root: { + borderRadius: "0", + }, + }, + }, + MuiChip: { + styleOverrides: { + root: { + fontWeight: "500", + fontSize: "0.75rem", + }, + }, + }, +}; + +export default components; diff --git a/src/components/theme/Shadows.ts b/src/components/theme/Shadows.ts new file mode 100644 index 00000000..e26a738e --- /dev/null +++ b/src/components/theme/Shadows.ts @@ -0,0 +1,31 @@ +import { Shadows } from "@mui/material"; + +const shadows: Shadows = [ + "none", + "0px 2px 3px rgba(0,0,0,0.10)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 2px 2px -2px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 3px 4px -2px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 3px 4px -2px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 4px 6px -2px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 4px 6px -2px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 4px 8px -2px rgba(0,0,0,0.25)", + "1px 2px 10px rgba(0,0,0,0.08)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 6px 12px -4px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 7px 12px -4px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 6px 16px -4px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 7px 16px -4px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 8px 18px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 9px 18px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 10px 20px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 11px 20px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 12px 22px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 13px 22px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 14px 24px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 16px 28px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 18px 30px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 20px 32px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 22px 34px -8px rgba(0,0,0,0.25)", + "0 0 1px 0 rgba(0,0,0,0.31), 0 24px 36px -8px rgba(0,0,0,0.25)", +]; + +export default shadows; diff --git a/src/components/theme/Typoraphy.ts b/src/components/theme/Typoraphy.ts new file mode 100644 index 00000000..e50219ad --- /dev/null +++ b/src/components/theme/Typoraphy.ts @@ -0,0 +1,53 @@ +import { Palette } from "@mui/material"; +import { TypographyOptions } from "@mui/material/styles/createTypography"; + +const typography: TypographyOptions | ((palette: Palette) => TypographyOptions) = { + fontFamily: "'DM Sans', sans-serif", + body1: { + fontWeight: 400, // or 'bold' + }, + h1: { + fontWeight: 500, + fontSize: "1.875rem", + lineHeight: "1.5", + }, + h2: { + fontWeight: 500, + fontSize: "1.5rem", + lineHeight: "1.5", + }, + h3: { + fontWeight: 500, + fontSize: "1.3125rem", + lineHeight: "1.5", + }, + h4: { + fontWeight: 500, + fontSize: "1.125rem", + lineHeight: "1.5", + }, + h5: { + fontWeight: 500, + fontSize: "1rem", + lineHeight: "1.5", + }, + h6: { + fontWeight: 500, + fontSize: "0.875rem", + lineHeight: "1.5", + }, + button: { + textTransform: "none", + fontWeight: "400", + }, + subtitle1: { + fontSize: "1rem", + fontWeight: "400", + }, + subtitle2: { + fontSize: "0.875rem", + fontWeight: "400", + }, +}; + +export default typography; diff --git a/src/components/theme/theme.ts b/src/components/theme/theme.ts new file mode 100644 index 00000000..ec6d9c37 --- /dev/null +++ b/src/components/theme/theme.ts @@ -0,0 +1,84 @@ +import { createTheme } from "@mui/material/styles"; +import components from "./ComponentOverRide"; +import shadows from "./Shadows"; +import typography from "./Typoraphy"; + +// Create a theme instance. +const theme = createTheme({ + palette: { + primary: { + main: "#03c9d7", + light: "F4F4F4", + dark: "#05b2bd", + contrastText: "#ffffff", + + }, + secondary: { + main: "#fb9678", + light: "#fcf1ed", + dark: "#e67e5f", + contrastText: "#ffffff", + }, + success: { + main: "#00c292", + + dark: "#00964b", + contrastText: "#ffffff", + }, + // danger: { + // main: "#e46a76", + // light: "#fdf3f5", + // }, + info: { + main: "#0bb2fb", + light: "#a7e3f4", + }, + error: { + main: "#e46a76", + + dark: "#e45a68", + }, + warning: { + main: "#fec90f", + + dark: "#dcb014", + contrastText: "#ffffff", + }, + text: { + secondary: "#777e89", + // danger: "#fc4b6c", + }, + grey: { + A100: "#ecf0f2", + A200: "#99abb4", + A400: "#767e89", + A700: "#e6f4ff", + }, + action: { + disabledBackground: "rgba(73,82,88,0.12)", + hoverOpacity: 0.02, + hover: "rgba(0, 0, 0, 0.03)", + }, + background: { + default: "#fafbfb", + }, + }, + mixins: { + toolbar: { + color: "#949db2", + "@media(min-width:1280px)": { + minHeight: "64px", + padding: "0 30px", + }, + "@media(max-width:1280px)": { + minHeight: "64px", + }, + }, + }, + components, + shadows, + typography, + // breakpoints: [] +}); + +export default theme; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 97761689..d388ec33 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,16 +1,31 @@ +// import "@/styles/globals.css"; + + + + + + + + + + + + + + + // import "@/styles/globals.css"; import type { AppProps } from "next/app"; import { appWithTranslation } from "next-i18next"; import { initGA } from "../utils/googleAnalytics"; import { useEffect } from "react"; -import { AuthProvider } from '../context/AuthContext'; -import { ToastContainer } from 'react-toastify'; -import 'react-toastify/dist/ReactToastify.css'; -import {telemetryFactory} from '../utils/telemetry' +import { AuthProvider } from "../context/AuthContext"; +import { ToastContainer } from "react-toastify"; +import "react-toastify/dist/ReactToastify.css"; +import { telemetryFactory } from "../utils/telemetry"; +import FullLayout from "@/components/layouts/FullLayout"; import { Experimental_CssVarsProvider as CssVarsProvider, - useColorScheme, - useTheme, } from "@mui/material/styles"; import customTheme from "../styles/customTheme"; @@ -24,18 +39,30 @@ function App({ Component, pageProps }: AppProps) { window.GA_INITIALIZED = true; } }); + + const renderComponent = () => { + if (pageProps.noLayout) { + return ; + } else { + return ( + + + + ); + } + }; + return ( - - ; - - + + {renderComponent()} + + - ); } diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 5ffee090..e46f193a 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -10,14 +10,12 @@ import React, { useEffect, useRef, useState } from "react"; import Select, { SelectChangeEvent } from "@mui/material/Select"; import { Visibility, VisibilityOff } from "@mui/icons-material"; import ReactGA from "react-ga4"; - import Checkbox from "@mui/material/Checkbox"; import Image from "next/image"; import Loader from "../components/Loader"; import MenuItem from "@mui/material/MenuItem"; import appLogo from "../../public/images/appLogo.png"; import config from "../../config.json"; -//import { getUserId } from '../services/ProfileService'; import { login } from "../services/LoginService"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { useRouter } from "next/router"; @@ -115,12 +113,6 @@ const LoginPage = () => { rememberMe ? localStorage.setItem("refreshToken", refreshToken) : localStorage.removeItem("refreshToken"); - - // const userResponse = await getUserId(); - // localStorage.setItem('userId', userResponse?.userId); - // localStorage.setItem('state', userResponse?.state); - // localStorage.setItem('district', userResponse?.district); - // localStorage.setItem('role', userResponse?.tenantData[0]?.roleName) } } setLoading(false); @@ -137,8 +129,8 @@ const LoginPage = () => { uid: localStorage.getItem("userId") || "Anonymous", }, }; - telemetryFactory.interact(telemetryInteract); - router.push('/dashboard'); + telemetryFactory.interact(telemetryInteract); + router.push('/dashboard'); } catch (error: any) { setLoading(false); if (error.response && error.response.status === 404) { @@ -366,7 +358,6 @@ const LoginPage = () => { alignContent={"center"} textAlign={"center"} marginTop={"2rem"} - // marginBottom={'2rem'} width={"100%"} > { fullWidth={true} disabled={isButtonDisabled} ref={loginButtonRef} - // sx={{ marginBottom: '2rem' }} > {t("LOGIN_PAGE.LOGIN")} @@ -390,6 +380,7 @@ const LoginPage = () => { export async function getStaticProps({ locale }: any) { return { props: { + noLayout: true, ...(await serverSideTranslations(locale, ["common"])), }, }; diff --git a/src/pages/profile.tsx b/src/pages/profile.tsx new file mode 100644 index 00000000..e9950ef1 --- /dev/null +++ b/src/pages/profile.tsx @@ -0,0 +1,7 @@ +function profile() { + return ( + Profile + ); +} + +export default profile; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 61453b27..90b31bfd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,6 @@ "@/*": ["./src/*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/pages/dashboard.js"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/pages/dashboard.js", "src/components/layouts/logo/LogoIcon.tsx", "src/components/layouts/logo/LogoIcon.tsx", "src/components/layouts/header/Header.tsx", "src/components/Link.tsx", "src/components/Link.tsx", "src/components/theme/theme.ts", "src/components/theme/theme.ts"], "exclude": ["node_modules"] }