Skip to content

Commit

Permalink
Merge pull request #6 from AkshataKatwal16/admin
Browse files Browse the repository at this point in the history
Issue feat PS-981 ,PS-986 add faciliator page, add searchbar, add suboptions
  • Loading branch information
itsvick authored Jul 4, 2024
2 parents 26f6d58 + 1b509ea commit d6ba937
Show file tree
Hide file tree
Showing 12 changed files with 408 additions and 96 deletions.
28 changes: 24 additions & 4 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"COMMON": {
"LANGUAGE": "Language",
"LOADING": "Loading"
"LOADING": "Loading",
"ADD_NEW":"Add New"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand All @@ -13,12 +14,31 @@
"FORGOT_PASSWORD": "Forgot Password?",
"REMEMBER_ME": "Remember Me"
},
"DASHBOARD":
"SIDEBAR":
{
"HI":"hi",
"DASHBOARD":"Dashboard",
"MANAGE_USER":"Manage Users",
"MANAGE_USERS":"Manage Users",
"COURSE_PLANNER":"Course Planner",
"COHORTS":"Cohorts"
"COHORTS":"Cohorts",
"FACILITATORS": "Facilitators",
"LEARNERS":"Learners",
"TEAM_LEADERS":"Team Leaders",
"CREATE_PLAN":"Create Plan",
"VIEW_PLANS":"View Plans"

},
"FACILITATORS":
{
"ALL_STATES":"All States",
"ALL_DISTRICTS":"All Districts",
"ALL_BLOCKS":"All Blocks",
"SEARCHBAR_PLACEHOLDER":"Search Facilitators.."
},
"NAVBAR":
{
"SEARCHBAR_PLACEHOLDER":"Search course, topic, student, pdf etc.."

}

}
4 changes: 2 additions & 2 deletions src/components/layouts/FullLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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";
import Facilitators from "@/pages/Faciliator";
const MainWrapper = styled("div")(() => ({
display: "flex",
minHeight: "100vh",
Expand All @@ -38,7 +38,7 @@ type RouteKey = '/' | '/manage-users' | '/course-planner' | '/cohorts';

const componentMapping: Record<RouteKey, React.ComponentType> = {
"/": Dashboard,
"/manage-users": profile,
"/manage-users": Facilitators,
"/course-planner": Dashboard,
"/cohorts": Dashboard,
};
Expand Down
11 changes: 8 additions & 3 deletions src/components/layouts/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ 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 SearchBar from "./SearchBar";

import { useTranslation } from "next-i18next";
import ProfileDD from "./ProfileDD";
import { createTheme } from '@mui/material/styles';

const Header = ({ sx, customClass, toggleMobileSidebar, position }:any) => {
const { t } = useTranslation();
const theme = createTheme();

return (
<AppBar sx={sx} position={position} elevation={0} className={customClass}>
<Toolbar>
Expand All @@ -28,7 +33,7 @@ const Header = ({ sx, customClass, toggleMobileSidebar, position }:any) => {
{/* ------------------------------------------- */}
{/* Search Dropdown */}
{/* ------------------------------------------- */}
<SearchDD />
<SearchBar placeholder={ t("NAVBAR.SEARCHBAR_PLACEHOLDER")} backgroundColor={theme.palette.background.default}/>
{/* ------------ End Menu icon ------------- */}

<Box flexGrow={1} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/header/ProfileDD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ProfileDD = () => {
<Box
sx={{
display: {
xs: "none",
// xs: "none",
sm: "flex",
},
alignItems: "center",
Expand Down
120 changes: 120 additions & 0 deletions src/components/layouts/header/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// 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 (
// <>
// <IconButton
// aria-label="show 4 new mails"
// color="inherit"
// aria-controls="search-menu"
// aria-haspopup="true"
// onClick={() => setShowDrawer2(true)}
// size="large"
// >
// <FeatherIcon icon="search" width="20" height="20" />
// </IconButton>
// <Drawer
// anchor="top"
// open={showDrawer2}
// onClose={() => setShowDrawer2(false)}
// sx={{
// "& .MuiDrawer-paper": {
// padding: "15px 30px",
// },
// }}
// >
// <Box display="flex" alignItems="center">
// <Input placeholder="Search here" aria-label="description" fullWidth />
// <Box
// sx={{
// ml: "auto",
// }}
// >
// <IconButton
// color="inherit"
// sx={{
// color: (theme) => theme.palette.grey.A200,
// }}
// onClick={handleDrawerClose2}
// >
// <FeatherIcon icon="x-circle" />
// </IconButton>
// </Box>
// </Box>
// </Drawer>
// </>
// );
// };

// export default SearchDD;



import * as React from 'react';
import { styled, alpha } from '@mui/material/styles';
import InputBase from '@mui/material/InputBase';
import SearchIcon from '@mui/icons-material/Search';


export default function SearchBar({backgroundColor,placeholder}: any ) {
const Search = styled('div')(({ theme }) => ({
position: 'relative',
borderRadius: theme.shape.borderRadius,
backgroundColor: backgroundColor,
'&:hover': {
// backgroundColor: alpha(theme.palette.common.white, 0.25),
},
marginRight: theme.spacing(2),
marginLeft: 0,
width: '100%',
[theme.breakpoints.up('sm')]: {
// marginLeft: theme.spacing(3),
width: '50%',
},
}));

const SearchIconWrapper = styled('div')(({ theme }) => ({
color: 'black',
padding: theme.spacing(0, 2),
height: '100%',
position: 'absolute',
pointerEvents: 'none',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}));

const StyledInputBase = styled(InputBase)(({ theme }) => ({
color: 'black',
'& .MuiInputBase-input': {
padding: theme.spacing(1, 1, 1, 0),
// vertical padding + font size from searchIcon
paddingLeft: `calc(1em + ${theme.spacing(4)})`,
transition: theme.transitions.create('width'),
width: '100%',
[theme.breakpoints.up('md')]: {
width: '100ch',
},
},
}));

return (
<Search>
<SearchIconWrapper>
<SearchIcon />
</SearchIconWrapper>
<StyledInputBase
placeholder={placeholder}
inputProps={{ 'aria-label': 'search' }}
/>
</Search>
);
}
57 changes: 0 additions & 57 deletions src/components/layouts/header/SearchDD.tsx

This file was deleted.

38 changes: 31 additions & 7 deletions src/components/layouts/sidebar/MenuItems.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@

import { useTranslation } from "next-i18next";

const Menuitems = [
{
title: "Dashbaord",
title: "SIDEBAR.DASHBOARD",
icon: "home",
href: "/",
},
{
title: "Manage Users",
title: "SIDEBAR.MANAGE_USERS",
icon: "user",
href: "/manage-users",

subOptions: [
{
title: "SIDEBAR.TEAM_LEADERS",
href: "/manage-users",
},
{
title: "SIDEBAR.FACILITATORS",
href: "/manage-users",
},
{
title: "SIDEBAR.LEARNERS",
href: "/manage-users",
},

],
},
{
title: "Course Planner",
title: "SIDEBAR.COURSE_PLANNER",
icon: "calendar",
href: "/course-planner",
subOptions: [
{
title: "SIDEBAR.CREATE_PLAN",
href: "/course-planner",
},
{
title: "SIDEBAR.VIEW_PLANS",
href: "/manage-users",
},
],
},
{
title: "Cohorts",
icon: "users",
href: "/cohorts",
}


},
];

export default Menuitems;
Loading

0 comments on commit d6ba937

Please sign in to comment.