Feat : tách code, thêm mới button quay lại

quy_fe
Quy_FE 3 months ago
parent e092dc64b1
commit 943e3facd5
  1. 16
      src/_components/renderIcon/index.js
  2. 4
      src/_screens/home/detail-room-education/index.js
  3. 18
      src/_screens/home/education-department/index.js
  4. 16
      src/_screens/home/headmaster/index.js
  5. 5
      src/_screens/home/teacher/index.js

@ -174,3 +174,19 @@ export const renderIconDate = () => (
/>
</svg>
)
export const renderIconBook = () => {
return (
<svg
width="29"
height="29"
viewBox="0 0 29 29"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2359 2.71875L3.12973 6.05873H3.11342C2.91223 6.05873 0.90625 6.11492 0.90625 8.35789C0.90625 9.33256 1.33853 10.0589 1.33853 10.0589L10.5614 25.4842C11.4432 26.8889 13.316 26.0094 13.316 26.0094L27.4585 19.1196L26.9292 18.5827C26.8046 17.9379 26.7321 16.7439 27.6075 15.8548C27.627 15.8349 27.6307 15.8077 27.6411 15.7828L28.0938 15.6011L15.2359 2.71875ZM15.6115 5.66044L18.0869 8.35517L8.84727 11.7387L6.66502 8.30578L15.6115 5.66044ZM10.2343 23.1719L2.12153 9.60172C2.11791 9.59673 1.8125 9.05389 1.8125 8.35789C1.8125 7.4752 2.24478 7.13944 2.66755 7.02208L11.9444 21.4931C11.2461 21.7953 10.4658 22.4859 10.2343 23.1719ZM26.4679 17.2826C26.4385 17.4911 26.4235 17.6941 26.4267 17.8844L17.1426 22.291L26.4598 18.3371C26.4688 18.4096 26.477 18.4816 26.4883 18.5469L14.587 24.2952L26.5821 18.9751L26.5894 19.0036L13.316 25.3533C13.3096 25.3573 12.7038 25.6795 12.0966 25.6795C11.4967 25.6795 11.1229 25.3714 10.9525 24.7379C10.5143 23.1103 13.0038 22.1877 13.0414 22.1741L26.8087 16.2178C26.7099 16.399 26.6415 16.5839 26.5844 16.7674L17.845 20.8814L26.4679 17.2826Z"
fill="white"
/>
</svg>
);
};

@ -11,7 +11,7 @@ import './detailRoomEducation.style.scss'
import BoxDoughnutChart from "../../../_components/boxChart/BoxDoughnutChar";
import BoxDoughnutBarChart from "../../../_components/boxChart/BoxDoughnutBarChart";
import { apiCaller, history } from "../../../_helpers";
import { replacePathParams } from "../../../_helpers/utils";
import { exportExcel, replacePathParams } from "../../../_helpers/utils";
import $ from "jquery";
import { useLocation, useParams } from "react-router-dom";
@ -292,7 +292,7 @@ export default function DetailRoomEducation() {
'Stt',
'Tên trường',
'Tiêu chí giao bài',
'Tiêu chú tỷ lệ học sinh làm bài',
'Tiêu chí tỷ lệ học sinh làm bài',
'Mức độ hoàn thành tiêu chí',
'Huyện',
'Tỉnh'

@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import InputText from "../../../_components/Auth/InputText";
import Header from "../../../_components/Header";
import {
renderIconBook,
renderIconButton,
renderIconHome,
renderIconSearchInput,
@ -105,23 +106,6 @@ export default function EducationDepartmentHome() {
getDataTeacherChart()
}, [dateTeacherChart])
const renderIconBook = () => {
return (
<svg
width="29"
height="29"
viewBox="0 0 29 29"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15.2359 2.71875L3.12973 6.05873H3.11342C2.91223 6.05873 0.90625 6.11492 0.90625 8.35789C0.90625 9.33256 1.33853 10.0589 1.33853 10.0589L10.5614 25.4842C11.4432 26.8889 13.316 26.0094 13.316 26.0094L27.4585 19.1196L26.9292 18.5827C26.8046 17.9379 26.7321 16.7439 27.6075 15.8548C27.627 15.8349 27.6307 15.8077 27.6411 15.7828L28.0938 15.6011L15.2359 2.71875ZM15.6115 5.66044L18.0869 8.35517L8.84727 11.7387L6.66502 8.30578L15.6115 5.66044ZM10.2343 23.1719L2.12153 9.60172C2.11791 9.59673 1.8125 9.05389 1.8125 8.35789C1.8125 7.4752 2.24478 7.13944 2.66755 7.02208L11.9444 21.4931C11.2461 21.7953 10.4658 22.4859 10.2343 23.1719ZM26.4679 17.2826C26.4385 17.4911 26.4235 17.6941 26.4267 17.8844L17.1426 22.291L26.4598 18.3371C26.4688 18.4096 26.477 18.4816 26.4883 18.5469L14.587 24.2952L26.5821 18.9751L26.5894 19.0036L13.316 25.3533C13.3096 25.3573 12.7038 25.6795 12.0966 25.6795C11.4967 25.6795 11.1229 25.3714 10.9525 24.7379C10.5143 23.1103 13.0038 22.1877 13.0414 22.1741L26.8087 16.2178C26.7099 16.399 26.6415 16.5839 26.5844 16.7674L17.845 20.8814L26.4679 17.2826Z"
fill="white"
/>
</svg>
);
};
const handleSubmit = ()=>{
}

@ -116,13 +116,15 @@ export default function HeadmasterHome() {
};
const handleClickTeacherItem = (item) => {
history.push(
replacePathParams(PATH.home.detailTeacher, {
teacherId: item?.teacher_id,
}) +
"?teacher_name=" +
encodeURIComponent(item?.teacher_name),
);
const teacherId = item?.teacher_id;
const teacherName = encodeURIComponent(item?.teacher_name);
const detailPath = replacePathParams(PATH.home.detailTeacher, { teacherId });
history.push({
pathname: detailPath,
search: `?teacher_name=${teacherName}`,
state: { isBack: true },
});
}
const handleClickGradeItem = (item) => {

@ -19,13 +19,15 @@ import { useEffect, useState,useRef } from "react";
import { apiCaller, history } from "../../../_helpers";
import { configConstants } from "../../../_constants";
import { exportExcel } from "../../../_helpers/utils";
import { useParams } from "react-router-dom";
import { useLocation, useParams } from "react-router-dom";
export default function TeacherHome() {
const search = history?.location?.search;
const params = new URLSearchParams(search);
const teacher_name = params.get("teacher_name");
const { teacherId } = useParams();
const location = useLocation();
const isBack = location.state?.isBack;
const authentication = useSelector((state) => state.authentication);
const [schoolYear, setSchoolYear] = useState(
defaultMonthYearSemester.schoolYear,
@ -226,6 +228,7 @@ export default function TeacherHome() {
<Header
icon={renderIconHome({ color: "#4D4D4D" })}
title={"Danh sách lớp của giáo viên " + teacherName}
isBack={isBack}
/>
<div className="container-page-header container-page-sidebar">
<div className="teacher-home-container bg-main-img">

Loading…
Cancel
Save