This commit is contained in:
Evdokia
2025-04-30 14:11:50 +03:00
parent 7f2ae842d2
commit fbff8f9c9c
18 changed files with 447 additions and 341 deletions

View File

@@ -1,48 +1,47 @@
.reviews-section {
max-width: 800px;
margin: 40px auto;
padding: 0 20px;
}
.reviews-section h2 {
text-align: center;
margin-bottom: 32px;
font-size: 26px;
}
.reviews-list {
display: flex;
flex-direction: column;
gap: 24px;
}
.review-card {
border: 1px solid #eee;
border-radius: 10px;
background: #fafbfc;
padding: 20px 24px;
box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.review-text {
font-size: 16px;
margin-bottom: 12px;
color: #222;
}
.review-meta {
display: flex;
align-items: center;
gap: 16px;
}
.review-author {
font-weight: bold;
color: #6C63FF;
}
.star-rating {
color: #FFD700;
font-size: 18px;
}
max-width: 800px;
margin: 40px auto;
padding: 0 20px;
}
.reviews-section h2 {
text-align: center;
margin-bottom: 32px;
font-size: 26px;
}
.reviews-list {
display: flex;
flex-direction: column;
gap: 24px;
}
.review-card {
border: 1px solid #eee;
border-radius: 10px;
background: #fafbfc;
padding: 20px 24px;
box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.review-text {
font-size: 16px;
margin-bottom: 12px;
color: #222;
}
.review-info {
display: flex;
align-items: center;
gap: 16px;
}
.review-author {
font-weight: bold;
color: #6C63FF;
}
.star-rating {
color: #FFD700;
font-size: 18px;
}

View File

@@ -1,6 +1,7 @@
import React from 'react';
import './Reviews.css';
// Массив с отзывами пользователей
const reviews = [
{
id: 1,
@@ -22,6 +23,7 @@ const reviews = [
}
];
// Компонент для отображения звездного рейтинга
function StarRating({ rating }) {
return (
<span className="star-rating">
@@ -31,17 +33,20 @@ function StarRating({ rating }) {
);
}
// Основной компонент отзывов
function Reviews() {
return (
<section className="reviews-section">
<h2>Отзывы пользователей</h2>
<div className="reviews-list">
<h2>Отзывы пользователей</h2>
<div className="reviews-list">{/* Перебираем массив отзывов */}
{reviews.map(review => (
// Карточка отзыва с уникальным ключом
<div key={review.id} className="review-card">
<p className="review-text">"{review.text}"</p>
<div className="review-meta">
<span className="review-author">{review.author}</span>
<StarRating rating={review.rating} />
<p className="review-text">"{review.text}"</p>
<div className="review-info">
<span className="review-author">{review.author}</span>
<StarRating rating={review.rating} />
</div>
</div>
))}
@@ -50,4 +55,5 @@ function Reviews() {
);
}
export default Reviews;