Skip to content

Commit 743fa38

Browse files
authored
Merge pull request #64 from F-Code-Project-Mini/dev
Dev
2 parents 6eb8a55 + c1b6b61 commit 743fa38

7 files changed

Lines changed: 147 additions & 3 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { useEffect } from "react";
2+
import { useLocation } from "react-router";
3+
4+
const ScrollToTop = () => {
5+
const { pathname } = useLocation();
6+
7+
useEffect(() => {
8+
window.scrollTo(0, 0);
9+
}, [pathname]);
10+
11+
return null;
12+
};
13+
14+
export default ScrollToTop;

frontend/src/layout/MainLayout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Outlet, useLocation, useNavigate } from "react-router";
33
import startTour from "~/components/AnimatedTour";
44
import Footer from "~/components/Footer";
55
import Header from "~/components/Header";
6+
import ScrollToTop from "~/components/ScrollToTop";
67
import { USER_ROLE } from "~/constants/enums";
78
import useAuth from "~/hooks/useAuth";
89
import LocalStorage from "~/utils/localstorage";
@@ -41,6 +42,8 @@ const MainLayout = () => {
4142
}
4243
}, [isLogin, user.role]);
4344

45+
ScrollToTop();
46+
4447
return (
4548
<>
4649
<section className="flex min-h-screen flex-col justify-between bg-gradient-to-b from-gray-50/50 to-white px-4 xl:px-6">
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const Notification = () => {
2+
return (
3+
<div
4+
className="mb-6 rounded-lg border border-yellow-300/60 bg-linear-to-r from-yellow-50 to-amber-50 px-5 py-4 shadow-xs"
5+
role="alert"
6+
>
7+
<div className="flex items-center gap-3">
8+
<div className="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-yellow-500 text-white">
9+
<span className="text-sm font-bold">!</span>
10+
</div>
11+
<div className="flex-1">
12+
<p className="text-sm font-semibold text-red-600">Lưu ý quan trọng dành cho Mentor</p>
13+
<ul className="mt-2.5 space-y-2">
14+
<li className="flex items-center gap-2 text-sm text-gray-700">
15+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
16+
<span>
17+
<span className="font-semibold text-red-600">Chấm điểm theo barem:</span> Vui lòng{" "}
18+
<span className="font-semibold">đọc kỹ và tuân thủ đúng tiêu chí barem</span> đã được
19+
quy định cho từng hạng mục đánh giá.
20+
</span>
21+
</li>
22+
<li className="flex items-center gap-2 text-sm text-gray-700">
23+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
24+
<span>
25+
<span className="font-semibold text-red-600">Điền đầy đủ điểm số:</span> Bạn cần{" "}
26+
<span className="font-semibold">điền hết tất cả các cột điểm</span> cho từng tiêu chí
27+
đánh giá, không được bỏ trống.
28+
</span>
29+
</li>
30+
<li className="flex items-center gap-2 text-sm text-gray-700">
31+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
32+
<span>
33+
<span className="font-semibold text-red-600">Ghi chú chi tiết:</span> Hãy{" "}
34+
<span className="font-semibold">ghi chú rõ ràng, cụ thể</span> về điểm mạnh, điểm yếu và
35+
lý do chấm điểm.
36+
</span>
37+
</li>
38+
<li className="flex items-center gap-2 text-sm text-gray-700">
39+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
40+
<span>
41+
<span className="font-semibold text-red-600">Thời hạn:</span> Hoàn thành việc chấm điểm
42+
và điền đầy đủ thông tin <span className="font-semibold">trước ngày 24/01/2026</span>.
43+
</span>
44+
</li>
45+
<li className="flex items-center gap-2 text-sm text-gray-700">
46+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
47+
<span>
48+
<span className="font-semibold">Ban tổ chức sẽ duyệt và đọc lại</span> toàn bộ đánh giá
49+
khi kết thúc Challenge để đảm bảo tính công bằng.
50+
</span>
51+
</li>
52+
</ul>
53+
</div>
54+
</div>
55+
</div>
56+
);
57+
};
58+
59+
export default Notification;

frontend/src/pages/Mentor/Barem/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import useAuth from "~/hooks/useAuth";
1010
import type { CandidateType } from "~/types/team.types";
1111
import { BadgeCheck } from "lucide-react";
1212
import BadgeLeader from "~/components/BadgeLeader";
13+
import Notification from "./Notification";
1314
type ParamsBarem = {
1415
id: string;
1516
candidateId?: string;
@@ -215,6 +216,8 @@ const MentorBaremPage = () => {
215216
</RadioGroup>
216217
</div>
217218

219+
<Notification />
220+
218221
<section className="my-6" id="barem-table">
219222
<div className="overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xs">
220223
<div className="border-b border-gray-200 bg-gradient-to-r from-gray-50 to-white px-4 py-4 sm:px-6">
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
const Notification = () => {
2+
return (
3+
<div
4+
className="mb-6 rounded-lg border border-yellow-300/60 bg-linear-to-r from-yellow-50 to-amber-50 px-5 py-4 shadow-xs"
5+
role="alert"
6+
>
7+
<div className="flex items-center gap-3">
8+
<div className="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-yellow-500 text-white">
9+
<span className="text-sm font-bold">!</span>
10+
</div>
11+
<div className="flex-1">
12+
<p className="text-sm font-semibold text-red-600">Lưu ý quan trọng dành cho Mentor</p>
13+
<ul className="mt-2.5 space-y-2">
14+
<li className="flex items-center gap-2 text-sm text-gray-700">
15+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
16+
<span>
17+
Hãy <span className="font-semibold">thường xuyên theo dõi và đôn đốc</span> các ứng viên
18+
trong nhóm của bạn{" "}
19+
<span className="font-semibold">hoàn thành tiến độ đề tài đúng hạn</span>
20+
</span>
21+
</li>
22+
23+
<li className="flex items-center gap-2 text-sm text-gray-700">
24+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
25+
<span>
26+
Tham gia vào các buổi họp của nhóm để quan sát và đánh giá cách làm việc của ứng viên.
27+
</span>
28+
</li>
29+
30+
<li className="flex items-center gap-2 text-sm text-gray-700">
31+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
32+
<span>
33+
Hướng dẫn nhóm <span className="font-semibold">bầu chọn Leader</span> - người{" "}
34+
<span className="font-semibold">đại diện chính thức</span> của nhóm. CLB sẽ làm việc
35+
trực tiếp với Leader
36+
</span>
37+
</li>
38+
39+
<li className="flex items-center gap-2 text-sm text-gray-700">
40+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
41+
<span>
42+
<span className="font-semibold">Quyền hạn Leader:</span> Đặt tên nhóm, nộp đề tài, nộp
43+
báo cáo tiến độ, liên hệ với Ban tổ chức khi cần hỗ trợ.
44+
</span>
45+
</li>
46+
47+
<li className="flex items-center gap-2 text-sm text-gray-700">
48+
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-yellow-500"></span>
49+
<span>
50+
<span className="font-semibold">Động viên tinh thần</span> các ứng viên và{" "}
51+
<span className="font-semibold">đánh giá</span> một cách công tâm, khách quan để đầu vào
52+
của CLB thật chất lượng.
53+
</span>
54+
</li>
55+
</ul>
56+
</div>
57+
</div>
58+
</div>
59+
);
60+
};
61+
62+
export default Notification;

frontend/src/pages/Mentor/Team.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ const Team = ({ team }: { team: TeamType }) => {
110110
</td>
111111
<td className="px-4 py-3.5 text-sm whitespace-nowrap text-gray-600 sm:px-6 sm:py-4 md:table-cell">
112112
<div className="flex flex-col gap-2">
113-
<div className="flex items-center gap-1 text-xs">
113+
<div className="flex items-center gap-1 text-sm">
114114
<span className="text-gray-500">Điểm:</span>
115115
<span
116116
className={`font-semibold ${Helper.belowAverage(member.scoreMentor) ? "text-red-500" : "text-green-500"}`}
117117
>
118118
{member.scoreMentor || 0}
119119
</span>
120-
<span className="text-gray-500">/100</span>
120+
<span className="text-gray-500">/{isLeader ? "100" : "85"}</span>
121121
</div>
122122
{user.isConfirm && (
123123
<Button

frontend/src/pages/Mentor/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { TeamType } from "~/types/team.types";
55
import TeamApi from "~/api-requests/team.requests";
66
import useAuth from "~/hooks/useAuth";
77
import Timeline from "../Candidate/Timeline";
8+
import Notification from "./Notification";
89

910
const MentorPage = () => {
1011
const { user } = useAuth();
@@ -22,7 +23,9 @@ const MentorPage = () => {
2223
<section className="mb-6 sm:mb-8">
2324
<WelcomePartition />
2425
</section>
25-
26+
<section>
27+
<Notification />
28+
</section>
2629
<section className="col-span-1 space-y-10 lg:col-span-8" id="members">
2730
{teams && teams.result.length === 0 && (
2831
<p className="text-center text-lg font-medium">

0 commit comments

Comments
 (0)