Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dudchakk committed Dec 4, 2024
1 parent 0c7ac37 commit 1b90e71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
15 changes: 13 additions & 2 deletions src/components/comment/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,22 @@ interface CommentProps {
}

const Comment: FC<CommentProps> = ({ review }) => {
const { comment, author, rating, createdAt, offer, proficiencyLevel, targetUserRole } = review
const {
comment,
author,
rating,
createdAt,
offer,
proficiencyLevel,
targetUserRole
} = review
const { firstName, lastName, photo, _id } = author
const { category, subject } = offer

const authorRole = targetUserRole === UserRoleEnum.Tutor ? UserRoleEnum.Student : UserRoleEnum.Tutor
const authorRole =
targetUserRole === UserRoleEnum.Tutor
? UserRoleEnum.Student
: UserRoleEnum.Tutor

const coopDetails = `${category.name} - ${subject.name} - ${proficiencyLevel}`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ import Loader from '~/components/loader/Loader'
import { RatingType, SortByEnum, UserRoleEnum, ReviewsResponse } from '~/types'
import { styles } from '~/containers/user-profile/comments-with-rating-block/CommentsWithRatingBlock.styles'

import {
responseMock,
loadingMock,
responseMockStudents,
MockReview
} from '~/containers/user-profile/comments-with-rating-block/CommentsWithRatingBlock.constants'
import { ReviewService } from '~/services/review-service'
import { useAppSelector } from '~/hooks/use-redux'
import useAxios from '~/hooks/use-axios'
Expand Down Expand Up @@ -61,11 +55,6 @@ const CommentsWithRatingBlock = ({
? 'userProfilePage.reviews.titleTutor'
: 'userProfilePage.reviews.titleStudent'

// const items: MockReview[] =
// userRole === UserRoleEnum.Tutor
// ? [...responseMock.items]
// : [...responseMockStudents.items]

const sortItems = Object.values(SortByEnum)
const sortMenuItems = sortItems.map((el) => (
<MenuItem key={el} value={el}>
Expand Down Expand Up @@ -115,7 +104,7 @@ const CommentsWithRatingBlock = ({
return (
<Box sx={styles.root}>
<Typography sx={styles.title}>{t(titleKey)}</Typography>
{loadingMock && !response.count ? (
{loading && !response.count ? (
<Loader data-testid='loader' />
) : (
<>
Expand Down

0 comments on commit 1b90e71

Please sign in to comment.