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

feat: courses | bug fixes #588

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/Courses/Courses.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import FreeCourse from "./LearningPath/FreeCourse";
// import FreeCourse from "./LearningPath/FreeCourse";
import NewCourses from "./NewCourses/NewCourses";
import { CoursesContainer } from "./CoursesElements";
import { Wrapper } from "../Dashboard/Profile/ProfileElements";
Expand Down
108 changes: 68 additions & 40 deletions src/components/Courses/NewCourses/Course.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import CoursesData from "./CoursesData";
import React from "react";
import {
Button,
// Card,
Button, // Card,
// CardBody,
// CardFooter,
// ChannelImg,
Expand All @@ -17,21 +16,15 @@ import {
import {
// BackArrow,
Checkbox,
CheckboxContainer,
// Content,
ContentHeading,
// ContentList,
CheckboxContainer, // Content,
ContentHeading, // ContentList,
// ContentNavigation,
Days,
// ForwardArrow,
Days, // ForwardArrow,
// LearningPathContainer,
// LearningPathWrapper,
LeftContainer,
// NavigationButtonSection,
RightContainer,
// SectionHeading,
TopicBox,
// VLine,
// LeftContainer, // NavigationButtonSection,
RightContainer, // SectionHeading,
TopicBox, // VLine,
Weeks,
} from "../LearningPath/LearningPathElements";
import { Wrapper } from "../../Dashboard/Profile/ProfileElements";
Expand Down Expand Up @@ -63,36 +56,71 @@ const Course = () => {
const course = Object.values(CoursesData)?.find(
(course) => `${encodeURL(course?.courseName)}`.toLowerCase() === title.toLowerCase(),
);

return (
<Wrapper>
<div>
<Button href="/Courses">Go Back</Button>
{course.sections.map((section, index) => (
<LeftContainer key={index}>
<Weeks key={index}>
<h3>{section.sectionName}</h3>
</Weeks>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "flex-start",
width: "100%",
height: "100%",
padding: "20px",
gap: "20px",
}}
>
<div
style={{
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
width: "400px",
height: "100%",
// padding: "20px",
gap: "20px",
}}
>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
width: "100%",
height: "100%",
// padding: "20px 0",
}}
>
<Button to="/Courses">Go Back</Button>
</div>

{course.sections.map((section, index) => (
<div key={index}>
<Weeks key={index}>
<h3>{section.sectionName}</h3>
</Weeks>

<Days key={index}>
<ul>
{section.videos.map((video, videoIndex) => (
<>
<TopicBox onClick={() => changeImgSrc(video.imageUrl)} key={index}>
<ContentHeading>{video.title}</ContentHeading>
<CheckboxContainer>
<Checkbox type="checkbox" />
</CheckboxContainer>
</TopicBox>
</>
))}
</ul>
</Days>
</LeftContainer>
))}
<Days key={index}>
<ul>
{section.videos.map((video, videoIndex) => (
<>
<TopicBox onClick={() => changeImgSrc(video.imageUrl)} key={index}>
<ContentHeading>{video.title}</ContentHeading>
<CheckboxContainer>
<Checkbox type="checkbox" />
</CheckboxContainer>
</TopicBox>
</>
))}
</ul>
</Days>
</div>
))}
</div>
<RightContainer>
<img src="" id="image" alt={""} />
</RightContainer>
</div>
<RightContainer>
<img src="" id="image" />
</RightContainer>
</Wrapper>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Courses/NewCourses/NewCourses.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import CoursesData from "./CoursesData";
import React, { useState } from "react";
import {
Cards,
Card,
CardBody,
// CardFooter,
Expand Down Expand Up @@ -36,6 +35,7 @@ import {
// } from "../LearningPath/LearningPathElements";
import { RouterLink } from "../../Tools/ToolsElements";
import { encodeURL } from "../../Blogs/util";
import { Cards } from "../../Forum/ForumPosts/ForumPostsElements";
// import { Cards } from "../../Forum/ForumPosts/ForumPostsElements";

const NewCourses = () => {
Expand Down
18 changes: 18 additions & 0 deletions src/components/Learn/Courses/VideoCard/VideoCardElements.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled from "styled-components";
import { Link as RouterLink } from "react-router-dom";

export const Link = styled.a`
text-decoration: none;
Expand Down Expand Up @@ -128,3 +129,20 @@ export const ChannelImg = styled.img`
export const UserInfo = styled.div`
color: #666;
`;

export const Button = styled(RouterLink)`
background: #1a1c1d;
color: #fff;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
font-size: 0.75rem;
font-weight: 500;
text-transform: uppercase;
transition: 0.3s;
border: 1px solid #1a1c1d;
&:hover {
background: #fff;
color: #1a1c1d;
border: 1px solid #fff;
}
`;