From 1d38c12509ba03a44f7bbacc640ab538406066ad Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 25 Jun 2024 20:36:45 +0300 Subject: [PATCH] connect-page --- public/locales/en/translation.json | 59 ++++++++++------- public/locales/ru/translation.json | 55 +++++++++------- src/components/Views/ConnectView.tsx | 97 ++++++++++++++++++++++++++++ src/routes/connect.tsx | 14 ++++ 4 files changed, 177 insertions(+), 48 deletions(-) create mode 100644 src/components/Views/ConnectView.tsx create mode 100644 src/routes/connect.tsx diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 22eec2e4..489ce382 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -15,8 +15,8 @@ "Add image": "Add image", "Add images": "Add images", "Add intro": "Add intro", - "Add link": "Add link", "add link": "add link", + "Add link": "Add link", "Add rule": "Add rule", "Add signature": "Add signature", "Add subtitle": "Add subtitle", @@ -30,10 +30,11 @@ "All articles": "All articles", "All authors": "All authors", "All posts": "All posts", - "All topics": "All topics", "all topics": "all topics", + "All topics": "All topics", "Almost done! Check your email.": "Almost done! Just checking your email.", "and some more authors": "{restUsersCount, plural, =0 {} one { and one more user} other { and more {restUsersCount} users}}", + "Anything else": "Anything else", "Are you sure you want to delete this comment?": "Are you sure you want to delete this comment?", "Are you sure you want to delete this draft?": "Are you sure you want to delete this draft?", "Are you sure you want to to proceed the action?": "Are you sure you want to to proceed the action?", @@ -42,10 +43,10 @@ "Artist": "Artist", "Artworks": "Artworks", "Audio": "Audio", - "Author": "Author", "author": "author", - "Authors": "Authors", + "Author": "Author", "authors": "authors", + "Authors": "Authors", "Autotypograph": "Autotypograph", "Back": "Back", "Back to editor": "Back to editor", @@ -53,11 +54,11 @@ "back to menu": "back to menu", "Be the first to rate": "Be the first to rate", "Become an author": "Become an author", - "Bold": "Bold", "bold": "bold", + "Bold": "Bold", "Bookmarked": "Saved", - "Bookmarks": "Bookmarks", "bookmarks": "bookmarks", + "Bookmarks": "Bookmarks", "Bullet list": "Bullet list", "By alphabet": "By alphabet", "By authors": "By authors", @@ -74,8 +75,8 @@ "Can make any changes, accept or reject suggestions, and share access with others": "Can make any changes, accept or reject suggestions, and share access with others", "Can offer edits and comments, but cannot edit the post or share access with others": "Can offer edits and comments, but cannot edit the post or share access with others", "Can write and edit text directly, and accept or reject suggestions from others": "Can write and edit text directly, and accept or reject suggestions from others", - "Cancel": "Cancel", "cancel": "cancel", + "Cancel": "Cancel", "Cancel changes": "Cancel changes", "Change password": "Change password", "Characters": "Знаков", @@ -87,8 +88,8 @@ "Co-author": "Co-author", "Collaborate": "Help Edit", "Collaborators": "Collaborators", - "Collections": "Collections", "collections": "collections", + "Collections": "Collections", "Come up with a subtitle for your story": "Come up with a subtitle for your story", "Come up with a title for your story": "Come up with a title for your story", "Coming soon": "Coming soon", @@ -147,8 +148,8 @@ "Dogma": "Dogma", "dogma keywords": "Discours.io, dogma, editorial principles, code of ethics, journalism, community", "Draft successfully deleted": "Draft successfully deleted", - "Drafts": "Drafts", "drafts": "drafts", + "Drafts": "Drafts", "Drag the image to this area": "Drag the image to this area", "Each image must be no larger than 5 MB.": "Each image must be no larger than 5 MB.", "earlier": "earlier", @@ -158,8 +159,8 @@ "Editor": "Editor", "Email": "Mail", "email not confirmed": "email not confirmed", - "Enter": "Enter", "enter": "enter", + "Enter": "Enter", "Enter a new password": "Enter a new password", "Enter footnote text": "Enter footnote text", "Enter image description": "Enter image description", @@ -174,8 +175,8 @@ "FAQ": "Tips and suggestions", "Favorite": "Favorites", "Favorite topics": "Favorite topics", - "Feed": "Feed", "feed": "feed", + "Feed": "Feed", "Feed settings": "Feed settings", "Feedback": "Feedback", "Fill email": "Fill email", @@ -195,12 +196,12 @@ "Go to main page": "Go to main page", "Group Chat": "Group Chat", "Groups": "Groups", - "Header 1": "Header 1", "header 1": "header 1", - "Header 2": "Header 2", + "Header 1": "Header 1", "header 2": "header 2", - "Header 3": "Header 3", + "Header 2": "Header 2", "header 3": "header 3", + "Header 3": "Header 3", "Headers": "Headers", "Help": "Помощь", "Help to edit": "Help to edit", @@ -246,8 +247,8 @@ "Invite to collab": "Invite to Collab", "It does not look like url": "It doesn't look like a link", "It's OK. Just enter your email to receive a link to change your password": "It's OK. Just enter your email to receive a link to change your password", - "Italic": "Italic", "italic": "italic", + "Italic": "Italic", "Join": "Join", "Join our maillist": "To receive the best postings, just enter your email", "Join the community": "Join the community", @@ -265,8 +266,8 @@ "Link sent, check your email": "Link sent, check your email", "List of authors of the open editorial community": "List of authors of the open editorial community", "Lists": "Lists", - "Literature": "Literature", "literature": "literature", + "Literature": "Literature", "Load more": "Show more", "Loading": "Loading", "Login and security": "Login and security", @@ -279,16 +280,17 @@ "marker list": "marker list", "Material card": "Material card", "Message": "Message", + "Message text": "Message text", "min. 1400×1400 pix": "мин. 1400×1400 пикс.", "More": "More", "Most commented": "Commented", "Most read": "Readable", "Move down": "Move down", "Move up": "Move up", - "Music": "Music", "music": "music", - "My feed": "My feed", + "Music": "Music", "my feed": "my ribbon", + "My feed": "My feed", "My subscriptions": "Subscriptions", "Name": "Name", "New literary work": "New literary work", @@ -353,6 +355,7 @@ "Quotes": "Quotes", "Reason uknown": "Reason unknown", "Recent": "Fresh", + "Recommend some new topic": "Recommend some new topic", "register": "register", "registered": "registered", "Registered since {date}": "Registered since {date}", @@ -361,6 +364,7 @@ "Repeat new password": "Repeat new password", "Reply": "Reply", "Report": "Complain", + "Report an error": "Report an error", "Reports": "Reports", "Required": "Required", "Resend code": "Send confirmation", @@ -410,9 +414,10 @@ "Song title": "Song title", "Soon": "Скоро", "Sorry, this address is already taken, please choose another one.": "Sorry, this address is already taken, please choose another one", - "Special Projects": "Special Projects", "Special projects": "Special projects", + "Special Projects": "Special Projects", "Specify the source and the name of the author": "Specify the source and the name of the author", + "Specify your e-mail and we will reply.": "Specify your e-mail and we will reply.", "Start conversation": "Start a conversation", "Start dialog": "Start dialog", "Subsccriptions": "Subscriptions", @@ -424,13 +429,13 @@ "subscriber": "subscriber", "subscriber_rp": "subscriber", "subscribers": "subscribers", - "subscribing...": "subscribing...", "Subscribing...": "Subscribing...", - "Subscription": "Subscription", + "subscribing...": "subscribing...", "subscription": "subscription", + "Subscription": "Subscription", "subscription_rp": "subscription", - "Subscriptions": "Subscriptions", "subscriptions": "subscriptions", + "Subscriptions": "Subscriptions", "Substrate": "Substrate", "Success": "Success", "Successfully authorized": "Authorization successful", @@ -438,11 +443,12 @@ "Support Discours": "Support Discours", "Support the project": "Support the project", "Support us": "Support us", - "Terms of use": "Site rules", "terms of use": "terms of use", + "Terms of use": "Site rules", "terms of use keywords": "Discours.io, site rules, terms of use", "Text checking": "Text checking", "Thank you": "Thank you", + "Thank you for reaching us": "Thank you for reaching us", "Thank you!": "Thank you!", "The address is already taken": "The address is already taken", "The most interesting publications on the topic": "The most interesting publications on the topic {topicName}", @@ -479,8 +485,8 @@ "Top viewed": "Most viewed", "Topic is supported by": "Topic is supported by", "topicKeywords": "{topic}, Discours.io, articles, journalism, research", - "Topics": "Topics", "topics": "topics", + "Topics": "Topics", "Topics which supported by author": "Topics which supported by author", "try": "попробуйте", "Try to find another way": "Try to find another way", @@ -499,11 +505,13 @@ "Userpic": "Userpic", "Users": "Users", "verified": "verified", - "Video": "Video", "video": "video", + "Video": "Video", "Video format not supported": "Video format not supported", "view": "view", "Views": "Views", + "Volounteering": "Volounteering", + "Want to suggest, discuss or advise something? Share a topic or an idea? Please send us a message!": "Want to suggest, discuss or advise something? Share a topic or an idea? Please send us a message!", "We are working on collaborative editing of articles and in the near future you will have an amazing opportunity - to create together with your colleagues": "We are working on collaborative editing of articles and in the near future you will have an amazing opportunity - to create together with your colleagues", "We can't find you, check email or": "We can't find you, check email or", "We couldn't find anything for your request": "We couldn’t find anything for your request", @@ -538,6 +546,7 @@ "You ll be able to participate in discussions, rate others' comments and learn about new responses": "You ll be able to participate in discussions, rate others' comments and learn about new responses", "You've confirmed email": "You've confirmed email", "You've reached a non-existed page": "You've reached a non-existed page", + "Your contact for answer": "Your contact for answer", "Your email": "Your email", "Your name will appear on your profile page and as your signature in publications, comments and responses.": "Your name will appear on your profile page and as your signature in publications, comments and responses" } diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 36b98a2f..bf097e77 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -16,8 +16,8 @@ "Add image": "Добавить изображение", "Add images": "Добавить изображения", "Add intro": "Добавить вступление", - "add link": "добавить ссылку", "Add link": "Добавить ссылку", + "add link": "добавить ссылку", "Add rule": "Добавить разделитель", "Add signature": "Добавить подпись", "Add subtitle": "Добавить подзаголовок", @@ -33,10 +33,11 @@ "All authors": "Все авторы", "All posts": "Все публикации", "All posts rating": "Рейтинг всех постов", - "all topics": "все темы", "All topics": "Все темы", + "all topics": "все темы", "Almost done! Check your email.": "Почти готово! Осталось подтвердить вашу почту.", "and some more authors": "{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}", + "Anything else": "Что-либо ещё", "Are you sure you want to delete this comment?": "Уверены, что хотите удалить этот комментарий?", "Are you sure you want to delete this draft?": "Уверены, что хотите удалить этот черновик?", "Are you sure you want to to proceed the action?": "Вы уверены, что хотите продолжить?", @@ -46,10 +47,10 @@ "Artist...": "Исполнитель...", "Artworks": "Артворки", "Audio": "Аудио", - "author": "автор", "Author": "Автор", - "authors": "авторы", + "author": "автор", "Authors": "Авторы", + "authors": "авторы", "Autotypograph": "Автотипограф", "Back": "Назад", "Back to editor": "Вернуться в редактор", @@ -57,11 +58,11 @@ "back to menu": "назад в меню", "Be the first to rate": "Оцените первым", "Become an author": "Стать автором", - "bold": "жирный", "Bold": "Жирный", + "bold": "жирный", "Bookmarked": "Сохранено", - "bookmarks": "закладки", "Bookmarks": "Закладки", + "bookmarks": "закладки", "Bullet list": "Маркированный список", "By alphabet": "По алфавиту", "By authors": "По авторам", @@ -78,8 +79,8 @@ "Can make any changes, accept or reject suggestions, and share access with others": "Может вносить любые изменения, принимать и отклонять предложения, а также делиться доступом с другими", "Can offer edits and comments, but cannot edit the post or share access with others": "Может предлагать правки и комментарии, но не может изменять пост и делиться доступом с другими", "Can write and edit text directly, and accept or reject suggestions from others": "Может писать и редактировать текст напрямую, а также принимать или отклонять предложения других", - "cancel": "отменить", "Cancel": "Отмена", + "cancel": "отменить", "Cancel changes": "Отменить изменения", "Change password": "Сменить пароль", "Characters": "Знаков", @@ -91,8 +92,8 @@ "Co-author": "Соавтор", "Collaborate": "Помочь редактировать", "Collaborators": "Соавторы", - "collections": "коллекции", "Collections": "Коллекции", + "collections": "коллекции", "Come up with a subtitle for your story": "Придумайте подзаголовок вашей истории", "Come up with a title for your story": "Придумайте заголовок вашей истории", "Coming soon": "Уже скоро", @@ -155,8 +156,8 @@ "Dogma": "Догма", "dogma keywords": "Discours.io, догма, редакционные принципы, этический кодекс, журналистика, сообщество", "Draft successfully deleted": "Черновик успешно удален", - "drafts": "черновики", "Drafts": "Черновики", + "drafts": "черновики", "Drag the image to this area": "Перетащите изображение в эту область", "Each image must be no larger than 5 MB.": "Каждое изображение должно быть размером не больше 5 мб.", "earlier": "ранее", @@ -166,8 +167,8 @@ "Editor": "Редактор", "Email": "Почта", "email not confirmed": "email не подтвержден", - "enter": "войти", "Enter": "Войти", + "enter": "войти", "Enter a new password": "Введите новый пароль", "Enter footnote text": "Введите текст сноски", "Enter image description": "Введите описание изображения", @@ -182,8 +183,8 @@ "FAQ": "Советы и предложения", "Favorite": "Избранное", "Favorite topics": "Избранные темы", - "feed": "лента", "Feed": "Лента", + "feed": "лента", "Feed settings": "Настроить ленту", "Feedback": "Обратная связь", "Fill email": "Введите почту", @@ -206,12 +207,12 @@ "Group Chat": "Общий чат", "Groups": "Группы", "Header": "Заголовок", - "header 1": "заголовок 1", "Header 1": "Заголовок 1", - "header 2": "заголовок 2", + "header 1": "заголовок 1", "Header 2": "Заголовок 2", - "header 3": "заголовок 3", + "header 2": "заголовок 2", "Header 3": "Заголовок 3", + "header 3": "заголовок 3", "Headers": "Заголовки", "Help": "Помощь", "Help to edit": "Помочь редактировать", @@ -258,8 +259,8 @@ "Invite to collab": "Пригласить к участию", "It does not look like url": "Это не похоже на ссылку", "It's OK. Just enter your email to receive a link to change your password": "Ничего страшного. Просто укажите свою почту, чтобы получить ссылку для смены пароля", - "italic": "курсив", "Italic": "Курсив", + "italic": "курсив", "Join": "Присоединиться", "Join our maillist": "Чтобы получать рассылку лучших публикаций, просто укажите свою почту", "Join the community": "Присоединиться к сообществу", @@ -278,8 +279,8 @@ "Link sent, check your email": "Ссылка отправлена, проверьте почту", "List of authors of the open editorial community": "Список авторов сообщества открытой редакции", "Lists": "Списки", - "literature": "литература", "Literature": "Литература", + "literature": "литература", "Load more": "Показать ещё", "Loading": "Загрузка", "Login and security": "Вход и безопасность", @@ -292,16 +293,17 @@ "marker list": "маркир. список", "Material card": "Карточка материала", "Message": "Написать", + "Message text": "Текст сообщения", "min. 1400×1400 pix": "мин. 1400×1400 пикс.", "More": "Ещё", "Most commented": "Комментируемое", "Most read": "Читаемое", "Move down": "Переместить вниз", "Move up": "Переместить вверх", - "music": "музыка", "Music": "Музыка", - "my feed": "моя лента", + "music": "музыка", "My feed": "Моя лента", + "my feed": "моя лента", "My subscriptions": "Подписки", "Name": "Имя", "New literary work": "Новое произведение", @@ -373,6 +375,7 @@ "Quotes": "Цитаты", "Reason uknown": "Причина неизвестна", "Recent": "Свежее", + "Recommend some new topic": "Предложить тему", "register": "зарегистрируйтесь", "registered": "уже зарегистрирован", "Registered since {date}": "На сайте c {date}", @@ -382,6 +385,7 @@ "Repeat new password": "Повторите новый пароль", "Reply": "Ответить", "Report": "Пожаловаться", + "Report an error": "Сообщить об ошибке", "Reports": "Репортажи", "Required": "Поле обязательно для заполнения", "Resend code": "Выслать подтверждение", @@ -436,9 +440,10 @@ "Song title": "Название песни", "Soon": "Скоро", "Sorry, this address is already taken, please choose another one.": "Увы, этот адрес уже занят, выберите другой", - "Special projects": "Спецпроекты", "Special Projects": "Спецпроекты", + "Special projects": "Спецпроекты", "Specify the source and the name of the author": "Укажите источник и имя автора", + "Specify your e-mail and we will reply.": "Укажите ваш e-mail и мы обязательно ответим.", "squib": "Подверстка", "Start conversation": "Начать беседу", "Start dialog": "Начать диалог", @@ -452,8 +457,8 @@ "subscriber": "подписчик", "subscriber_rp": "подписчика", "subscribers": "подписчиков", - "Subscribing...": "Подписываем...", "subscribing...": "Подписка...", + "Subscribing...": "Подписываем...", "Subscription": "Подписка", "Subscriptions": "Подписки", "Substrate": "Подложка", @@ -463,11 +468,12 @@ "Support Discours": "Поддержите Дискурс", "Support the project": "Поддержать проект", "Support us": "Помочь журналу", - "terms of use": "правилами пользования сайтом", "Terms of use": "Правила сайта", + "terms of use": "правилами пользования сайтом", "terms of use keywords": "Discours.io, правила сайта, terms of use", "Text checking": "Проверка текста", "Thank you": "Благодарности", + "Thank you for reaching us": "Спасибо, что связались с нами", "Thank you!": "Спасибо Вам!", "The address is already taken": "Адрес уже занят", "The most interesting publications on the topic": "Самые интересные публикации по теме {topicName}", @@ -504,8 +510,8 @@ "Top viewed": "Самое читаемое", "Topic is supported by": "Тему поддерживают", "topicKeywords": "{topic}, Discours.io, статьи, журналистика, исследования", - "topics": "темы", "Topics": "Темы", + "topics": "темы", "Topics which supported by author": "Автор поддерживает темы", "try": "попробуйте", "Try to find another way": "Попробуйте найти по-другому", @@ -524,11 +530,13 @@ "Userpic": "Аватар", "Users": "Пользователи", "verified": "уже подтверждён", - "video": "видео", "Video": "Видео", + "video": "видео", "Video format not supported": "Тип видео не поддерживается", "view": "просмотр", "Views": "Просмотры", + "Volounteering": "Волонтёрство", + "Want to suggest, discuss or advise something? Share a topic or an idea? Please send us a message!": "Хотите что-то предложить, обсудить или посоветовать? Поделиться темой или идеей? Напишите нам скорее!", "We are working on collaborative editing of articles and in the near future you will have an amazing opportunity - to create together with your colleagues": "Мы работаем над коллаборативным редактированием статей и в ближайшем времени у вас появиться удивительная возможность - творить вместе с коллегами", "We can't find you, check email or": "Не можем вас найти, проверьте адрес электронной почты или", "We couldn't find anything for your request": "Мы не смогли ничего найти по вашему запросу", @@ -565,6 +573,7 @@ "You've confirmed email": "Вы подтвердили почту", "You've reached a non-existed page": "Вы попали на несуществующую страницу", "You've successfully logged out": "Вы успешно вышли из аккаунта", + "Your contact for answer": "Ваш контакт для обратной связи", "Your email": "Ваш email", "Your name will appear on your profile page and as your signature in publications, comments and responses.": "Ваше имя появится на странице вашего профиля и как ваша подпись в публикациях, комментариях и откликах" } diff --git a/src/components/Views/ConnectView.tsx b/src/components/Views/ConnectView.tsx new file mode 100644 index 00000000..42bebf2b --- /dev/null +++ b/src/components/Views/ConnectView.tsx @@ -0,0 +1,97 @@ +import { createSignal } from "solid-js" +import { Show } from "solid-js/web" +import { useLocalize } from "~/context/localize" + +export const ConnectView = () => { + const { t } = useLocalize() + + const [state, setState] = createSignal<'initial' | 'loading' | 'success' | 'error'>('initial') + let formRef: HTMLFormElement | null + const handleFormSubmit = async (e: SubmitEvent) => { + e.preventDefault() + setState('loading') + + const postData = formRef? Array.from(formRef.elements).reduce( + (acc, element) => { + const formField = element as unknown as { name: string; value: string } + if (formField.name) { + acc[formField.name] = formField.value + } + + return acc + }, + {} as Record, + ) : {} + + const requestOptions = { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(postData), + } + + const result = await fetch('/api/feedback', requestOptions) + + if (!result.ok) { + console.error('[handleFormSubmit]', result) + setState('error') + return + } + + setState('success') + window.scrollTo({ + top: 0, + }) + } + + return (
+
+
+ +

+ {t('Suggest an idea')} +

+ +

+ {t('Want to suggest, discuss or advise something? Share a topic or an idea? Please send us a message!')} + {t('Specify your e-mail and we will reply.')} +

+ +
(formRef = el)}> +
+ +
+
+ + +
+
+