feat: Refactor Mentor Settings Page and improve user profile handling

- Removed MentorSettingsPage component to streamline user profile management.
- Updated ProjectForumTab and ProjectsInternTab for better UI/UX.
- Enhanced ProjectsPage loading state with a spinner.
- Improved TaskTab to handle loading states and error messages more effectively.
- Added new utility functions for user initials and file URL resolution.
- Updated UserService to normalize user data and handle profile updates more efficiently.
- Enhanced CSS styles for better visual consistency across components.
- Added new properties to CurrentUser type for better user data management.
This commit is contained in:
Kemas M. Aryadary Rasyad
2026-07-14 17:20:15 +07:00
parent a124a2b96e
commit c2aacb505f
37 changed files with 613 additions and 668 deletions
@@ -9,7 +9,7 @@ import { useProjectDetail } from "../../../hooks/useProjects";
import { useMyCertificates } from "../../../hooks/useCertificates";
import type { Project } from "../../../types/project.types";
export default function InternCertificateDetail () {
export default function InternCertificateDetail() {
const { slug } = useParams<{ slug: string }>();
const location = useLocation();
const projectFromList = location.state?.project as Project | undefined;
@@ -43,8 +43,19 @@ export default function InternCertificateDetail () {
if (isLoading) {
return (
<div className="flex items-center justify-center py-20 text-gray-400 text-sm">
Memuat Data...
<div>
<div className="mb-4 flex flex-col gap-1">
<h1 className="page-title">Certificates</h1>
<p className="page-title-desc">View and download internship certificates</p>
</div>
<div className="flex flex-col lg:flex-row gap-6 items-stretch animate-pulse">
{/* Kolom kiri: certificate box */}
<div className="w-full lg:w-5/8 h-[420px] bg-gray-200 rounded-xl" />
{/* Kolom kanan: history box */}
<div className="w-full lg:w-3/8 flex-shrink-0 h-[420px] bg-gray-200 rounded-xl" />
</div>
</div>
);
}
@@ -61,7 +72,7 @@ export default function InternCertificateDetail () {
<CertificateAvailable
project={project}
certificate={myCertificateForProject}
templateUrl = {project?.certificate_template ?? ""}
templateUrl={project?.certificate_template ?? ""}
/>
) : (
<CertificateNotAvailable