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..ace6bcc56 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,24 @@ { "title": "Tell your opinion about our websites", - "input-placeholder": "Please write here", + "success-title": "Thank you for your feedback!", + "input-placeholder": "(Optional)", + "input-placeholder-1": "What bothered you the most?", + "input-placeholder-2": "What fell short of your expectations?", + "input-placeholder-3": "What could be improved?", + "input-placeholder-4": "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-gameform": "Game form" + "href-to-webform": "Web form", + "href-to-gameform": "Game form", + "rating-label-1": "Bad", + "rating-label-2": "Meh..", + "rating-label-3": "OK", + "rating-label-4": "Good", + "rating-label-5": "Great" } 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..7ea297004 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,24 @@ { "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", + "rating-label-1": "Huono", + "rating-label-2": "Meh..", + "rating-label-3": "Ihan ok", + "rating-label-4": "Hyvä", + "rating-label-5": "Loistava" } 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 && } +