diff --git a/frontend/src/components/blog/SearchIcon.astro b/frontend/src/components/blog/SearchIcon.astro
deleted file mode 100644
index bbd7de6..0000000
--- a/frontend/src/components/blog/SearchIcon.astro
+++ /dev/null
@@ -1,55 +0,0 @@
----
-// Компонент иконки поиска (лупа)
----
-
-
-
-
-
-
diff --git a/frontend/src/components/reviews/ReviewCard.astro b/frontend/src/components/reviews/ReviewCard.astro
index f111de6..ec8d6aa 100644
--- a/frontend/src/components/reviews/ReviewCard.astro
+++ b/frontend/src/components/reviews/ReviewCard.astro
@@ -72,41 +72,28 @@ const formatDate = (dateStr: string) => {
-
Полезен ли этот отзыв?
-
-
-
-
- {votesCount}
-
-
+
+
@@ -211,70 +198,43 @@ const formatDate = (dateStr: string) => {
.voting-section {
margin-top: auto;
- padding-top: 1.5rem;
+ padding-top: 1.25rem;
border-top: 1px solid #e2e8f0;
display: flex;
- flex-direction: column;
- gap: 0.75rem;
- }
-
- .voting-question {
- color: #475569;
- font-size: 0.875rem;
- font-weight: 600;
- margin: 0;
- }
-
- .voting-auth-note {
- color: #dc2626 !important;
- font-size: 0.7rem !important;
- font-style: italic;
- margin: 0;
- }
-
- .voting-buttons {
- display: flex;
- gap: 0.75rem;
- align-items: center;
+ gap: 1rem;
+ justify-content: center;
}
.vote-btn {
display: inline-flex;
align-items: center;
- gap: 0.375rem;
- padding: 0.5rem 0.875rem;
- border: 2px solid #e2e8f0;
+ gap: 0.5rem;
+ padding: 0.625rem 1rem;
+ border: 1px solid #e2e8f0;
border-radius: 0.5rem;
background: #ffffff;
cursor: pointer;
transition: all 0.2s ease;
font-size: 0.875rem;
- font-weight: 600;
+ font-weight: 500;
color: #64748b;
}
.vote-btn svg {
- width: 1.25rem;
- height: 1.25rem;
+ width: 1.125rem;
+ height: 1.125rem;
}
- .reaction-icon {
- width: 1.25rem;
- height: 1.25rem;
+ .vote-btn:hover {
+ border-color: #1e3050;
+ color: #1e3050;
+ background: #f8fafc;
}
- .vote-btn-up:hover,
- .vote-btn-up.active {
- border-color: #22c55e;
- color: #22c55e;
- background: rgba(34, 197, 94, 0.1);
- }
-
- .vote-btn-down:hover,
- .vote-btn-down.active {
- border-color: #ef4444;
- color: #ef4444;
- background: rgba(239, 68, 68, 0.1);
+ .vote-btn.active {
+ background: #1e3050;
+ border-color: #1e3050;
+ color: #ffffff;
}
.vote-btn:disabled {
@@ -302,27 +262,6 @@ const formatDate = (dateStr: string) => {
}
}
- .voting-stars {
- display: flex;
- align-items: center;
- }
-
- .voting-stats {
- display: flex;
- align-items: center;
- gap: 1rem;
- margin-top: 0.5rem;
- }
-
- .votes-count {
- display: inline-flex;
- align-items: center;
- gap: 0.375rem;
- color: #64748b;
- font-size: 0.875rem;
- font-weight: 500;
- }
-
.icon {
width: 1.125rem;
height: 1.125rem;
@@ -492,13 +431,12 @@ const formatDate = (dateStr: string) => {
return;
}
- const data = await response.json();
- buttons.forEach(b => b.classList.remove('active'));
- btn.classList.add('active');
-
- const votesNumber = section.querySelector('.votes-number');
- if (votesNumber && typeof data.likes === 'number') {
- votesNumber.textContent = data.likes.toString();
+ const resData = await response.json();
+ const btnCountEl = btn.querySelector('.votes-number');
+ if (btnCountEl) {
+ const isLike = voteType === 'likes';
+ const newCount = isLike ? (resData.likes || 0) : (resData.dislikes || 0);
+ btnCountEl.textContent = String(newCount);
}
} catch (err) {
console.error('[ReviewCard] Vote failed:', err);
@@ -541,17 +479,21 @@ const formatDate = (dateStr: string) => {
return;
}
- if (!response.ok) {
+if (!response.ok) {
+ const errorText = await response.text();
+ console.error('[Vote JS] Error:', errorText);
return;
}
- const data = await response.json();
- buttons.forEach(b => b.classList.remove('active'));
- btn.classList.add('active');
-
- const votesNumber = section.querySelector('.votes-number');
- if (votesNumber && typeof data.likes === 'number') {
- votesNumber.textContent = data.likes.toString();
+ const resData = await response.json();
+ console.log('[Vote JS] Response:', resData);
+
+ const btnCountEl = btn.querySelector('.votes-number');
+ if (btnCountEl) {
+ const isLike = voteType === 'likes';
+ const newCount = isLike ? (resData.likes || 0) : (resData.dislikes || 0);
+ btnCountEl.textContent = String(newCount);
+ console.log('[Vote JS] Set count to:', newCount);
}
} catch (err) {
console.error('[ReviewCard] Vote failed:', err);
diff --git a/frontend/src/components/reviews/ReviewForm.tsx b/frontend/src/components/reviews/ReviewForm.tsx
index 6594e28..6feb59f 100644
--- a/frontend/src/components/reviews/ReviewForm.tsx
+++ b/frontend/src/components/reviews/ReviewForm.tsx
@@ -16,12 +16,6 @@ interface ReviewFormProps {
};
}
-const EMOJIS = [
- "👍", "👎", "❤️", "😊", "😂", "🎉", "🔥", "👏",
- "😢", "😮", "😡", "🙏", "⭐", "💯", "❤️🔥", "🤔",
- "👀", "💪", "🚀", "✨"
-];
-
const DANGEROUS_PATTERNS = [
/