feat: add public employee profile view and implement ratings review page components
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
margin: 0 10px 5px;
|
||||
}
|
||||
|
||||
.titleRow {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.header h2 {
|
||||
margin: 0;
|
||||
padding-bottom: 10px;
|
||||
@@ -17,6 +24,19 @@
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.viewMore {
|
||||
flex: 0 0 auto;
|
||||
margin-top: 4px;
|
||||
color: var(--wine-red);
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.viewMore:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.header p {
|
||||
max-width: 620px;
|
||||
margin: 0 0 10px;
|
||||
@@ -109,6 +129,10 @@
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.titleRow {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.reviewCard {
|
||||
flex-basis: calc(100vw - 40px);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useEffect, useRef, useState, type PointerEvent, type ReactElement } from "react";
|
||||
import classNames from "classnames";
|
||||
import Link from "next/link";
|
||||
import Avatar from "@components/Avatar/Avatar";
|
||||
import { RatingTargetReviewItem, RatingTargetType } from "@core/Models/Ratings.model";
|
||||
import { ratingTargetReviews } from "@services/Ratings.Service";
|
||||
@@ -58,9 +59,9 @@ export default function ReviewsCarousel({
|
||||
let active = true;
|
||||
|
||||
ratingTargetReviews({ targetType, targetId, limit })
|
||||
.then((targetReviews) => {
|
||||
.then((targetReviewsResult) => {
|
||||
if (active) {
|
||||
setReviews(sortReviewsByScore(targetReviews.filter((review) => review.comment.trim().length > 0)));
|
||||
setReviews(sortReviewsByScore(targetReviewsResult.reviews.filter((review) => review.comment.trim().length > 0)));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -99,7 +100,12 @@ export default function ReviewsCarousel({
|
||||
return (
|
||||
<section className={classNames(style.reviewsCarousel, className)} aria-label="Opiniones">
|
||||
<div className={style.header}>
|
||||
<h2>{title}</h2>
|
||||
<div className={style.titleRow}>
|
||||
<h2>{title}</h2>
|
||||
<Link className={style.viewMore} href={`/landing/reviews?targetType=${targetType}&targetId=${targetId}`}>
|
||||
Ver más
|
||||
</Link>
|
||||
</div>
|
||||
{subtitle && <p>{subtitle}</p>}
|
||||
</div>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user