Skip to content

Commit c1b6b61

Browse files
authored
Merge pull request #63 from F-Code-Project-Mini/chore/change-layout
Chore/change layout
2 parents 7f2bbde + 606acb7 commit c1b6b61

5 files changed

Lines changed: 81 additions & 2 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">

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

0 commit comments

Comments
 (0)