import * as React from 'react'; import { Divider, ListItemButton, ListItemIcon,…
- User
import * as React from 'react'; import { Divider, ListItemButton, ListItemIcon, ListItemText, ListSubheader } from '@mui/material'; import { Link, useLocation } from 'react-router-dom';
import HomeIcon from "@mui/icons-material/Home"; import PersonOutlineIcon from "@mui/icons-material/PersonOutline"; import ExitToAppIcon from "@mui/icons-material/ExitToApp"; import AccountCircleOutlinedIcon from "@mui/icons-material/AccountCircleOutlined"; import AnnouncementOutlinedIcon from '@mui/icons-material/AnnouncementOutlined'; import ClassOutlinedIcon from '@mui/icons-material/ClassOutlined'; import SupervisorAccountOutlinedIcon from '@mui/icons-material/SupervisorAccountOutlined'; import ReportIcon from '@mui/icons-material/Report'; import AssignmentIcon from '@mui/icons-material/Assignment';
const SideBar = () => { const location = useLocation(); return ( <> <React.Fragment> <HomeIcon color={location.pathname === ("/" || "/Admin/dashboard") ? 'primary' : 'inherit'} /> <ClassOutlinedIcon color={location.pathname.startsWith('/Admin/classes') ? 'primary' : 'inherit'} /> <ReportIcon color={location.pathname.startsWith("/forms") ? 'primary' : 'inherit'} />
<ListItemButton component={Link} to="/Admin/submissions"> <ListItemIcon> <PersonOutlineIcon color={location.pathname.startsWith("/Admin/submissions") ? 'primary' : 'inherit'} /> </ListItemIcon> <ListItemText primary="Submissions" /> </ListItemButton> <ListItemButton component={Link} to="/Admin/notices"> <ListItemIcon> <AnnouncementOutlinedIcon color={location.pathname.startsWith("/Admin/notices") ? 'primary' : 'inherit'} /> </ListItemIcon> <ListItemText primary="Comments" /> </ListItemButton> </React.Fragment> <Divider sx={{ my: 1 }} /> <React.Fragment> <ListSubheader component="div" inset> User </ListSubheader> <ListItemButton component={Link} to="/Admin/profile"> <ListItemIcon> <AccountCircleOutlinedIcon color={location.pathname.startsWith("/Admin/profile") ? 'primary' : 'inherit'} /> </ListItemIcon> <ListItemText primary="Profile" /> </ListItemButton> <ListItemButton component={Link} to="/logout"> <ListItemIcon> <ExitToAppIcon color={location.pathname.startsWith("/logout") ? 'primary' : 'inherit'} /> </ListItemIcon> <ListItemText primary="Logout" /> </ListItemButton> </React.Fragment> </> )}
export default SideBar in this for submission i have to create a page ...where when i clcik submisision intact navbar and sidebar and in the space show a submssion area where i can submit pdfs file ......schema must be username form type and pdf ....and aprt from this two approve and reject button for each submission after submmsion and a plus icon for submssoon ...i careted a submision related foldr under pages/admin/submissionrelated ...now craete model schmea ..contolrer router and then addto submssion file ...example i will provdieimport React, { useEffect, useState } from "react"; import { Box, Button, CircularProgress, Stack, TextField } from "@mui/material"; import { useNavigate } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import { addStuff } from '../../../redux/userRelated/userHandle'; import { underControl } from '../../../redux/userRelated/userSlice'; import { BlueButton } from "../../../components/buttonStyles"; import Popup from "../../../components/Popup"; import Classroom from "../../../assets/classroom.png"; import styled from "styled-components";
- Assistant
- User
import React from 'react' import { BrowserRouter as Router, Routes, Route, Navigate } from "react-router-dom"; import { useSelector } from 'react-redux'; import Homepage from './pages/Homepage'; import AdminDashboard from './pages/admin/AdminDashboard'; import StudentDashboard from './pages/student/StudentDashboard'; import TeacherDashboard from './pages/teacher/TeacherDashboard'; import LoginPage from './pages/LoginPage'; import BasicForm from './pages/admin/forms/formsubmit'; import AdminRegisterPage from './pages/admin/AdminRegisterPage'; import ChooseUser from './pages/ChooseUser';
const App = () => { const { currentRole } = useSelector(state => state.user);
return ( {currentRole === null && <Route path="/" element={} /> <Route path="/choose" element={} /> <Route path="/chooseasguest" element={} />
<Route path="/Adminlogin" element={<LoginPage role="Admin" />} /> <Route path="/Studentlogin" element={<LoginPage role="Student" />} /> <Route path="/Teacherlogin" element={<LoginPage role="Teacher" />} /> <Route path="/Admin/forms" element={<BasicForm />} /> <Route path="/Adminregister" element={<AdminRegisterPage />} /> <Route path='*' element={<Navigate to="/" />} /> </Routes>} {currentRole === "Admin" && <> <AdminDashboard /> </> } {currentRole === "Student" && <> <StudentDashboard /> </> } {currentRole === "Teacher" && <> <TeacherDashboard /> </> } </Router> - Assistant
- User
Cannot destructure property 'status' of 'submissionState' as it is undefined. TypeError: Cannot destructure property 'status' of 'submissionState' as it is undefined. at SubmissionPage (http://localhost:3000/main.0b13c2a4fff6e3c25dd4.hot-update.js:11363:5) at renderWithHooks (http://localhost:3000/static/js/bundle.js:96650:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:99936:17) at beginWork (http://localhost:3000/static/js/bundle.js:101232:20) at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:86242:18) at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:86286:20) at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:86343:35) at beginWork$1 (http://localhost:3000/static/js/bundle.js:106217:11) at performUnitOfWork () at workLoopSync () thsi on clcik of submisions
- Assistant
- User
ERROR in ./src/redux/store.js 19:16-33 export 'submissionReducer' (imported as 'submissionReducer') was not found in './submissionRelated/submissionSlice.js' (possible exports: addSubmission, default) also every other redicer are yellow thier o ly this is in blue
- Assistant
- User
import { configureStore } from '@reduxjs/toolkit'; import { userReducer } from './userRelated/userSlice'; import { studentReducer } from './studentRelated/studentSlice'; import { noticeReducer } from './noticeRelated/noticeSlice'; import { sclassReducer } from './sclassRelated/sclassSlice'; import { teacherReducer } from './teacherRelated/teacherSlice'; import { complainReducer } from './complainRelated/complainSlice'; import {submissionReducer} from './submissionRelated/submissionSlice';
const store = configureStore({ reducer: { user: userReducer, student: studentReducer, teacher: teacherReducer, notice: noticeReducer, complain: complainReducer, sclass: sclassReducer, submission: submissionReducer,
},});
export default store; // redux/submissionRelated/submissionSlice.js import { createSlice, createAsyncThunk } from '@reduxjs/toolkit'; import axios from 'axios';
- Assistant
Based on the code snippets you've shared, the issue arises from the way you're importing the various reducers for your Redux store. Let's break down the problem and correct it.
- User
same clciing submisisons is not redirecting me to the link
- Assistant