Skip to content

Commit

Permalink
course card disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemek committed May 6, 2024
1 parent f163cb5 commit 202d6ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "httsp://wellms.io"
},
"dependencies": {
"@escolalms/components": "^0.0.140",
"@escolalms/components": "^0.0.141",
"@escolalms/h5p-react": "^0.2.19",
"@escolalms/sdk": "0.5.34",
"@escolalms/ts-models": "^0.0.35",
Expand Down
6 changes: 6 additions & 0 deletions src/components/Courses/CoursesUserSlider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ResponsiveImage } from "@escolalms/components/lib/components/organisms/
import CourseImgPlaceholder from "@/components/Courses/CourseImgPlaceholder";
import { NewCourseCard } from "@escolalms/components/lib/index";
import CategoriesBreadCrumbs from "@/components/Categories/CategoriesBreadCrumbs";
import { isPast } from "date-fns/esm";

const Wrapper = styled.div`
position: relative;
Expand Down Expand Up @@ -56,6 +57,11 @@ const CoursesUserSlider: React.FC<Props> = ({
<NewCourseCard
mobile={isMobile}
id={item.id}
disabled={
// @ts-ignore
item?.courseData?.end_date && // @ts-ignore
isPast(new Date(item?.courseData?.end_date))
}
image={
<Link to={`/courses/${item.id}`}>
{item.image_path ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CourseCardWrapper from "@/components/Courses/CourseCardWrapper";
import CategoriesBreadCrumbs from "@/components/Categories/CategoriesBreadCrumbs";
import { CourseCardActions } from "../../CourseCardActions";
import { NewCourseCard } from "@escolalms/components/lib/index";
import { isPast } from "date-fns/esm";

type Props = {
course: API.Course & {
Expand All @@ -25,6 +26,11 @@ const CourseCardItem: React.FC<Props> = ({ course }) => {
<NewCourseCard
mobile={isMobile}
id={course.id}
disabled={
// @ts-ignore
course?.courseData?.end_date && // @ts-ignore
isPast(new Date(course?.courseData?.end_date))
}
image={
<Link to={`/course/${course.id}`}>
{course.image_path ? (
Expand Down

0 comments on commit 202d6ec

Please sign in to comment.