Skip to content

Commit

Permalink
Merge pull request #108 from AkshataKatwal16/admin
Browse files Browse the repository at this point in the history
Issue PS-986 feat: change menuItem icon at sidebar
  • Loading branch information
itsvick authored Aug 8, 2024
2 parents 8a13c41 + dffae70 commit 13d7ef9
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 12 deletions.
1 change: 1 addition & 0 deletions public/images/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/images/centers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/images/dashboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/database.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/event_available.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/login.jpg
Binary file not shown.
File renamed without changes
2 changes: 1 addition & 1 deletion src/components/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
return errors?.map((error: any) => {
switch (error.name) {
case "required": {
console.log(submittedButtonStatus);
// console.log(submittedButtonStatus);
error.message = submittedButtonStatus? t("FORM_ERROR_MESSAGES.THIS_IS_REQUIRED_FIELD") : "";
break;
}
Expand Down
21 changes: 16 additions & 5 deletions src/components/layouts/sidebar/MenuItems.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import masterIcon from '../../../../public/images/database.svg';
import centerIcon from '../../../../public/images/centers.svg';
import dashboardIcon from '../../../../public/images/dashboard.svg';
import userIcon from '../../../../public/images/group.svg';
import coursePannerIcon from '../../../../public/images/event_available.svg';



//


const Menuitems = [
{
title: "SIDEBAR.DASHBOARD",
icon: "home",
icon: dashboardIcon,
href: "/dashboard",
},
{
title: "SIDEBAR.MANAGE_USERS",
icon: "user",
icon: userIcon,
// href: "/",
subOptions: [
{
Expand All @@ -26,13 +37,13 @@ const Menuitems = [

{
title: "SIDEBAR.CENTERS",
icon: "users",
icon: centerIcon,
href: "/centers",
},

{
title: "Master ",
icon: "database",
icon: masterIcon,
// href: "/",
subOptions: [
{
Expand All @@ -51,7 +62,7 @@ const Menuitems = [
},
{
title: "SIDEBAR.COURSE_PLANNER",
icon: "calendar",
icon: coursePannerIcon,
href: "/course-planner",
subOptions: [
{
Expand Down
17 changes: 12 additions & 5 deletions src/components/layouts/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { useState } from "react";
import LogoIcon from "../logo/LogoIcon";
import Buynow from "./Buynow";
import Menuitems from "./MenuItems";
import Image from "next/image";
import MasterIcon from '../../../../public/images/database.svg';

const Sidebar = ({
isMobileSidebarOpen,
Expand Down Expand Up @@ -66,17 +68,22 @@ const Sidebar = ({
selected={location === item.href}
sx={{
mb: 1,

...(location === item.href && {
color: "black",
backgroundColor: (theme) =>
`${theme.palette.primary.main}!important`,
}),
}}
>
<ListItemIcon>
<FeatherIcon icon={item.icon} />
</ListItemIcon>
<ListItemText>
{/* { item.icon && (<ListItemIcon>
{item.icon}
</ListItemIcon>) */}
<ListItemIcon>
<Image src={item.icon} alt="" />

</ListItemIcon>
<ListItemText>
<Typography variant="h2" sx={{ fontWeight: "bold" }}>
{t(item.title)}
</Typography>
Expand Down Expand Up @@ -106,7 +113,7 @@ const Sidebar = ({
selected={location === subItem.href}
sx={{
pl: 8,
ml: 2,
ml: 2,
mb: 1,
...(location === subItem.href && {
color: "black",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { telemetryFactory } from "@/utils/telemetry";
import { logEvent } from "@/utils/googleAnalytics";
import { showToastMessage } from "@/components/Toastify";
import Link from "@mui/material/Link";
import loginImage from "../../public/6300830.jpg";
import loginImage from "../../public/loginImage.jpg";
import { useUserIdStore } from "@/store/useUserIdStore";

const LoginPage = () => {
Expand Down

0 comments on commit 13d7ef9

Please sign in to comment.