no attendance link if no nav element

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-11-06 12:59:24 +03:00
parent e56f0e4e5d
commit 22a9199d9d

View File

@ -57,21 +57,27 @@ export const CourseCard = ({ course }: { course: Course }) => {
<CourseDetails populatedCourse={populatedCourse.data} />
)}
<Tooltip label="На страницу с лекциями" fontSize="12px" top="16px">
<Button
leftIcon={<LinkIcon />}
as={ConnectedLink}
variant="outline"
colorScheme="blue"
to={generatePath(
`${getNavigationsValue('journal.main')}${getNavigationsValue('link.journal.attendance')}`,
{ courseId: course.id },
)}
{getNavigationsValue('link.journal.attendance') && (
<Tooltip
label="На страницу с лекциями"
fontSize="12px"
top="16px"
>
<Box mt={3}></Box>
Посещаемость
</Button>
</Tooltip>
<Button
leftIcon={<LinkIcon />}
as={ConnectedLink}
variant="outline"
colorScheme="blue"
to={generatePath(
`${getNavigationsValue('journal.main')}${getNavigationsValue('link.journal.attendance')}`,
{ courseId: course.id },
)}
>
<Box mt={3}></Box>
Посещаемость
</Button>
</Tooltip>
)}
</Stack>
</CardBody>
)}