diff --git a/package-lock.json b/package-lock.json index aae6c97ed..28bf96b06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mulearnfrontend", - "version": "0.0.4", + "version": "0.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mulearnfrontend", - "version": "0.0.4", + "version": "0.0.5", "dependencies": { "@chakra-ui/react": "^2.6.1", "@emotion/react": "^11.10.6", diff --git a/src/App.tsx b/src/App.tsx index 02037e538..a5c709691 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -46,6 +46,7 @@ import Analytics from "./modules/Dashboard/modules/UrlShortener/Pages/Analytics" import Donation from "./modules/Public/Donation/Donation"; import Refund from "./modules/Public/Donation/pages/Refund"; import DonationSuccess from "./modules/Public/Donation/pages/DonationSuccess"; +import OpenGrad from "./modules/Dashboard/modules/OpenGrad"; const Profile = lazy( () => import("./modules/Dashboard/modules/Profile/pages/Profile") @@ -241,7 +242,9 @@ const ConnectedDevices = lazy( ); const Wadhwani = lazy(() => import("./modules/Dashboard/modules/Wadhwani")); -const Trivial = lazy(() => import("./modules/Public/TrivialIdeas/modules/trivial")); +const Trivial = lazy( + () => import("./modules/Public/TrivialIdeas/modules/trivial") +); function App() { const AuthChecker = SecureAuthRoutes(); @@ -280,8 +283,8 @@ function App() { element: }, { - path:"trivial-ideas", - element: + path: "trivial-ideas", + element: }, { path: "/", @@ -325,6 +328,10 @@ function App() { path: "wadhwani", element: }, + { + path: "opengrad", + element: + }, { path: "refer", element: diff --git a/src/modules/Dashboard/layouts/DashboardRootLayout.tsx b/src/modules/Dashboard/layouts/DashboardRootLayout.tsx index 06bcfa7a5..a9f296452 100644 --- a/src/modules/Dashboard/layouts/DashboardRootLayout.tsx +++ b/src/modules/Dashboard/layouts/DashboardRootLayout.tsx @@ -65,6 +65,12 @@ const DashboardRootLayout = (props: { component?: any }) => { hasView: true, icon: }, + { + url: "/dashboard/opengrad", + title: "OpenGrad", + hasView: true, + icon: + }, { url: "/dashboard/refer", title: "Referrals", diff --git a/src/modules/Dashboard/modules/OpenGrad/index.module.css b/src/modules/Dashboard/modules/OpenGrad/index.module.css new file mode 100644 index 000000000..0013fd034 --- /dev/null +++ b/src/modules/Dashboard/modules/OpenGrad/index.module.css @@ -0,0 +1,116 @@ +/* General Styles */ +.wrapper h1 { + font-weight: bold; + font-size: 3rem; +} + +.course { + display: grid; + grid-template-columns: repeat(3, 1fr); /* Three cards per row */ + gap: 2rem; /* Increased gap */ + justify-items: center; +} + +/* Course Card Styles */ +.containercard { + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 1.5rem; + margin: 12px; + border: 1px solid #ccc; + border-radius: 8px; + max-width: 300px; /* Increased max-width */ + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + transition: transform 0.3s ease-in-out; + font-family: Poppins, sans-serif; + gap: 1.5rem; +} + +.containercard:hover { + transform: translateY(-5px); +} + +/* Image Styles */ +.courseImage { + width: 100%; + height: auto; + border-radius: 8px; + margin-bottom: 16px; +} + +/* Text Styles */ +.title { + font-weight: 500; + font-size: 24px; + margin-bottom: 0.5rem; +} + +.desc { + color: #404d61; + font-size: 0.9rem; +} + +.duration, +.lessons { + color: #404d61; + opacity: 0.5; + font-weight: 500; + margin-top: 0.5rem; + font-size: 0.9rem; +} + +.cta { + background: #456ff6; + color: white; + padding: 0.5rem 1rem; + border-radius: 5px; + cursor: pointer; + border: none; + transition: background-color 0.3s ease-in-out; +} + +.cta:hover { + background: #3457d5; +} + +/* Responsive Styles */ +@media screen and (max-width: 1300px) { + .course { + grid-template-columns: repeat(2, 1fr); /* Two cards per row */ + } + .containercard { + width: 45vw; + height: auto; /* Adjust height to maintain aspect ratio */ + } +} + +@media screen and (max-width: 700px) { + .wrapper h1 { + font-size: 2rem; + } + .course { + grid-template-columns: repeat(1, 1fr); /* One card per row */ + } + .containercard { + width: 70vw; + height: auto; /* Adjust height to maintain aspect ratio */ + } +} + +@media screen and (max-width: 500px) { + .course { + grid-template-columns: repeat(1, 1fr); /* One card per row */ + } + .containercard { + width: 85vw; + height: auto; /* Adjust height to maintain aspect ratio */ + } +} + +.second_view_container { + margin-top: 3rem; + padding: 2rem; + background-color: #ffffff; +} diff --git a/src/modules/Dashboard/modules/OpenGrad/index.tsx b/src/modules/Dashboard/modules/OpenGrad/index.tsx new file mode 100644 index 000000000..36b04329b --- /dev/null +++ b/src/modules/Dashboard/modules/OpenGrad/index.tsx @@ -0,0 +1,139 @@ +import React from "react"; +import styles from "./index.module.css"; +import MuLoader from "@/MuLearnComponents/MuLoader/MuLoader"; + +interface CourseCardProps { + title: string; + // desc: string; + // duration: string; + url: string; + imageUrl: string; + lessons: string; +} + +const OpenGrad: React.FC = () => { + const isLoading = false; // Set to true if you want to show the loader + + const hardcodedCourses = [ + { + courseId: "1", + url: "home/test", + courseName: "MBA Bundle", + // description: + // "This is a description of course 1. It provides an overview of the course content.", + // CourseDuration: "10", + imageUrl: + "https://imgproxy.learnyst.com/learnyst-user-assets/school-assets/schools/157986/courses/189940/17128570399041564c161_efc4_475b_9151_8549c1ac8969_lyst1712857039920.jpg", + lessons: " " + }, + { + courseId: "1", + url: "CAT-Malayalam", + courseName: "CAT (Malayalam)", + // description: + // "This is a description of course 1. It provides an overview of the course content.", + // CourseDuration: "10", + imageUrl: + "https://imgproxy.learnyst.com/learnyst-user-assets/school-assets/schools/157986/courses/195295/1718119061947Screenshot_2024_06_11_at_81501_PMpng_lyst1718119061974.png", + lessons: "17 lessons" + }, + { + courseId: "3", + url: "CUET-UG-Malayalam", + courseName: "CUET UG (Malayalam)", + // description: + // "This is a description of course 1. It provides an overview of the course content.", + // CourseDuration: "10", + imageUrl: + "https://imgproxy.learnyst.com/learnyst-user-assets/school-assets/schools/157986/courses/189121/1712066546664ddd958be_3b42_4082_84de_893bf0061a32_lyst1786.jpg", + lessons: "60 lessons" + }, + { + courseId: "4", + url: "CUET-UG-Mock-Tests-test", + courseName: "CUET UG Questions & Mocks", + // description: + // "This is a description of course 1. It provides an overview of the course content.", + // CourseDuration: "10", + imageUrl: + "https://imgproxy.learnyst.com/learnyst-user-assets/school-assets/schools/157986/courses/186487/1711619074132fc94d707_d408_4c2d_aeaa_446cd850b7f4_lyst9700.jpg", + lessons: " " + } + // { + // courseId: "", + // url: "root", + // courseName: "", + // // description: + // // "This is a description of course 1. It provides an overview of the course content.", + // // CourseDuration: "10", + // imageUrl: "", + // lessons: + // }, + ]; + + const handleCourseSelection = (id: string) => { + // Replace with actual course link if necessary + const courseLink = `https://opengrad-foundation.learnyst.com/learn/${id}`; + window.open(courseLink, "_blank"); + }; + + const CourseCard: React.FC = ({ + title, + // desc, + // duration, + url, + imageUrl, + lessons + }) => { + return ( +
+ {title} +
+

