From 6de55902239619e909cbc9e914cfeead5bd5c1f2 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Sun, 15 Oct 2023 15:09:31 +0300 Subject: [PATCH 1/7] Fix profile modals (#260) --- .../Author/AuthorCard/AuthorCard.tsx | 70 +++++++++---------- .../Inbox/CreateModalContent.module.scss | 2 - src/components/Inbox/DialogCard.tsx | 12 ++-- src/components/Inbox/Message.tsx | 2 +- src/components/Inbox/Search.module.scss | 1 + src/components/Nav/Modal/Modal.tsx | 4 +- src/components/Views/Author/Author.tsx | 1 - src/context/inbox.tsx | 2 +- src/graphql/types.gen.ts | 2 +- 9 files changed, 45 insertions(+), 51 deletions(-) diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 2dd2bf8a..af0aa3be 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -118,10 +118,6 @@ export const AuthorCard = (props: Props) => { } }) - const handleCloseFollowModals = () => { - redirectPage(router, 'author', { slug: props.author.slug }) - } - if (props.isAuthorPage && props.author.userpic?.includes('assets.discours.io')) { setUserpicUrl(props.author.userpic.replace('100x', '500x500')) } @@ -219,7 +215,7 @@ export const AuthorCard = (props: Props) => { {(f) => }
- {t('SubscriptionWithCount', { count: props.followers.length })} + {t('SubscriberWithCount', { count: props.followers.length })}
@@ -232,23 +228,35 @@ export const AuthorCard = (props: Props) => { - 0}> - - - {(f) => { - if ('name' in f) { - return - } else if ('title' in f) { - return - } - return null - }} - -
- {t('SubscriberWithCount', { count: props?.following.length ?? 0 })} -
-
-
+ + 0}> + + + {(f) => { + if ('name' in f) { + return + } else if ('title' in f) { + return + } + return null + }} + +
+ {t('SubscriptionWithCount', { count: props?.following.length ?? 0 })} +
+
+
+ 0}> + } + /> + +
@@ -357,7 +365,7 @@ export const AuthorCard = (props: Props) => { - + <>

{t('Followers')}

@@ -372,22 +380,8 @@ export const AuthorCard = (props: Props) => { - - -
- } - /> -
-
- - + <>

{t('Subscriptions')}

    diff --git a/src/components/Inbox/CreateModalContent.module.scss b/src/components/Inbox/CreateModalContent.module.scss index ef6a7115..a7d9da1e 100644 --- a/src/components/Inbox/CreateModalContent.module.scss +++ b/src/components/Inbox/CreateModalContent.module.scss @@ -1,6 +1,4 @@ .CreateModalContent { - padding: 24px; - .footer { padding-top: 12px; display: flex; diff --git a/src/components/Inbox/DialogCard.tsx b/src/components/Inbox/DialogCard.tsx index c5d691da..0e5021de 100644 --- a/src/components/Inbox/DialogCard.tsx +++ b/src/components/Inbox/DialogCard.tsx @@ -6,7 +6,6 @@ import formattedTime from '../../utils/formatDateTime' import { clsx } from 'clsx' import styles from './DialogCard.module.scss' import { useLocalize } from '../../context/localize' -import MD from '../Article/MD' type DialogProps = { online?: boolean @@ -26,10 +25,11 @@ const DialogCard = (props: DialogProps) => { () => props.members && props.members.filter((member) => member.id !== props.ownId) ) - const names = createMemo(() => - companions() - ?.map((companion) => companion.name) - .join(', ') + const names = createMemo( + () => + companions() + ?.map((companion) => companion.name) + .join(', ') ) return ( @@ -55,7 +55,7 @@ const DialogCard = (props: DialogProps) => {
    - +
    1}>{names()} diff --git a/src/components/Inbox/Message.tsx b/src/components/Inbox/Message.tsx index c01f1c0a..bdcf0b9d 100644 --- a/src/components/Inbox/Message.tsx +++ b/src/components/Inbox/Message.tsx @@ -45,7 +45,7 @@ export const Message = (props: Props) => { - +
    {formattedTime(props.content.createdAt * 1000)()}
    diff --git a/src/components/Inbox/Search.module.scss b/src/components/Inbox/Search.module.scss index a92c66bc..c69ce198 100644 --- a/src/components/Inbox/Search.module.scss +++ b/src/components/Inbox/Search.module.scss @@ -1,4 +1,5 @@ .Search { + flex: 1; .field { position: relative; background: #fff; diff --git a/src/components/Nav/Modal/Modal.tsx b/src/components/Nav/Modal/Modal.tsx index 0b6e1415..5807ef58 100644 --- a/src/components/Nav/Modal/Modal.tsx +++ b/src/components/Nav/Modal/Modal.tsx @@ -1,4 +1,4 @@ -import { createEffect, createMemo, createSignal, Show } from 'solid-js' +import { createEffect, createMemo, createSignal, on, Show } from 'solid-js' import type { JSX } from 'solid-js' import { clsx } from 'clsx' import { hideModal, useModalStore } from '../../../stores/ui' @@ -8,6 +8,7 @@ import styles from './Modal.module.scss' import { redirectPage } from '@nanostores/router' import { router } from '../../../stores/router' import { Icon } from '../../_shared/Icon' +import { resetSortedArticles } from '../../../stores/zine/articles' interface Props { name: string @@ -38,6 +39,7 @@ export const Modal = (props: Props) => { useEscKeyDownHandler(handleHide) createEffect(() => { + console.log('!!! modal:', modal()) setVisible(modal() === props.name) }) diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index 027d260d..652bb8d8 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -67,7 +67,6 @@ export const AuthorView = (props: Props) => { } onMount(async () => { - hideModal() try { const userSubscribers = await apiClient.getAuthorFollowers({ slug: props.authorSlug }) setFollowers(userSubscribers) diff --git a/src/context/inbox.tsx b/src/context/inbox.tsx index 1356bf4c..356afbd5 100644 --- a/src/context/inbox.tsx +++ b/src/context/inbox.tsx @@ -33,7 +33,7 @@ export const InboxProvider = (props: { children: JSX.Element }) => { const newChats = await apiClient.getChats({ limit: 50, offset: 0 }) setChats(newChats) } catch (error) { - console.log(error) + console.log('[loadChats]', error) } } diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index 505f5ba2..67dcd2ac 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -310,7 +310,7 @@ export type Notification = { reaction?: Maybe seen: Scalars['Boolean'] shout?: Maybe - type?: Maybe + type: NotificationType } export enum NotificationType { From 3b640aa67f63adbbb70e877f8020b2819354aa7d Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Sun, 15 Oct 2023 15:47:18 -0300 Subject: [PATCH 2/7] feat: add in CI/CD pipline --- .gitea/worflows/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitea/worflows/main.yml diff --git a/.gitea/worflows/main.yml b/.gitea/worflows/main.yml new file mode 100644 index 00000000..e69de29b From 30e09f447ef6a5948fdf6e2e5a60589d453791a2 Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Sun, 15 Oct 2023 15:48:24 -0300 Subject: [PATCH 3/7] feat: add in CI/CD pipline --- .gitea/{worflows => workflows}/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .gitea/{worflows => workflows}/main.yml (100%) diff --git a/.gitea/worflows/main.yml b/.gitea/workflows/main.yml similarity index 100% rename from .gitea/worflows/main.yml rename to .gitea/workflows/main.yml From 45597bda8ba93271e9ebd0cdaccdb37787b1211a Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Sun, 15 Oct 2023 15:49:46 -0300 Subject: [PATCH 4/7] feat: add in CI/CD pipline --- .gitea/workflows/main.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index e69de29b..c88393d4 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -0,0 +1,22 @@ +name: 'deploy' +on: [push] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Cloning repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get Repo Name + id: repo_name + run: echo "::set-output name=repo::$(echo ${GITHUB_REPOSITORY##*/})" + + - name: Push to dokku + uses: dokku/github-action@master + with: + branch: 'main' + git_remote_url: 'ssh://dokku@staging.discours.io:22/${{ steps.repo_name.outputs.repo }}' + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file From 99642e71ab8e46f32c69657779232dc9cab19542 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:40:34 +0300 Subject: [PATCH 5/7] Feature/comments fixies (#261) Comments fix pack --- src/components/Article/Comment.tsx | 16 +++++++++++----- src/components/Article/CommentsTree.tsx | 14 +++++++++++--- src/components/Editor/SimplifiedEditor.tsx | 10 ++++------ src/components/Nav/Modal/Modal.tsx | 1 - src/components/Views/Inbox.tsx | 2 +- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index bd4406d8..35788445 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -31,6 +31,8 @@ type Props = { lastSeen?: Date class?: string showArticleLink?: boolean + clickedReply?: (id: number) => void + clickedReplyId?: number } export const Comment = (props: Props) => { @@ -178,12 +180,11 @@ export const Comment = (props: Props) => { handleUpdate(value)} - submitByShiftEnter={true} + submitByCtrlEnter={true} setClear={clearEditor()} /> @@ -195,7 +196,10 @@ export const Comment = (props: Props) => { */}
    - + {t('Loading')}

    }> handleCreate(value)} - submitByShiftEnter={true} + submitByCtrlEnter={true} />
    @@ -262,6 +266,8 @@ export const Comment = (props: Props) => { isArticleAuthor={props.isArticleAuthor} comment={c} lastSeen={props.lastSeen} + clickedReply={props.clickedReply} + clickedReplyId={props.clickedReplyId} /> )} diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx index 7a7b616e..0122f626 100644 --- a/src/components/Article/CommentsTree.tsx +++ b/src/components/Article/CommentsTree.tsx @@ -1,4 +1,4 @@ -import { Show, createMemo, createSignal, onMount, For } from 'solid-js' +import { Show, createMemo, createSignal, onMount, For, createEffect } from 'solid-js' import { Comment } from './Comment' import styles from './Article.module.scss' import { clsx } from 'clsx' @@ -43,6 +43,9 @@ export const CommentsTree = (props: Props) => { const { t } = useLocalize() const [commentsOrder, setCommentsOrder] = createSignal('createdAt') const [newReactions, setNewReactions] = createSignal([]) + const [clearEditor, setClearEditor] = createSignal(false) + const [clickedReplyId, setClickedReplyId] = createSignal() + const { reactionEntities, actions: { createReaction } @@ -88,7 +91,6 @@ export const CommentsTree = (props: Props) => { setCookie() } }) - const handleSubmitComment = async (value) => { try { await createReaction({ @@ -96,9 +98,11 @@ export const CommentsTree = (props: Props) => { body: value, shout: props.shoutId }) + setClearEditor(true) } catch (error) { console.error('[handleCreate reaction]:', error) } + setClearEditor(false) } return ( @@ -153,6 +157,8 @@ export const CommentsTree = (props: Props) => { props.articleAuthors.some((a) => a.slug === reaction.createdBy.slug) )} comment={reaction} + clickedReply={(id) => setClickedReplyId(id)} + clickedReplyId={clickedReplyId()} lastSeen={dateFromLocalStorage} /> )} @@ -175,9 +181,11 @@ export const CommentsTree = (props: Props) => { handleSubmitComment(value)} - submitByShiftEnter={true} + setClear={clearEditor()} /> diff --git a/src/components/Editor/SimplifiedEditor.tsx b/src/components/Editor/SimplifiedEditor.tsx index 191125d9..2b42b295 100644 --- a/src/components/Editor/SimplifiedEditor.tsx +++ b/src/components/Editor/SimplifiedEditor.tsx @@ -50,10 +50,10 @@ type Props = { imageEnabled?: boolean setClear?: boolean smallHeight?: boolean - submitByEnter?: boolean - submitByShiftEnter?: boolean + submitByCtrlEnter?: boolean onlyBubbleControls?: boolean controlsAlwaysVisible?: boolean + autoFocus?: boolean } export const MAX_DESCRIPTION_LIMIT = 400 @@ -133,6 +133,7 @@ const SimplifiedEditor = (props: Props) => { placeholder: props.placeholder }) ], + autofocus: props.autoFocus, content: content ?? null })) @@ -200,10 +201,7 @@ const SimplifiedEditor = (props: Props) => { return } - if ( - event.code === 'Enter' && - ((props.submitByEnter && !event.shiftKey) || (props.submitByShiftEnter && event.shiftKey)) - ) { + if (event.code === 'Enter' && props.submitByCtrlEnter && (event.metaKey || event.ctrlKey)) { event.preventDefault() props.onSubmit(html()) handleClear() diff --git a/src/components/Nav/Modal/Modal.tsx b/src/components/Nav/Modal/Modal.tsx index 5807ef58..929c7ab1 100644 --- a/src/components/Nav/Modal/Modal.tsx +++ b/src/components/Nav/Modal/Modal.tsx @@ -39,7 +39,6 @@ export const Modal = (props: Props) => { useEscKeyDownHandler(handleHide) createEffect(() => { - console.log('!!! modal:', modal()) setVisible(modal() === props.name) }) diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index eebe3edf..0ab9c89e 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -269,7 +269,7 @@ export const InboxView = () => { placeholder={t('Write message')} setClear={isClear()} onSubmit={(message) => handleSubmit(message)} - submitByEnter={true} + submitByCtrlEnter={true} />
From fdd05246a584aad4cc7a3051d7869b45511c66b4 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:54:14 +0300 Subject: [PATCH 6/7] Feature/i18n fixes (#262) i18n fixies --- public/locales/en/translation.json | 36 ++++++++++------- public/locales/ru/translation.json | 39 ++++++++++--------- .../Author/AuthorBadge/AuthorBadge.tsx | 2 +- .../Author/AuthorCard/AuthorCard.tsx | 4 +- src/components/Discours/Subscribe.tsx | 2 +- .../AuthModalHeader/AuthModalHeader.tsx | 2 +- .../Nav/AuthModal/SocialProviders.tsx | 2 +- src/components/Nav/Header/Header.tsx | 10 ++--- src/components/Topic/Card.tsx | 2 +- .../Topic/TopicBadge/TopicBadge.tsx | 2 +- src/pages/profile/profileSettings.page.tsx | 6 +-- 11 files changed, 58 insertions(+), 49 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 7b5f0ee8..d277ae8c 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -1,6 +1,6 @@ { "...subscribing": "...subscribing", - "About myself": "About myself", + "About": "About", "About the project": "About the project", "Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title": "Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title", "Add a link or click plus to embed media": "Add a link or click plus to embed media", @@ -70,6 +70,7 @@ "Comment successfully deleted": "Comment successfully deleted", "Comments": "Comments", "Communities": "Communities", + "Community Principles": "Community Principles", "Confirm": "Confirm", "Cooperate": "Cooperate", "Copy": "Copy", @@ -103,6 +104,7 @@ "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.", "Edit": "Edit", + "Edit profile": "Edit profile", "Editing": "Editing", "Email": "Mail", "Enter": "Enter", @@ -111,13 +113,6 @@ "Enter image description": "Enter image description", "Enter image title": "Enter image title", "Enter text": "Enter text", - "Enter the Discours": "Enter the Discours", - "Enter the Discours to add to your bookmarks": "Enter the Discours to add to your bookmarks", - "Enter the Discours to participate in discussions": "Enter the Discours to participate in discussions", - "Enter the Discours to publish articles": "Enter the Discours to publish articles", - "Enter the Discours to subscribe": "Enter the Discours to subscribe", - "Enter the Discours to subscribe to new publications": "Enter the Discours to subscribe to new publications", - "Enter the Discours to vote": "Enter the Discours to vote", "Enter the code or click the link from email to confirm": "Enter the code from the email or follow the link in the email to confirm registration", "Enter your new password": "Enter your new password", "Error": "Error", @@ -132,6 +127,7 @@ "Follow": "Follow", "Follow the topic": "Follow the topic", "Followers": "Followers", + "Following": "Following", "Forgot password?": "Forgot your password?", "Forward": "Forward", "Full name": "First and last name", @@ -194,6 +190,7 @@ "Logout": "Logout", "Looks like you forgot to upload the video": "Looks like you forgot to upload the video", "Manifest": "Manifest", + "Manifesto": "Manifesto", "Many files, choose only one": "Many files, choose only one", "Material card": "Material card", "More": "More", @@ -209,6 +206,8 @@ "New only": "New only", "New password": "New password", "New stories every day and even more!": "New stories and more are waiting for you every day!", + "NewCommentNotificationText": "{commentsCount, plural, one {New comment} other {{commentsCount} comments}} to your publication {shoutTitle} from {lastCommenterName}{restUsersCount, plural, =0 {} one { one more user} other { and more {restUsersCount} users}}", + "NewReplyNotificationText": "{commentsCount, plural, one {New reply} other {{commentsCount} replays} other {{commentsCount} новых ответов}} to your publication {shoutTitle} от {lastCommenterName}{restUsersCount, plural, =0 {} one { and one more user} other { and more {restUsersCount} users}}", "Newsletter": "Newsletter", "Night mode": "Night mode", "No notifications, yet": "No notifications, yet", @@ -216,7 +215,6 @@ "Nothing here yet": "There's nothing here yet", "Nothing is here": "There is nothing here", "Notifications": "Notifications", - "Or continue with social network": "Or continue with social network", "Or paste a link to an image": "Or paste a link to an image", "Ordered list": "Ordered list", "Our regular contributor": "Our regular contributor", @@ -232,6 +230,7 @@ "Paste Embed code": "Paste Embed code", "Personal": "Personal", "Pin": "Pin", + "Platform Guide": "Platform Guide", "Please check your email address": "Please check your email address", "Please confirm your email to finish": "Confirm your email and the action will complete", "Please enter a name to sign your comments and publication": "Please enter a name to sign your comments and publication", @@ -294,7 +293,9 @@ "Subscribe us": "Subscribe us", "Subscribe what you like to tune your personal feed": "Subscribe to topics that interest you to customize your personal feed and get instant updates on new posts and discussions", "Subscribe who you like to tune your personal feed": "Subscribe to authors you're interested in to customize your personal feed and get instant updates on new posts and discussions", + "SubscriberWithCount": "{count, plural, =0 {no followers} one {{count} follower} other {{count} followers}", "Subscription": "Subscription", + "SubscriptionWithCount": "{count, plural, =0 {no subscriptions} one {{count} subscription} other {{count} subscriptions}", "Subscriptions": "Subscriptions", "Substrate": "Substrate", "Success": "Success", @@ -342,10 +343,17 @@ "We can't find you, check email or": "We can't find you, check email or", "We know you, please try to login": "This email address is already registered, please try to login", "We've sent you a message with a link to enter our website.": "We've sent you an email with a link to your email. Follow the link in the email to enter our website.", + "Welcome to Discours": "Welcome to Discours", + "Welcome to Discours to add to your bookmarks": "Welcome to Discours to add to your bookmarks", + "Welcome to Discours to participate in discussions": "Welcome to Discours to participate in discussions", + "Welcome to Discours to publish articles": "Welcome to Discours to publish articles", + "Welcome to Discours to subscribe": "Welcome to Discours to subscribe", + "Welcome to Discours to subscribe to new publications": "Welcome to Discours to subscribe to new publications", + "Welcome to Discours to vote": "Welcome to Discours to vote", "Where": "From", "Words": "Слов", "Work with us": "Cooperate with Discourse", - "Write": "Write", + "Message": "Message", "Write a comment...": "Write a comment...", "Write a short introduction": "Write a short introduction", "Write about the topic": "Write about the topic", @@ -353,7 +361,6 @@ "Write comment": "Write comment", "Write message": "Write a message", "Write to us": "Write to us", - "You are subscribed": "You are subscribed", "You can download multiple tracks at once in .mp3, .wav or .flac formats": "You can download multiple tracks at once in .mp3, .wav or .flac formats", "You were successfully authorized": "You were successfully authorized", "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", @@ -389,6 +396,7 @@ "images": "images", "invalid password": "invalid password", "italic": "italic", + "journal": "journal", "jpg, .png, max. 10 mb.": "jpg, .png, макс. 10 мб.", "literature": "literature", "marker list": "marker list", @@ -396,6 +404,7 @@ "music": "music", "my feed": "my ribbon", "number list": "number list", + "or sign in with social networks": "or sign in with social networks", "personal data usage and email notifications": "to process personal data and receive email notifications", "post": "post", "register": "register", @@ -413,8 +422,5 @@ "topics": "topics", "user already exist": "user already exists", "video": "video", - "view": "view", - "zine": "zine", - "SubscriptionWithPlurals": "{count, plural, =0 {no subscriptions} one {{count} subscription} other {{count} subscriptions}", - "Edit profile": "Edit profile" + "view": "view" } diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index ba470f72..5db90ec4 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -1,7 +1,7 @@ { "...subscribing": "...подписываем", "A short introduction to keep the reader interested": "Добавьте вступление, чтобы заинтересовать читателя", - "About myself": "О себе", + "About": "О себе", "About the project": "О проекте", "Accomplices": "Соучастники", "Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title": "Добавьте несколько тем, чтобы читатель знал, о чем ваш материал, и мог найти его на страницах интересных ему тем. Темы можно менять местами, первая тема становится заглавной", @@ -74,6 +74,7 @@ "Comment successfully deleted": "Комментарий успешно удален", "Comments": "Комментарии", "Communities": "Сообщества", + "Community Principles": "Принципы сообщества", "Confirm": "Подтвердить", "Cooperate": "Соучаствовать", "Copy": "Скопировать", @@ -107,6 +108,7 @@ "Drag the image to this area": "Перетащите изображение в эту область", "Each image must be no larger than 5 MB.": "Каждое изображение должно быть размером не больше 5 мб.", "Edit": "Редактировать", + "Edit profile": "Редактировать профиль", "Edited": "Отредактирован", "Editing": "Редактирование", "Email": "Почта", @@ -116,13 +118,6 @@ "Enter image description": "Введите описание изображения", "Enter image title": "Введите название изображения", "Enter text": "Введите текст", - "Enter the Discours": "Войти в Дискурс", - "Enter the Discours to add to your bookmarks": "Войдите в Дискурс, чтобы добавить в закладки", - "Enter the Discours to participate in discussions": "Войдите в Дискурс для участия в дискуссиях", - "Enter the Discours to publish articles": "Войдите в Дискурс, чтобы публиковать статьи", - "Enter the Discours to subscribe": "Войдите в Дискурс для подписки на новые публикации", - "Enter the Discours to subscribe to new publications": "Войдите в Дискурс, чтобы подписаться", - "Enter the Discours to vote": "Войдите в Дискурс, чтобы голосовать", "Enter the code or click the link from email to confirm": "Введите код из письма или пройдите по ссылке в письме для подтверждения регистрации", "Enter your new password": "Введите новый пароль", "Error": "Ошибка", @@ -137,6 +132,7 @@ "Follow": "Подписаться", "Follow the topic": "Подписаться на тему", "Followers": "Подписчики", + "Following": "Вы подписаны", "Forgot password?": "Забыли пароль?", "Forward": "Переслать", "Full name": "Имя и фамилия", @@ -204,8 +200,10 @@ "Logout": "Выход", "Looks like you forgot to upload the video": "Похоже, что вы забыли загрузить видео", "Manifest": "Манифест", + "Manifesto": "Манифест", "Many files, choose only one": "Много файлов, выберете один", "Material card": "Карточка материала", + "Message": "Сообщение", "More": "Ещё", "Most commented": "Комментируемое", "Most read": "Читаемое", @@ -219,6 +217,8 @@ "New only": "Только новые", "New password": "Новый пароль", "New stories every day and even more!": "Каждый день вас ждут новые истории и ещё много всего интересного!", + "NewCommentNotificationText": "{commentsCount, plural, one {Новый комментарий} few {{commentsCount} новых комментария} other {{commentsCount} новых комментариев}} к вашей публикации {shoutTitle} от {lastCommenterName}{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}", + "NewReplyNotificationText": "{commentsCount, plural, one {Новый ответ} few {{commentsCount} новых ответа} other {{commentsCount} новых ответов}} к вашему комментарию к публикации {shoutTitle} от {lastCommenterName}{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}", "Newsletter": "Рассылка", "Night mode": "Ночная тема", "No notifications, yet": "Тут пока пусто", @@ -226,7 +226,6 @@ "Nothing here yet": "Здесь пока ничего нет", "Nothing is here": "Здесь ничего нет", "Notifications": "Уведомления", - "Or continue with social network": "Или войдите через соцсеть", "Or paste a link to an image": "Или вставьте ссылку на изображение", "Ordered list": "Нумерованный список", "Our regular contributor": "Наш постоянный автор", @@ -242,6 +241,7 @@ "Paste Embed code": "Вставьте embed код", "Personal": "Личные", "Pin": "Закрепить", + "Platform Guide": "Гид по дискурсу", "Please check your email address": "Пожалуйста, проверьте введенный адрес почты", "Please confirm your email to finish": "Подтвердите почту и действие совершится", "Please enter a name to sign your comments and publication": "Пожалуйста, введите имя, которое будет отображаться на сайте", @@ -312,7 +312,9 @@ "Subscribe us": "Подпишитесь на нас", "Subscribe what you like to tune your personal feed": "Подпишитесь на интересующие вас темы, чтобы настроить вашу персональную ленту и моментально узнавать о новых публикациях и обсуждениях", "Subscribe who you like to tune your personal feed": "Подпишитесь на интересующих вас авторов, чтобы настроить вашу персональную ленту и моментально узнавать о новых публикациях и обсуждениях", + "SubscriberWithCount": "{count, plural, =0 {нет подписчиков} one {{count} подписчик} few {{count} подписчика} other {{count} подписчиков}}", "Subscription": "Подписка", + "SubscriptionWithCount": "{count, plural, =0 {нет подписок} one {{count} подписка} few {{count} подписки} other {{count} подписок}}", "Subscriptions": "Подписки", "Substrate": "Подложка", "Success": "Успешно", @@ -360,11 +362,17 @@ "We can't find you, check email or": "Не можем вас найти, проверьте адрес электронной почты или", "We know you, please try to login": "Такой адрес почты уже зарегистрирован, попробуйте залогиниться", "We've sent you a message with a link to enter our website.": "Мы выслали вам письмо с ссылкой на почту. Перейдите по ссылке в письме, чтобы войти на сайт.", + "Welcome to Discours": "Добро пожаловать в Дискурс", + "Welcome to Discours to add to your bookmarks": "Войдите в Дискурс, чтобы добавить в закладки", + "Welcome to Discours to participate in discussions": "Войдите в Дискурс для участия в дискуссиях", + "Welcome to Discours to publish articles": "Войдите в Дискурс, чтобы публиковать статьи", + "Welcome to Discours to subscribe": "Войдите в Дискурс для подписки на новые публикации", + "Welcome to Discours to subscribe to new publications": "Войдите в Дискурс, чтобы подписаться", + "Welcome to Discours to vote": "Войдите в Дискурс, чтобы голосовать", "Welcome!": "Добро пожаловать!", "Where": "Откуда", "Words": "Слов", "Work with us": "Сотрудничать с Дискурсом", - "Write": "Написать", "Write a comment...": "Написать комментарий...", "Write a short introduction": "Напишите краткое вступление", "Write about the topic": "Написать в тему", @@ -372,7 +380,6 @@ "Write comment": "Написать комментарий", "Write message": "Написать сообщение", "Write to us": "Напишите нам", - "You are subscribed": "Вы подписаны", "You can download multiple tracks at once in .mp3, .wav or .flac formats": "Можно загрузить сразу несколько треков в форматах .mp3, .wav или .flac", "You was successfully authorized": "Вы были успешно авторизованы", "You ll be able to participate in discussions, rate others' comments and learn about new responses": "Вы сможете участвовать в обсуждениях, оценивать комментарии других и узнавать о новых ответах", @@ -411,6 +418,7 @@ "images": "изображения", "invalid password": "некорректный пароль", "italic": "курсив", + "journal": "журнал", "jpg, .png, max. 10 mb.": "jpg, .png, макс. 10 мб.", "literature": "литература", "marker list": "маркир. список", @@ -419,6 +427,7 @@ "my feed": "моя лента", "number list": "нумер. список", "or": "или", + "or sign in with social networks": "или войдите через соцсеть", "personal data usage and email notifications": "на обработку персональных данных и на получение почтовых уведомлений", "post": "пост", "register": "зарегистрируйтесь", @@ -436,11 +445,5 @@ "topics": "темы", "user already exist": "пользователь уже существует", "video": "видео", - "view": "просмотр", - "zine": "журнал", - "SubscriberWithCount": "{count, plural, =0 {нет подписчиков} one {{count} подписчик} few {{count} подписчика} other {{count} подписчиков}}", - "SubscriptionWithCount": "{count, plural, =0 {нет подписок} one {{count} подписка} few {{count} подписки} other {{count} подписок}}", - "Edit profile": "Редактировать профиль", - "NewCommentNotificationText": "{commentsCount, plural, one {Новый комментарий} few {{commentsCount} новых комментария} other {{commentsCount} новых комментариев}} к вашей публикации {shoutTitle} от {lastCommenterName}{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}", - "NewReplyNotificationText": "{commentsCount, plural, one {Новый ответ} few {{commentsCount} новых ответа} other {{commentsCount} новых ответов}} к вашему комментарию к публикации {shoutTitle} от {lastCommenterName}{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}" + "view": "просмотр" } diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index d60ec4cf..772b4479 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -97,7 +97,7 @@ export const AuthorBadge = (props: Props) => { @@ -357,7 +357,7 @@ export const AuthorCard = (props: Props) => { - {t('Write')} + {t('Message')}
diff --git a/src/components/Discours/Subscribe.tsx b/src/components/Discours/Subscribe.tsx index 6357cedb..a2301204 100644 --- a/src/components/Discours/Subscribe.tsx +++ b/src/components/Discours/Subscribe.tsx @@ -55,7 +55,7 @@ export default () => { const response = await fetch('/api/newsletter', requestOptions) if (response.ok) { - setTitle(t('You are subscribed')) + setTitle(t('Following')) showSnackbar({ body: t('Thank you for subscribing') }) } else { if (response.status === 400) { diff --git a/src/components/Nav/AuthModal/AuthModalHeader/AuthModalHeader.tsx b/src/components/Nav/AuthModal/AuthModalHeader/AuthModalHeader.tsx index 24991c8d..5aeff24a 100644 --- a/src/components/Nav/AuthModal/AuthModalHeader/AuthModalHeader.tsx +++ b/src/components/Nav/AuthModal/AuthModalHeader/AuthModalHeader.tsx @@ -16,7 +16,7 @@ export const AuthModalHeader = (props: Props) => { const generateModalTextsFromSource = ( modalType: 'login' | 'register' ): { title: string; description: string } => { - const title = modalType === 'login' ? 'Enter the Discours' : 'Create account' + const title = modalType === 'login' ? 'Welcome to Discours' : 'Create account' switch (source) { case 'create': { diff --git a/src/components/Nav/AuthModal/SocialProviders.tsx b/src/components/Nav/AuthModal/SocialProviders.tsx index b0577ed2..e23f9dfa 100644 --- a/src/components/Nav/AuthModal/SocialProviders.tsx +++ b/src/components/Nav/AuthModal/SocialProviders.tsx @@ -19,7 +19,7 @@ export const SocialProviders = () => { const { t } = useLocalize() return (
-
{t('Or continue with social network')}
+
{t('or sign in with social networks')}
handleSocialAuthLinkClick(event, 'facebook')}> diff --git a/src/components/Nav/Header/Header.tsx b/src/components/Nav/Header/Header.tsx index 786c0965..4ce186bd 100644 --- a/src/components/Nav/Header/Header.tsx +++ b/src/components/Nav/Header/Header.tsx @@ -189,7 +189,7 @@ export const Header = (props: Props) => { onMouseOut={() => hideSubnavigation} routeName="home" active={isZineVisible()} - body={t('zine')} + body={t('journal')} /> toggleSubnavigation(true, setIsFeedVisible)} @@ -341,16 +341,16 @@ export const Header = (props: Props) => { >
  • - Манифест + {t('Manifesto')}
  • - Догма + {t('Dogma')}
  • - Принципы сообщества + {t('Community Principles')}
  • - Гид по дискурсу + {t('Platform Guide')}
  • {t('Support us')} diff --git a/src/components/Topic/Card.tsx b/src/components/Topic/Card.tsx index ca2e98bd..da355cf5 100644 --- a/src/components/Topic/Card.tsx +++ b/src/components/Topic/Card.tsx @@ -151,7 +151,7 @@ export const TopicCard = (props: TopicProps) => { {t('Unfollow')} - {t('You are subscribed')} + {t('Following')} diff --git a/src/components/Topic/TopicBadge/TopicBadge.tsx b/src/components/Topic/TopicBadge/TopicBadge.tsx index 45c603de..b7fc5d66 100644 --- a/src/components/Topic/TopicBadge/TopicBadge.tsx +++ b/src/components/Topic/TopicBadge/TopicBadge.tsx @@ -90,7 +90,7 @@ export const TopicBadge = (props: Props) => { onClick={() => subscribe(false)} variant="bordered" size="S" - value={t('You are subscribed')} + value={t('Following')} class={styles.subscribeButton} /> diff --git a/src/pages/profile/profileSettings.page.tsx b/src/pages/profile/profileSettings.page.tsx index eddb61d0..478ae5d6 100644 --- a/src/pages/profile/profileSettings.page.tsx +++ b/src/pages/profile/profileSettings.page.tsx @@ -180,13 +180,13 @@ export const ProfileSettingsPage = () => { maxLength={120} /> -

    {t('About myself')}

    +

    {t('About')}

    updateFormField('about', value)} /> From d7d1c41d8586972f61a7a2acaabed8bc15f70e31 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:31:10 +0300 Subject: [PATCH 7/7] Conditional stat (#263) Show when={author()} in profile --- public/locales/ru/translation.json | 2 +- src/components/Views/Author/Author.tsx | 85 ++++++++++++++------------ 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 5db90ec4..2a983fa3 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -203,7 +203,7 @@ "Manifesto": "Манифест", "Many files, choose only one": "Много файлов, выберете один", "Material card": "Карточка материала", - "Message": "Сообщение", + "Message": "Написать", "More": "Ещё", "Most commented": "Комментируемое", "Most read": "Читаемое", diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index 652bb8d8..d9ff4217 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -19,6 +19,7 @@ import { AuthorRatingControl } from '../../Author/AuthorRatingControl' import { hideModal } from '../../../stores/ui' import { getPagePath } from '@nanostores/router' import { useSession } from '../../../context/session' +import { Loading } from '../../_shared/Loading' type Props = { shouts: Shout[] @@ -125,47 +126,51 @@ export const AuthorView = (props: Props) => { return (
    - -
    - -
    -
    -
    - -
    -
    - {t('Karma')} - + }> + <> +
    +
    -
    -
    + + +