Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prod #1615

Merged
merged 38 commits into from
Aug 12, 2024
Merged

prod #1615

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a665d53
fix(bug):Fixed null mobile number handling and added validation.
arjuncvinod Jun 5, 2024
dc02335
Merge branch 'gtech-mulearn:dev' into dev
arjuncvinod Jun 7, 2024
ccb43c0
refactor(update):Wadhwani course description length updated
arjuncvinod Jun 8, 2024
c9706c3
feat(loader):Muloader added
arjuncvinod Jun 8, 2024
53cdf95
style(wadhwani): Added cursor pointer for course button
arjuncvinod Jun 8, 2024
d2b610a
Update package.json
Jenin82 Jun 9, 2024
bdb5242
Merge pull request #1562 from arjuncvinod/dev
viraka Jun 14, 2024
14fd7b3
Merge pull request #1567 from gtech-mulearn/dev
viraka Jun 14, 2024
a9bd6dd
style(UI):Donation page redisigned
arjuncvinod Jun 20, 2024
4681f76
feat(Trivialideas): Added new pages for Trivial Ideas
alanfrancis442 Jun 21, 2024
f776ea4
Merge pull request #1569 from arjuncvinod/dev
viraka Jun 21, 2024
5cd93a6
Merge pull request #1568 from alanfrancis442/dev
viraka Jun 21, 2024
2aededc
Merge pull request #1570 from gtech-mulearn/dev
viraka Jun 21, 2024
3178105
fix(TrivialIdeas): mobile view font size
alanfrancis442 Jun 24, 2024
8ff5365
feat(Donation): Added pdf download feature
alanfrancis442 Jun 26, 2024
0c04526
fix(Profile):Fixed profile image update issue
alanfrancis442 Jun 27, 2024
e95abc3
Merge pull request #1571 from alanfrancis442/dev
viraka Jun 28, 2024
d4d9b26
Merge pull request #1572 from gtech-mulearn/dev
viraka Jun 28, 2024
d3a23b0
fix(DashboardRootLayout): changed-associate-permissions.
viraka Jun 29, 2024
dd053ce
Merge branch 'dev-server' of https://github.com/gtech-mulearn/mulearn…
viraka Jun 29, 2024
844b631
fix(Donation): pdf icon changed
alanfrancis442 Jul 5, 2024
92c06cc
Merge branch 'gtech-mulearn:dev' into dev
alanfrancis442 Jul 5, 2024
77a6543
Merge pull request #1581 from alanfrancis442/dev
viraka Jul 5, 2024
08aa66e
Merge pull request #1573 from gtech-mulearn/dev
viraka Jul 5, 2024
160c004
fix(Donation): fix the date and number
alanfrancis442 Jul 6, 2024
d6a456d
chore(Donation): removed unwanted words
alanfrancis442 Jul 6, 2024
5207c47
Merge branch 'gtech-mulearn:dev' into dev
alanfrancis442 Jul 10, 2024
a54ccd8
feat (dashboard):added create certificate feature
karivarkey Jul 11, 2024
e235fa2
Merge pull request #1586 from alanfrancis442/dev
viraka Jul 13, 2024
27f8ea6
Merge pull request #1590 from gtech-mulearn/dev
viraka Jul 13, 2024
e544497
Merge pull request #1589 from karivarkey/dev
viraka Jul 13, 2024
cff314c
Merge pull request #1591 from gtech-mulearn/dev
viraka Jul 21, 2024
a33f649
fix(TaskApis) : Task edit issue fix
aswanthabam Aug 5, 2024
dffa6c0
feat(OpenGrad): added OpenGrad tab in the dashboard
GeorgeET15 Aug 7, 2024
ca56547
Merge pull request #1613 from GeorgeET15/dev
viraka Aug 11, 2024
deb9430
Merge pull request #1610 from aswanthabam/dev
viraka Aug 12, 2024
0ffb7e5
Merge pull request #1614 from gtech-mulearn/dev
viraka Aug 12, 2024
ebcbb35
Merge branch 'production' into dev-server
viraka Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
345 changes: 329 additions & 16 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
"axios": "^1.3.4",
"file-saver": "^2.0.5",
"formik": "^2.2.9",
"framer-motion": "^10.15.0",
"framer-motion": "^10.18.0",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"lottie-react": "^2.4.0",
"moment": "^2.29.4",
"razorpay": "^2.9.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-fast-marquee": "^1.6.4",
"react-google-charts": "^4.0.0",
"react-helmet": "^6.1.0",
"react-hot-toast": "^2.4.1",
"react-icons": "^4.10.1",
"react-icons": "^4.12.0",
"react-qr-code": "^2.0.11",
"react-router-dom": "^6.9.0",
"react-select": "^5.7.7",
Expand Down
13 changes: 13 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -241,6 +242,10 @@ const ConnectedDevices = lazy(
);
const Wadhwani = lazy(() => import("./modules/Dashboard/modules/Wadhwani"));

const Trivial = lazy(
() => import("./modules/Public/TrivialIdeas/modules/trivial")
);

