From 241a5bbaa09345a08df4d68b7f17adc0847c6358 Mon Sep 17 00:00:00 2001 From: Teemu Kalmari <95919515+temez26@users.noreply.github.com> Date: Wed, 15 Apr 2026 16:29:04 +0300 Subject: [PATCH 1/6] enhancement: updated the emojis to be interactive with speechbubbles and related rating placeholders, updated i18n jsons related to feedbackcard, added text areafield to the customform for more customasiable inputform. Almost ready just needs some fine tuning and confirmation what the english text needs to be. --- .../shared/i18n/locales/en/feedbackCard.json | 11 ++- .../shared/i18n/locales/fi/feedbackCard.json | 15 +++- .../shared/i18n/locales/ru/feedbackCard.json | 13 ++- .../shared/ui/CustomForm/ui/CustomForm.tsx | 42 ++++++++++ .../src/shared/ui/v2/Feedback/index.ts | 1 + .../ui/FeedbackCard/FeedbackCard.module.scss | 80 ++++++++++--------- .../Feedback/ui/FeedbackCard/FeedbackCard.tsx | 34 +++++++- .../FeedbackCardSuccess.module.scss | 60 ++++++++++++++ .../FeedbackCardSuccess.tsx | 59 ++++++++++++++ .../FeedbackEmoji/FeedbackEmoji.module.scss | 51 +++++++++++- .../ui/FeedbackEmoji/FeedbackEmoji.tsx | 52 ++++++++---- 11 files changed, 352 insertions(+), 66 deletions(-) create mode 100644 frontend-next-migration/src/shared/ui/v2/Feedback/ui/FeedbackCardSuccess/FeedbackCardSuccess.module.scss create mode 100644 frontend-next-migration/src/shared/ui/v2/Feedback/ui/FeedbackCardSuccess/FeedbackCardSuccess.tsx diff --git a/frontend-next-migration/src/shared/i18n/locales/en/feedbackCard.json b/frontend-next-migration/src/shared/i18n/locales/en/feedbackCard.json index 7739d83ed..5f33bbeb2 100644 --- a/frontend-next-migration/src/shared/i18n/locales/en/feedbackCard.json +++ b/frontend-next-migration/src/shared/i18n/locales/en/feedbackCard.json @@ -1,10 +1,19 @@ { "title": "Tell your opinion about our websites", + "success-title": "Thank you for your feedback!", "input-placeholder": "Please write here", + "input-placeholder-1": "What bothered you the most?", + "input-placeholder-2": "What fell short of your expectations?", + "input-placeholder-3": "What was good and what could be improved?", + "input-placeholder-4": "Great to hear! Any suggestions for improvement?", + "input-placeholder-5": "Wonderful! What did you like the most?", "send": "Send", + "loading": "Sending...", "href-to-fullform": "Go to the full form ->", "error": "Select emote and then write feedback", + "error-submit-failed": "Submission failed. Please try again.", + "feedback-text": "Give specific feedback", "success": "Thank you very much! We appreciate your feedback.", - "href-to-webform": "Website form", + "href-to-webform": "Web form", "href-to-gameform": "Game form" } diff --git a/frontend-next-migration/src/shared/i18n/locales/fi/feedbackCard.json b/frontend-next-migration/src/shared/i18n/locales/fi/feedbackCard.json index 831b82528..a862afaf9 100644 --- a/frontend-next-migration/src/shared/i18n/locales/fi/feedbackCard.json +++ b/frontend-next-migration/src/shared/i18n/locales/fi/feedbackCard.json @@ -1,10 +1,19 @@ { "title": "Kerro mielipiteesi verkkosivuistamme", - "input-placeholder": "Kirjoita tähän", + "success-title": "Kiitos palautteestasi!", + "input-placeholder": "(Valinnainen)", + "input-placeholder-1": "Harmi! Mikä mätti eniten?", + "input-placeholder-2": "Voi ei - mikä jäi vajaaksi?", + "input-placeholder-3": "Mikä oli hyvää ja mitä parantaisit?", + "input-placeholder-4": "Kiva kuulla! Parannus ehdotuksia?", + "input-placeholder-5": "Ihanaa! Mikä oli parasta?", "send": "Lähetä", + "loading": "Lähetetään...", "href-to-fullform": "Siirry koko lomakkeeseen ->", "error": "Valitse mieliala ja sitten kirjoita palaute.", + "error-submit-failed": "Lähetys epäonnistui. Yritä uudelleen.", + "feedback-text": "Anna tarkempi palaute", "success": "Kiitos paljon! Arvostamme palautettasi.", - "href-to-webform": "Verkkosivulomake", - "href-to-gameform": "Pelilomake" + "href-to-webform": "Web lomake", + "href-to-gameform": "Peli lomake" } diff --git a/frontend-next-migration/src/shared/i18n/locales/ru/feedbackCard.json b/frontend-next-migration/src/shared/i18n/locales/ru/feedbackCard.json index b7c65af3b..26d43cfba 100644 --- a/frontend-next-migration/src/shared/i18n/locales/ru/feedbackCard.json +++ b/frontend-next-migration/src/shared/i18n/locales/ru/feedbackCard.json @@ -1,10 +1,19 @@ { "title": "Поделитесь своим мнением о нашем сайте", + "success-title": "Спасибо за ваш отзыв!", "input-placeholder": "Напишите сюда", + "input-placeholder-1": "Что вам не понравилось больше всего?", + "input-placeholder-2": "Что не оправдало ваших ожиданий?", + "input-placeholder-3": "Что было хорошо и что можно улучшить?", + "input-placeholder-4": "Приятно слышать! Есть предложения по улучшению?", + "input-placeholder-5": "Замечательно! Что понравилось больше всего?", "send": "Отправить", + "loading": "Отправка...", "href-to-fullform": "Перейти к полной форме ->", "error": "Выберите настроение и затем напишите отзыв.", + "error-submit-failed": "Отправка не удалась. Попробуйте снова.", + "feedback-text": "Оставьте подробный отзыв", "success": "Большое спасибо! Мы ценим ваш отзыв.", - "href-to-webform": "Отзыв о сайте", - "href-to-gameform": "Отзыв о игре" + "href-to-webform": "Форма сайта", + "href-to-gameform": "Форма игры" } diff --git a/frontend-next-migration/src/shared/ui/CustomForm/ui/CustomForm.tsx b/frontend-next-migration/src/shared/ui/CustomForm/ui/CustomForm.tsx index eb552c0ed..70d704159 100644 --- a/frontend-next-migration/src/shared/ui/CustomForm/ui/CustomForm.tsx +++ b/frontend-next-migration/src/shared/ui/CustomForm/ui/CustomForm.tsx @@ -8,6 +8,7 @@ import React, { memo, DetailedHTMLProps, InputHTMLAttributes, + TextareaHTMLAttributes, useState, useEffect, useId, @@ -318,12 +319,52 @@ function MultiSelectionDropdown({ ); } +type TextareaFieldProps = { + label?: string; + error?: any; + className?: string; + textareaProps?: DetailedHTMLProps< + TextareaHTMLAttributes, + HTMLTextAreaElement + >; +}; + +function TextareaField({ label, error, textareaProps, className = '' }: TextareaFieldProps) { + const reactId = useId(); + const slug = slugifyLabel(label); + const normalizedReactId = reactId + .toString() + .toLowerCase() + .replace(/[^a-z0-9]+/g, '-'); + const textareaId = + textareaProps?.id || (slug ? `textarea-${slug}` : `textarea-${normalizedReactId}`); + + return ( +
+ {label && } +