-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from lyve-app/feat/notifications
refactor: added more attributes to notification
- Loading branch information
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { NotificationType } from "@prisma/client"; | ||
|
||
export const getNotificationsMessage = ( | ||
type: NotificationType, | ||
name: string | ||
): string => { | ||
const notificationsMessages: { [Key in NotificationType]: string[] } = { | ||
STREAM_STARTED: [ | ||
`Heads up! ${name} is live now. Join the stream and enjoy!`, | ||
`Tune in now! ${name} has just started streaming. Don’t miss out!`, | ||
`Alert! ${name} is live. Catch all the live action now!`, | ||
`${name} is streaming live. Click to join and watch the show!` | ||
], | ||
REWARD_RECEIVED: [ | ||
`You've received a reward from ${name}! Thanks for creating awesome content!`, | ||
`Amazing! ${name} just sent you a reward. Keep up the great work!`, | ||
`Wow! ${name} has rewarded you for your stream. Thank you for your efforts!`, | ||
`You've been rewarded by ${name}! Your content is truly appreciated.` | ||
], | ||
NEW_FOLLOWER: [ | ||
`${name} is now following you! Welcome them to your community.`, | ||
`Exciting news! ${name} just followed you. Say hello!`, | ||
`You have a new follower: ${name}. Thanks for growing your community!`, | ||
`${name} has joined your follower list. Keep engaging with your fans!` | ||
], | ||
ACHIEVEMENT_RECEIVED: [ | ||
`Fantastic! You've unlocked the ${name} achievement. Well done!`, | ||
`Achievement unlocked! You’ve earned ${name}. Keep it up!`, | ||
`Congrats! You've achieved ${name}. Your dedication is paying off!`, | ||
`You've earned the ${name} achievement. Great job and keep striving!` | ||
] | ||
}; | ||
|
||
const messages = notificationsMessages[type]; | ||
|
||
const randomIndex = Math.floor(Math.random() * messages.length); | ||
return messages[randomIndex]!; | ||
}; |