function App() {
const AuthChecker = SecureAuthRoutes();
const router = createBrowserRouter([
Expand Down Expand Up @@ -277,6 +282,10 @@ function App() {
path: "donation/refund",
element: <Refund />
},
{
path: "trivial-ideas",
element: <Trivial />
},
{
path: "/",
element: <AuthRoutes />,
Expand Down Expand Up @@ -319,6 +328,10 @@ function App() {
path: "wadhwani",
element: <Wadhwani />
},
{
path: "opengrad",
element: <OpenGrad />
},
{
path: "refer",
element: <Refer />
Expand Down
Binary file added src/assets/µLearn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions src/modules/Dashboard/layouts/DashboardRootLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { fetchLocalStorage } from "@/MuLearnServices/common_functions";
const DashboardRootLayout = (props: { component?: any }) => {
const [connected, setConnected] = useState(false);

const Management: ManagementTypes[] = Object.values(managementTypes).slice(2);
const Management: ManagementTypes[] =
Object.values(managementTypes).slice(2);
useEffect(() => {
const userInfo = fetchLocalStorage<UserInfo>("userInfo");
if (userInfo) {
Expand Down Expand Up @@ -64,6 +65,12 @@ const DashboardRootLayout = (props: { component?: any }) => {
hasView: true,
icon: <i className="fi fi-sr-building"></i>
},
{
url: "/dashboard/opengrad",
title: "OpenGrad",
hasView: true,
icon: <i className="fi fi-sr-building"></i>
},
{
url: "/dashboard/refer",
title: "Referrals",
Expand Down Expand Up @@ -105,13 +112,13 @@ const DashboardRootLayout = (props: { component?: any }) => {
title: "Manage Organization",
hasView: true,

roles: [roles.ADMIN, roles.FELLOW, roles.ASSOCIATE],
roles: [roles.ADMIN, roles.FELLOW],
children: [
{
url: "/dashboard/affiliation",
title: "Affiliation",
hasView: true,
roles: [roles.ADMIN, roles.FELLOW, roles.ASSOCIATE]
roles: [roles.ADMIN, roles.FELLOW]
},
{
url: "/dashboard/organization-transfer",
Expand Down Expand Up @@ -233,7 +240,7 @@ const DashboardRootLayout = (props: { component?: any }) => {
url: "/dashboard/channels",
title: "Channels",
hasView: true,
roles: [roles.ADMIN, roles.FELLOW, roles.ASSOCIATE]
roles: [roles.ADMIN, roles.FELLOW]
},

{
Expand Down
12 changes: 10 additions & 2 deletions src/modules/Dashboard/modules/ManageUsers/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ const UserForm = forwardRef(
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;

setData(prevData => ({ ...prevData, [name]: value }));
if (name === "mobile" && value && !/^\+?\d{0,12}$/.test(value.trim())) {
setErrors(prevErrors => ({
...prevErrors,
mobile: "Invalid format"
}));
} else {
setErrors(prevErrors => ({ ...prevErrors, mobile: undefined }));
setData(prevData => ({ ...prevData, [name]: value.trim() || " " }));
}
};

const handleYearChange = (e: React.ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -373,7 +381,7 @@ const UserForm = forwardRef(
</div>
<div className={styles.inputContainer}>
<input
type="text"
type="tel"
name="mobile"
placeholder="Mobile"
value={data.mobile}
Expand Down
116 changes: 116 additions & 0 deletions src/modules/Dashboard/modules/OpenGrad/index.module.css
Original file line number Diff line number Diff line change
@@ -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;
}
139 changes: 139 additions & 0 deletions src/modules/Dashboard/modules/OpenGrad/index.tsx
Original file line number Diff line number Diff line change
@@ -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<CourseCardProps> = ({
title,
// desc,
// duration,
url,
imageUrl,
lessons
}) => {
return (
<div className={styles.containercard}>
<img
src={imageUrl}
alt={title}
className={styles.courseImage}
/>
<div className={styles.details}>
<p className={styles.title}>{title}</p>
{/* <p className={styles.desc}>{desc}</p>
<p className={styles.duration}>{duration}hrs</p> */}
<p className={styles.lessons}>{lessons}</p>
</div>
<button
onClick={() => handleCourseSelection(url)}
className={styles.cta}
>
Checkout Course
</button>
</div>
);
};
if (isLoading) {
return <MuLoader />;
}
return (
<div className={styles.wrapper}>
<h1>OpenGrad Courses</h1>
<div className={styles.second_view_container}>
<div className={styles.second_view}>
<div className={styles.courses_container}>
<div className={styles.course}>
{hardcodedCourses.map(course => (
<CourseCard
key={course.courseId}
title={course.courseName}
// desc={course.description}
// duration={course.CourseDuration}
url={course.url}
imageUrl={course.imageUrl}
lessons={course.lessons}
/>
))}
</div>
</div>
</div>
</div>
</div>
);
};

export default OpenGrad;
Loading
Loading