diff --git a/package-lock.json b/package-lock.json
index 06509ac4..4553ab3a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,6 +13,7 @@
"i18next": "22.4.15",
"i18next-icu": "2.3.0",
"intl-messageformat": "10.5.3",
+ "just-throttle": "4.2.0",
"mailgun.js": "8.2.1",
"node-fetch": "3.3.1"
},
@@ -13168,6 +13169,11 @@
"node": ">=4.0"
}
},
+ "node_modules/just-throttle": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/just-throttle/-/just-throttle-4.2.0.tgz",
+ "integrity": "sha512-/iAZv1953JcExpvsywaPKjSzfTiCLqeguUTE6+VmK15mOcwxBx7/FHrVvS4WEErMR03TRazH8kcBSHqMagYIYg=="
+ },
"node_modules/kebab-case": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/kebab-case/-/kebab-case-1.0.2.tgz",
@@ -28106,6 +28112,11 @@
"object.values": "^1.1.6"
}
},
+ "just-throttle": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/just-throttle/-/just-throttle-4.2.0.tgz",
+ "integrity": "sha512-/iAZv1953JcExpvsywaPKjSzfTiCLqeguUTE6+VmK15mOcwxBx7/FHrVvS4WEErMR03TRazH8kcBSHqMagYIYg=="
+ },
"kebab-case": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/kebab-case/-/kebab-case-1.0.2.tgz",
diff --git a/package.json b/package.json
index e6d3f2bb..7de87825 100644
--- a/package.json
+++ b/package.json
@@ -33,6 +33,7 @@
"i18next": "22.4.15",
"i18next-icu": "2.3.0",
"intl-messageformat": "10.5.3",
+ "just-throttle": "4.2.0",
"mailgun.js": "8.2.1",
"node-fetch": "3.3.1"
},
diff --git a/public/icons/key.svg b/public/icons/key.svg
new file mode 100644
index 00000000..11d788ca
--- /dev/null
+++ b/public/icons/key.svg
@@ -0,0 +1,4 @@
+
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json
index d277ae8c..577ddfcf 100644
--- a/public/locales/en/translation.json
+++ b/public/locales/en/translation.json
@@ -28,6 +28,8 @@
"All posts": "All posts",
"All topics": "All topics",
"Almost done! Check your email.": "Almost done! Just checking your email.",
+ "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?",
"Art": "Art",
"Artist": "Artist",
@@ -100,6 +102,7 @@
"Discussion rules": "Discussion rules",
"Discussions": "Discussions",
"Dogma": "Dogma",
+ "Draft successfully deleted": "Draft successfully deleted",
"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.",
@@ -193,6 +196,7 @@
"Manifesto": "Manifesto",
"Many files, choose only one": "Many files, choose only one",
"Material card": "Material card",
+ "Message": "Message",
"More": "More",
"Most commented": "Commented",
"Most read": "Readable",
@@ -206,12 +210,19 @@
"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}}",
+
+ "NotificationNewCommentText1": "{commentsCount, plural, one {New comment} other {{commentsCount} comments}} to your publication",
+ "NotificationNewCommentText2": "from",
+ "NotificationNewCommentText3": "{restUsersCount, plural, =0 {} one { one more user} other { and more {restUsersCount} users}}",
+
+ "NotificationNewReplyText1": "{commentsCount, plural, one {New reply} other {{commentsCount} replays}} to your publication",
+ "NotificationNewReplyText2": "from",
+ "NotificationNewReplyText3": "{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",
- "No such account, please try to register": "No such account found, please try to register",
+ "No notifications yet": "No notifications yet",
+ "Write good articles, comment\nand it won't be so empty here": "Write good articles, comment\nand it won't be so empty here",
"Nothing here yet": "There's nothing here yet",
"Nothing is here": "There is nothing here",
"Notifications": "Notifications",
@@ -353,7 +364,6 @@
"Where": "From",
"Words": "Слов",
"Work with us": "Cooperate with Discourse",
- "Message": "Message",
"Write a comment...": "Write a comment...",
"Write a short introduction": "Write a short introduction",
"Write about the topic": "Write about the topic",
diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json
index 2a983fa3..b8f5d551 100644
--- a/public/locales/ru/translation.json
+++ b/public/locales/ru/translation.json
@@ -31,6 +31,8 @@
"All posts": "Все публикации",
"All topics": "Все темы",
"Almost done! Check your email.": "Почти готово! Осталось подтвердить вашу почту.",
+ "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?": "Вы уверены, что хотите продолжить?",
"Art": "Искусство",
"Artist": "Исполнитель",
@@ -104,6 +106,7 @@
"Discussion rules": "Правила сообществ самиздата в соцсетях",
"Discussions": "Дискуссии",
"Dogma": "Догма",
+ "Draft successfully deleted": "Черновик успешно удален",
"Drafts": "Черновики",
"Drag the image to this area": "Перетащите изображение в эту область",
"Each image must be no larger than 5 MB.": "Каждое изображение должно быть размером не больше 5 мб.",
@@ -217,11 +220,19 @@
"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} пользователей}}",
+
+ "NotificationNewCommentText1": "{commentsCount, plural, one {Новый комментарий} few {{commentsCount} новых комментария} other {{commentsCount} новых комментариев}} к вашей публикации",
+ "NotificationNewCommentText2": "от",
+ "NotificationNewCommentText3": "{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}",
+
+ "NotificationNewReplyText1": "{commentsCount, plural, one {Новый ответ} few {{commentsCount} новых ответа} other {{commentsCount} новых ответов}} на ваш комментарий к публикации",
+ "NotificationNewReplyText2": "от",
+ "NotificationNewReplyText3": "{restUsersCount, plural, =0 {} one { и ещё 1 пользователя} few { и ещё {restUsersCount} пользователей} other { и ещё {restUsersCount} пользователей}}",
+
"Newsletter": "Рассылка",
"Night mode": "Ночная тема",
- "No notifications, yet": "Тут пока пусто",
+ "No notifications yet": "Уведомлений пока нет",
+ "Write good articles, comment\nand it won't be so empty here": "Пишите хорошие статьи, комментируйте,\nи здесь станет не так пусто",
"No such account, please try to register": "Такой адрес не найден, попробуйте зарегистрироваться",
"Nothing here yet": "Здесь пока ничего нет",
"Nothing is here": "Здесь ничего нет",
diff --git a/src/components/Article/Comment.module.scss b/src/components/Article/Comment.module.scss
index 58f775ab..eb8eea1b 100644
--- a/src/components/Article/Comment.module.scss
+++ b/src/components/Article/Comment.module.scss
@@ -1,5 +1,5 @@
.comment {
- margin: 0.5em 0;
+ margin: 0 0 0.5em;
padding: 1rem;
transition: background-color 0.3s;
position: relative;
diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx
index 35788445..3405b49b 100644
--- a/src/components/Article/Comment.tsx
+++ b/src/components/Article/Comment.tsx
@@ -62,7 +62,12 @@ export const Comment = (props: Props) => {
const remove = async () => {
if (comment()?.id) {
try {
- const isConfirmed = await showConfirm()
+ const isConfirmed = await showConfirm({
+ confirmBody: t('Are you sure you want to delete this comment?'),
+ confirmButtonLabel: t('Delete'),
+ confirmButtonVariant: 'danger',
+ declineButtonVariant: 'primary'
+ })
if (isConfirmed) {
await deleteReaction(comment().id)
@@ -136,7 +141,7 @@ export const Comment = (props: Props) => {
})}
/>
- {comment()?.shout.title || ''}
+ {comment()?.shout.title || ''}
}
@@ -174,7 +179,7 @@ export const Comment = (props: Props) => {
{confirmMessage().confirmBody ?? t('Are you sure you want to to proceed the action?')}