feat: added link to teacher profile page

This commit is contained in:
Sergey Yarkov 2022-03-01 22:30:00 +03:00
parent be418a18aa
commit a773884b8a
2 changed files with 5 additions and 4 deletions

View File

@ -16,6 +16,7 @@ import {
Tag, Tag,
Stack, Stack,
ImageProps, ImageProps,
Link,
LinkBox, LinkBox,
LinkOverlay, LinkOverlay,
LinkBoxProps, LinkBoxProps,
@ -41,7 +42,6 @@ import { useState } from 'react';
import { useColorModeValue } from '@chakra-ui/react'; import { useColorModeValue } from '@chakra-ui/react';
import { useRootStore } from '@educt/hooks/useRootStore'; import { useRootStore } from '@educt/hooks/useRootStore';
import { CourseServiceInstance } from '@educt/services'; import { CourseServiceInstance } from '@educt/services';
import { EditButton } from '@educt/components/Buttons';
export const CourseHeader: React.FC<FlexProps> = props => ( export const CourseHeader: React.FC<FlexProps> = props => (
<Flex justifyContent='space-between' flexDir={{ base: 'column', xl: 'row' }} {...props}> <Flex justifyContent='space-between' flexDir={{ base: 'column', xl: 'row' }} {...props}>
@ -63,10 +63,10 @@ export const CourseHeading: React.FC<ICourseHeadingProps> = props => {
{title} {title}
</Heading> </Heading>
<Flex mt='3' alignItems={'center'}> <Flex mt='3' alignItems={'center'}>
<Text fontSize='sm'> <Link as={ReactRouterLink} to={`/user/${teacher.id}`} fontSize='sm' textDecor={'underline'}>
{teacher.fullname} {teacher.fullname}
&nbsp;&bull;&nbsp; </Link>
</Text> &nbsp;&bull;&nbsp;
<Tag size='sm' variant='solid' bg={category.color?.hex}> <Tag size='sm' variant='solid' bg={category.color?.hex}>
{category.title} {category.title}
</Tag> </Tag>

View File

@ -125,6 +125,7 @@ export const routes: IRouteOption[] = [
title: 'Users management', title: 'Users management',
component: UsersPage, component: UsersPage,
isPrivate: true, isPrivate: true,
exact: true,
roles: [UserRoleEnum.ADMIN, UserRoleEnum.TEACHER], roles: [UserRoleEnum.ADMIN, UserRoleEnum.TEACHER],
}, },
{ {