-
Notifications
You must be signed in to change notification settings - Fork 32
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 #268 from GusBaamonde/show_upgrade_or_trial_bell
feat: add notifications
- Loading branch information
Showing
8 changed files
with
64 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
const Notifications = ({ plan, notifications, emptyNotificationText }) => { | ||
// check if we're always going to show notifications | ||
const showNotifications = plan.isFreeAccount && notifications.length; | ||
const dataCountAttr = showNotifications ? { 'data-count': notifications.length } : {}; | ||
return ( | ||
<> | ||
<span className="user-menu--open active" {...dataCountAttr}> | ||
<span className="ms-icon icon-notification"></span> | ||
</span> | ||
<div className="user-menu helper--right dp-notifications"> | ||
<div className="dp-msj-notif"> | ||
{!showNotifications ? ( | ||
<i> | ||
{emptyNotificationText ? ( | ||
emptyNotificationText | ||
) : ( | ||
<FormattedMessage id="empty_notification_text" /> | ||
)} | ||
</i> | ||
) : ( | ||
<div dangerouslySetInnerHTML={{ __html: notifications[0] }} /> | ||
)} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Notifications; |
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