{title}

+ {/*

{desc}

+

{duration}hrs

*/} +

{lessons}

+
+ +
+ ); + }; + if (isLoading) { + return ; + } + return ( +
+

OpenGrad Courses

+
+
+
+
+ {hardcodedCourses.map(course => ( + + ))} +
+
+
+
+
+ ); +}; + +export default OpenGrad; diff --git a/src/modules/Dashboard/modules/Tasks/TaskApis.ts b/src/modules/Dashboard/modules/Tasks/TaskApis.ts index ee8ba8268..02d5339e6 100644 --- a/src/modules/Dashboard/modules/Tasks/TaskApis.ts +++ b/src/modules/Dashboard/modules/Tasks/TaskApis.ts @@ -112,7 +112,7 @@ export const editTask = async ( bonus_karma?: string ) => { try { - const formattedBonusTime = bonus_time + const formattedBonusTime = (bonus_time && bonus_time != "") ? new Date(bonus_time).toISOString() // Convert bonus_time to ISO format : null; diff --git a/src/services/urls.ts b/src/services/urls.ts index b8571ebcb..d12bb37cf 100644 --- a/src/services/urls.ts +++ b/src/services/urls.ts @@ -181,6 +181,11 @@ export const dashboardRoutes = { getWadhwaniClientToken: "api/v1/integrations/wadhwani/auth-token/", getWadhwaniCourses: "api/v1/integrations/wadhwani/course-details/", getWadhwaniCourseLink: "api/v1/integrations/wadhwani/user-login/", + + //OpenGrad + getOpenGradClientToken: "api/v1/integrations/OpenGrad/auth-token/", + getOpenGradCourses: "api/v1/integrations/OpenGrad/course-details/", + getOpenGradCourseLink: "api/v1/integrations/OpenGrad/user-login/" } as const; export const organizationRoutes = { @@ -244,5 +249,5 @@ export const googleSheetRoutes = { export const donationRoutes = { order: "api/v1/donate/order/", - verify : "api/v1/donate/verify/", -} \ No newline at end of file + verify: "api/v1/donate/verify/" +};