diff --git a/src/components/Courses/CourseCardUpcoming.tsx b/src/components/Courses/CourseCardUpcoming.tsx index 7b5258b..9f9963f 100644 --- a/src/components/Courses/CourseCardUpcoming.tsx +++ b/src/components/Courses/CourseCardUpcoming.tsx @@ -17,8 +17,9 @@ const CourseCardUpcoming: React.FC = ({ course }) => { return (
-
- {t('upcomingCourse.courseComingSoon')} +
+
{t('upcomingCourse.courseComingSoon')}
+
{course.publish_date}
{title}
diff --git a/src/components/LecturesList/index.tsx b/src/components/LecturesList/index.tsx index 6828d97..76ce0db 100644 --- a/src/components/LecturesList/index.tsx +++ b/src/components/LecturesList/index.tsx @@ -19,6 +19,7 @@ import { } from './styles' import { ALLOWED_LECTURES_WHEN_NOT_LOGGED_IN } from '../../common/constants' import { Lecture } from '../../types/api.types' +import Badge from '../General/Badge' const StyledButton = styled.button<{ isRtl: boolean }>` background: none; @@ -61,7 +62,9 @@ const LectureList: React.FC = ({ return } const canWatch = (index: number) => - isLoggedIn || (!isLoggedIn && index < ALLOWED_LECTURES_WHEN_NOT_LOGGED_IN) + isLoggedIn || + (!isLoggedIn && index < ALLOWED_LECTURES_WHEN_NOT_LOGGED_IN) || + !sortedLectures[index].upcoming return ( <> @@ -87,12 +90,22 @@ const LectureList: React.FC = ({ -

- {lecture.title} -

- - {formatDuration(lecture.duration)} - +
+
+

+ {lecture.title} +

+ + {formatDuration(lecture.duration)} + +
+ {lecture.upcoming && ( +
+ + +
+ )} +
{lectureIcon(index)}
diff --git a/src/components/LecturesList/styles.tsx b/src/components/LecturesList/styles.tsx index 30365d2..b04c61b 100644 --- a/src/components/LecturesList/styles.tsx +++ b/src/components/LecturesList/styles.tsx @@ -38,7 +38,7 @@ export const StyledCount = styled.div` ` export const StyledListBody = styled.div` position: relative; - padding: 16px 130px 16px 105px; + padding: 16px 16px 16px 105px; :hover { background-color: #fff; } diff --git a/src/pages/courses.tsx b/src/pages/courses.tsx index aed7b18..785405e 100644 --- a/src/pages/courses.tsx +++ b/src/pages/courses.tsx @@ -46,6 +46,7 @@ export const pageQuery = graphql` slug level status + publish_date tags { tagName } diff --git a/src/templates/LectureView/index.tsx b/src/templates/LectureView/index.tsx index 9d7d6f0..f1a12eb 100644 --- a/src/templates/LectureView/index.tsx +++ b/src/templates/LectureView/index.tsx @@ -228,6 +228,8 @@ export const pageQuery = graphql` duration url created_at + upcoming + publish_date } resources { type diff --git a/src/types/api.types.ts b/src/types/api.types.ts index c4bca47..da5af27 100644 --- a/src/types/api.types.ts +++ b/src/types/api.types.ts @@ -124,6 +124,8 @@ export type Lecture = { position: number slug: string created_at: string + upcoming: boolean | null + publish_date: string } export type Course = { @@ -142,4 +144,5 @@ export type Course = { resources: Resource[] price: number thumbnail: string | null + publish_date: string }