Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: followers notification #1789

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -619,19 +619,35 @@ export const useNotificationList = (
id: notification.id,
type: NotificationType.VOTE_COUNT,
read: notification.read,
userId: notification.fromUserId.id,
user: notification.fromUserId.name,
user: i18n.t('Notification.Header.Upvote'),
avatar: 'default',
description: i18n.t('Notification.Description.Upvote', {
amount: notification.message ?? 0,
}),
badge: null,
createdAt: notification.createdAt,
href: notification.additionalReferenceId
href: notification.referenceId
? `/post/${notification.referenceId}`
: `/404`,
};

case NotificationType.FOLLOWER_COUNT:
return {
id: notification.id,
type: NotificationType.FOLLOWER_COUNT,
read: notification.read,
user: i18n.t('Notification.Header.Follower'),
avatar: 'default',
description: i18n.t('Notification.Description.Follower', {
amount: notification.message ?? 0,
}),
badge: null,
createdAt: notification.createdAt,
href: notification.referenceId
? `/experience/${notification.referenceId}`
: `/404`,
};

default:
return {
id: notification.id,
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export enum NotificationType {
USER_BANNED = 'user_banned',
PAID_CONTENT = 'paid_content',
VOTE_COUNT = 'vote_count',
FOLLOWER_COUNT = 'follower_count',
}

export type UserReference = {
Expand Down
7 changes: 5 additions & 2 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,9 @@
"Post_Removed": "Post removed",
"Reward": "Tips reward",
"Claimed": "Tips claimed",
"Tips_received": "Tips received"
"Tips_received": "Tips received",
"Upvote": "New Upvotes",
"Follower": "New Follower"
},
"Description": {
"Friend_Accept": "Accepted your friend request",
Expand All @@ -909,7 +911,8 @@
"Connect_Socmed": "Your {{platform}} account @{{username}} successfully connected to Myriad",
"Disconnect_Socmed": "Your {{platform}} account @{{username}} successfully disconnected from @{{user}} Myriad account.",
"UnlockedContent": "Unlocked your exclusive content.",
"Upvote": "Your post is getting {{amount}} upvotes"
"Upvote": "Your post is getting {{amount}} upvotes",
"Follower": "Your timeline is getting {{amount}} followers"
},
"Footer": {
"View": "View all notifications"
Expand Down
7 changes: 5 additions & 2 deletions src/locale/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,9 @@
"Post_Removed": "Pos dihapus",
"Reward": "Hadiah tip",
"Claimed": "Tip diklaim",
"Tips_received": "Tips diterima"
"Tips_received": "Tips diterima",
"Upvote": "Upvote Baru",
"Follower": "Pengikut Baru"
},
"Description": {
"Friend_Accept": "Menerima permintaan pertemanan Anda",
Expand All @@ -905,7 +907,8 @@
"Connect_Socmed": "Akun {{platform}} Anda @{{username}} berhasil terhubung ke Myriad",
"Disconnect_Socmed": "Akun {{platform}} Anda @{{username}} berhasil diputuskan dari Myriad oleh @{{user}}",
"UnlockedContent": "Membuka kunci konten eksklusif Anda.",
"Upvote": "Postingan anda mendapat {{amount}} upvotes"
"Upvote": "Postingan anda mendapat {{amount}} upvote",
"Follower": "Linimasa anda mendapat {{amount}} pengikut"
},
"Footer": {
"View": "Lihat semua notifikasi"
Expand Down
7 changes: 5 additions & 2 deletions src/locale/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,9 @@
"Post_Removed": "Пост удален",
"Reward": "Вознаграждение",
"Claimed": "Заявленные чаевые",
"Tips_received": "Полученные чаевые"
"Tips_received": "Полученные чаевые",
"Upvote": "New Upvotes",
"Follower": "New Follower"
},
"Description": {
"Friend_Accept": "Принятые заявки в друзья",
Expand All @@ -897,7 +899,8 @@
"Connect_Socmed": "Ваш аккаунт {{platform}} @{{username}} успешно объединены в Myriad",
"Disconnect_Socmed": "Ваш аккаунт {{platform}} @{{username}} успешно отсоединены от Myriad пользователем @{{user}}",
"UnlockedContent": "Unlocked your exclusive content.",
"Upvote": "Your post is getting {{amount}} upvotes"
"Upvote": "Your post is getting {{amount}} upvotes",
"Follower": "Your timeline is getting {{amount}} followers"
},
"Footer": {
"View": "Посмотреть все уведомления"
Expand Down