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

displayed a message when no watched content #1727

Closed
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
23 changes: 15 additions & 8 deletions src/components/FolderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,33 @@ export const FolderView = ({
}) => {
const router = useRouter();


if (!courseContent?.length) {
return (
<div className="mt-64 flex">
<div className="m-auto">No content here yet!</div>
</div>
);
}
let updatedRoute = `/courses/${courseId}`;
for (let i = 0; i < rest.length; i++) {
updatedRoute += `/${rest[i]}`;
}
// why? because we have to reset the segments or they will be visible always after a video

const currentfilter = useRecoilValue(selectFilter);

const filteredCourseContent = getFilteredContent(
courseContent,
currentfilter,
);

if (!filteredCourseContent?.length) {
return (
<div className="mt-60 flex">
<div className="m-auto text-gray-500 text-xl">
No {currentfilter} content found in this section.
</div>
</div>
);
}
let updatedRoute = `/courses/${courseId}`;
for (let i = 0; i < rest.length; i++) {
updatedRoute += `/${rest[i]}`;
}
// why? because we have to reset the segments or they will be visible always after a video
return (
<div>
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
Expand Down