From d4c263cad338f623471deb74a08078d83c5ded41 Mon Sep 17 00:00:00 2001 From: euxzy Date: Tue, 22 Jul 2025 08:20:59 +0700 Subject: [PATCH] feat(dimentorin): slicing landing page detail mentor --- .../[id]/_components/sections/education.tsx | 33 +++++++ .../[id]/_components/sections/experience.tsx | 34 +++++++ .../[id]/_components/sections/profile.tsx | 89 +++++++++++++++++++ .../_components/sections/senpai-schedule.tsx | 71 +++++++++++++++ .../sections/senpai-statistics.tsx | 34 +++++++ .../[id]/_components/sections/topics.tsx | 33 +++++++ .../src/app/(public)/mentoring/[id]/page.tsx | 45 ++++++++++ .../mentoring/_components/mentor-card.tsx | 7 +- apps/dimentorin/src/middleware.ts | 12 ++- 9 files changed, 355 insertions(+), 3 deletions(-) create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/education.tsx create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/experience.tsx create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-schedule.tsx create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-statistics.tsx create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/topics.tsx create mode 100644 apps/dimentorin/src/app/(public)/mentoring/[id]/page.tsx diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/education.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/education.tsx new file mode 100644 index 0000000..c50cc9b --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/education.tsx @@ -0,0 +1,33 @@ +import { cn, For } from "@imphnen-frontend-service/utils" + +const EDUCATION = [ + { name: 'Universitas Widyabakti', major: 'Intern Front End', duration: '2 Months', range: 'Oct 2024 - Present' }, + { name: 'SMKN 99 Banjaran', major: 'Rekayasa Perangkat Lunak', duration: '6 Months', range: 'May 2024 - Oct 2024' }, +] + +export const EducationSection = () => { + return ( +
+

Education

+
+ + {(item, index) => ( +
+
+
+

{item.name}

+

+ {item.major} + · + {item.duration} + · + {item.range} +

+
+
+ )} +
+
+
+ ) +} diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/experience.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/experience.tsx new file mode 100644 index 0000000..77beb1e --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/experience.tsx @@ -0,0 +1,34 @@ +import { cn, For } from "@imphnen-frontend-service/utils" +import { FC } from "react" + +const EXPERIENCE = [ + { name: 'Sunday.com', position: 'Intern Front End', duration: '2 Months', range: 'Oct 2024 - Present' }, + { name: 'CodeX Digital', position: 'Intern Front End', duration: '6 Months', range: 'May 2024 - Oct 2024' }, +] + +export const ExperienceSection: FC = () => { + return ( +
+

Experience

+
+ + {(item, index) => ( +
+
+
+

{item.name}

+

+ {item.position} + · + {item.duration} + · + {item.range} +

+
+
+ )} +
+
+
+ ) +} diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx new file mode 100644 index 0000000..78435db --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/profile.tsx @@ -0,0 +1,89 @@ +import { StarFilled } from "@ant-design/icons" +import { Button } from "@imphnen-frontend-service/ui/atoms" +import { cn, For } from "@imphnen-frontend-service/utils" + +export const ProfileSection: React.FC = () => { + return ( +
+
+
+ Mentor +
+ +
+

+ Muhammad Firdaus Oi Oi Oi, S.H., M.H. +

+

+ UI Designer at Oray orayan Studios +

+
+
+ +
+
+

Excelent Sensei

+

4.8/5.0

+
+
+
+
+ +
+
+

Expertise

+
+ + {(item) => ( +
+ {item} +
+ )} +
+
+
+
+

Soft Skills

+
+ + {(item) => ( +
+ {item} +
+ )} +
+
+
+
+ +
+
+

Jum, 4 April 2025

+

Jum, 4 April 2025

+
+ +
+
+ ) +} diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-schedule.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-schedule.tsx new file mode 100644 index 0000000..3f7af36 --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-schedule.tsx @@ -0,0 +1,71 @@ +import { Button } from "@imphnen-frontend-service/ui/atoms" +import { cn, For } from "@imphnen-frontend-service/utils" +import { FC } from "react" + +const SCHEDULES = [ + { + date: "Kamis, 20 Maret 2025", + availableCount: 10, + schedule: [ + { time: "19:00 WIB", available: true }, + { time: "20:00 WIB", available: true }, + { time: "21:00 WIB", available: true }, + { time: "22:00 WIB", available: true }, + ] + }, + { + date: "Jumat, 21 Maret 2025", + availableCount: 1, + schedule: [ + { time: "19:00 WIB", available: true }, + { time: "20:00 WIB", available: true }, + { time: "21:00 WIB", available: false }, + { time: "22:00 WIB", available: true }, + ] + } +] + +export const SenpaiScheduleSection: FC = () => { + return ( +
+

Senpai Schedule

+
+ + {(item) => ( +
+
+

{item.date}

+

5 ? "bg-primary-200 text-primary-500" : "bg-danger-100 text-danger-600" + )} + > + {item.availableCount} slot tersisa +

+
+
+ + {(schedule, index) => ( +
+ {schedule.time} +
+ )} +
+
+
+ )} +
+ +
+ + +
+
+ ) +} \ No newline at end of file diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-statistics.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-statistics.tsx new file mode 100644 index 0000000..db06cac --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/senpai-statistics.tsx @@ -0,0 +1,34 @@ +import { StarFilled } from "@ant-design/icons"; +import { For } from "@imphnen-frontend-service/utils"; +import { FC } from "react"; + +const SENPAI_STATISTIC = [ + { name: 'Total Sessions', count: 8 }, + { name: 'Mentee Impact', count: 1000 }, + { name: 'Response Time', count: '30 Minute' } +] + +export const StatisticsSection: FC = () => { + return ( +
+

Senpai Statistics

+
+ + {(item, index) => ( +
+
+ +
+
+

{item.count}

+

{item.name}

+
+
+ )} +
+
+
+ ) +}; \ No newline at end of file diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/topics.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/topics.tsx new file mode 100644 index 0000000..24913fa --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/_components/sections/topics.tsx @@ -0,0 +1,33 @@ +import { For } from "@imphnen-frontend-service/utils" +import { FC } from "react" + +const TOPICS = [ + { icon: '💼', name: 'Career & Self Development' }, + { icon: '🏢', name: 'Industry Insight' }, + { icon: '🗂️', name: 'Project Management & IT Tools' }, + { icon: '🖥️', name: 'Basic IT' }, + { icon: '💻', name: 'Programming/Software Dev' }, + { icon: '🗃️', name: 'Data & Database' }, + { icon: AI, name: 'AI Tips' } +] + +export const TopicsSection: FC = () => { + return ( +
+

Topics

+
+ + {(item, index) => ( +
+ {item.icon} + {item.name} +
+ )} +
+
+
+ ) +} diff --git a/apps/dimentorin/src/app/(public)/mentoring/[id]/page.tsx b/apps/dimentorin/src/app/(public)/mentoring/[id]/page.tsx new file mode 100644 index 0000000..3a97de1 --- /dev/null +++ b/apps/dimentorin/src/app/(public)/mentoring/[id]/page.tsx @@ -0,0 +1,45 @@ +import { FC } from 'react' +import { ProfileSection } from './_components/sections/profile' +import { StatisticsSection } from './_components/sections/senpai-statistics' +import { TopicsSection } from './_components/sections/topics' +import { ExperienceSection } from './_components/sections/experience' +import { EducationSection } from './_components/sections/education' +import { SenpaiScheduleSection } from './_components/sections/senpai-schedule' + + + + +export const Components: FC = () => { + return ( +
+
+
+ + +
+
+ + + +
+

Senpai Resume

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi. Aliquam in hendrerit urna. Pellentesque sit amet sapien fringilla, mattis ligula consectetur, ultrices mauris. Maecenas vitae mattis tellus. Nullam quis imperdiet augue. Vestibulum auctor ornare leo, non suscipit magna interdum eu. Curabitur pellentesque nibh nibh, at maximus ante fermentum sit amet. Pellentesque commodo lacus at sodales sodales. Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, eget tempus orci facilisis id. +

+
+ + + +
+ +
+ +
+
+
+
+
+ ) +} + +export default Components diff --git a/apps/dimentorin/src/app/(public)/mentoring/_components/mentor-card.tsx b/apps/dimentorin/src/app/(public)/mentoring/_components/mentor-card.tsx index f557f26..6a108e0 100644 --- a/apps/dimentorin/src/app/(public)/mentoring/_components/mentor-card.tsx +++ b/apps/dimentorin/src/app/(public)/mentoring/_components/mentor-card.tsx @@ -1,5 +1,6 @@ import { Button } from '@imphnen-frontend-service/ui/atoms'; import { FC } from 'react'; +import { Link } from 'react-router-dom'; export const MentorCard: FC = () => { return ( @@ -11,8 +12,10 @@ export const MentorCard: FC = () => { -

- Fullname +

+ + Fullname +

Full Stack Enjoyer at name company diff --git a/apps/dimentorin/src/middleware.ts b/apps/dimentorin/src/middleware.ts index 9dcb68e..e1c2f62 100644 --- a/apps/dimentorin/src/middleware.ts +++ b/apps/dimentorin/src/middleware.ts @@ -14,7 +14,6 @@ const mappingPublicRoutes = [ '/auth/register/otp', '/auth/register/success', '/auth/new-password', - '/mentoring' ]; const mappingRoutePermissions = [ @@ -72,6 +71,10 @@ const mappingRoutePermissions = [ }, ]; +const mappingPublicPrefixRoutes = [ + '/mentoring', +] + //TODO : Fix this later // const redirectToFirstAccessibleRoute = (userPermissions: string[]) => { // const fallback = mappingRoutePermissions.find((route) => @@ -88,6 +91,13 @@ export const middleware = async ({ request }: LoaderFunctionArgs) => { const token = session_token?.token?.access_token; const userPermissions = session?.role?.permissions?.map?.((perm) => perm?.name) ?? []; + + // Allow to access the landing page without authentication + // So, if the route prefix is in the mappingPublicPrefixRoutes, we return null + // to indicate that we don't need to authenticate the user + if (mappingPublicPrefixRoutes.some((prefix) => pathname.startsWith(prefix))) { + return null; + } if (mappingPublicRoutes.includes(pathname)) { if (token) return redirect('/dashboard');