diff --git a/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProjectUpdateNotification.tsx b/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProjectUpdateNotification.tsx new file mode 100644 index 00000000..6cb7175a --- /dev/null +++ b/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProjectUpdateNotification.tsx @@ -0,0 +1,70 @@ +import React from 'react' + +import NotificationItem from '../../NotificationItem' +import { + CommonNotificationProps, + GovernanceNewCommentOnProjectUpdateNotification +} from '../../types' +import NewCommentIcon from '../../../Icons/Notifications/NewCommentIcon' + +const i18N = { + en: { + description: (link: string): React.ReactNode => ( + <> + Engage in a productive conversation by replying to{' '} + + this comment + + . + + ), + title: 'New comment on your update for your project' + }, + es: { + description: (link: string): React.ReactNode => ( + <> + Participe en una conversación productiva respondiendo a{' '} + + este comentario + + . + + ), + title: 'Nuevo comentario en la actualización del proyecto' + }, + zh: { + description: (link: string): React.ReactNode => ( + <> + + 通过回复此评论 + + ,参与到富有成效的对话中。 + + ), + title: '您的更新收到了新评论' + } +} + +const GovernanceNewCommentOnProjectUpdateNotification = ({ + notification, + locale +}: CommonNotificationProps) => ( + }} + timestamp={notification.timestamp} + isNew={!notification.read} + locale={locale} + > +

+ {i18N[locale].title}{' '} + + {notification.metadata.proposalTitle} + +

+

+ {i18N[locale].description(notification.metadata.link)} +

+
+) + +export default GovernanceNewCommentOnProjectUpdateNotification diff --git a/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProposalNotification.tsx b/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProposalNotification.tsx index f848a540..d1dc75f5 100644 --- a/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProposalNotification.tsx +++ b/src/components/Notifications/NotificationTypes/Governance/GovernanceNewCommentOnProposalNotification.tsx @@ -30,7 +30,7 @@ const i18N = { . ), - title: 'Nuevo comentation en tu propuesta' + title: 'Nuevo comentario en tu propuesta' }, zh: { description: (link: string): React.ReactNode => ( diff --git a/src/components/Notifications/NotificationTypes/index.ts b/src/components/Notifications/NotificationTypes/index.ts index f2831cd2..e5becdf6 100644 --- a/src/components/Notifications/NotificationTypes/index.ts +++ b/src/components/Notifications/NotificationTypes/index.ts @@ -9,6 +9,7 @@ import GovernanceAnnouncementNotification from './Governance/GovernanceAnnouncem import GovernanceAuthoredProposalFinishedNotification from './Governance/GovernanceAuthoredProposalFinishedNotification' import GovernanceCoauthorRequestedNotification from './Governance/GovernanceCoauthorRequestedNotification' import GovernanceNewCommentOnProposalNotification from './Governance/GovernanceNewCommentOnProposalNotification' +import GovernanceNewCommentOnProjectUpdateNotification from './Governance/GovernanceNewCommentOnProjectUpdateNotification' import GovernanceProposalEnactedNotification from './Governance/GovernanceProposalEnactedNotification' import GovernanceVotingEndedVoterNotification from './Governance/GovernanceVotingEndedVoterNotification' import LandRentedNotification from './Land/LandRentedNotification' @@ -29,6 +30,7 @@ export { GovernanceAuthoredProposalFinishedNotification, GovernanceCoauthorRequestedNotification, GovernanceNewCommentOnProposalNotification, + GovernanceNewCommentOnProjectUpdateNotification, GovernanceProposalEnactedNotification, GovernanceVotingEndedVoterNotification, LandRentalEndedNotification, diff --git a/src/components/Notifications/Notifications.stories.tsx b/src/components/Notifications/Notifications.stories.tsx index cf88f07c..20b48c1b 100644 --- a/src/components/Notifications/Notifications.stories.tsx +++ b/src/components/Notifications/Notifications.stories.tsx @@ -10,6 +10,7 @@ import GovernanceAnnouncementNotification from './NotificationTypes/Governance/G import GovernanceAuthoredProposalFinishedNotification from './NotificationTypes/Governance/GovernanceAuthoredProposalFinishedNotification' import GovernanceCoauthorRequestedNotification from './NotificationTypes/Governance/GovernanceCoauthorRequestedNotification' import GovernanceNewCommentOnProposalNotification from './NotificationTypes/Governance/GovernanceNewCommentOnProposalNotification' +import GovernanceNewCommentOnProjectUpdateNotification from './NotificationTypes/Governance/GovernanceNewCommentOnProjectUpdateNotification' import GovernanceVotingEndedVoterNotification from './NotificationTypes/Governance/GovernanceVotingEndedVoterNotification' import GovernanceProposalEnactedNotification from './NotificationTypes/Governance/GovernanceProposalEnactedNotification' import { @@ -441,6 +442,25 @@ storiesOf('Notifications Toggle', module) updated_at: '2023-11-29T12:51:00.600Z' }} /> + +export type GovernanceNewCommentOnProjectUpdateNotification = + RawDecentralandNotification< + DecentralandNotificationType.GOVERNANCE_NEW_COMMENT_ON_PROJECT_UPDATE, + CommonGovernanceNotificationMetadata + > type GovernanceNotifications = | GovernanceAnnouncementNotification @@ -142,6 +148,7 @@ type GovernanceNotifications = | GovernanceAuthoredProposalFinishedNotification | GovernanceVotingEndedVoterNotification | GovernanceNewCommentOnProposalNotification + | GovernanceNewCommentOnProjectUpdateNotification // Worlds Notifications diff --git a/src/components/Notifications/utils.ts b/src/components/Notifications/utils.ts index 2afac2ca..cda1cd52 100644 --- a/src/components/Notifications/utils.ts +++ b/src/components/Notifications/utils.ts @@ -12,6 +12,7 @@ import { GovernanceAuthoredProposalFinishedNotification, GovernanceCoauthorRequestedNotification, GovernanceNewCommentOnProposalNotification, + GovernanceNewCommentOnProjectUpdateNotification, GovernanceProposalEnactedNotification, GovernanceVotingEndedVoterNotification, ItemSoldNotification, @@ -62,6 +63,8 @@ export const NotificationComponentByType: DecentralandNotificationComponentByTyp GovernanceAuthoredProposalFinishedNotification, [DecentralandNotificationType.GOVERNANCE_NEW_COMMENT_ON_PROPOSAL]: GovernanceNewCommentOnProposalNotification, + [DecentralandNotificationType.GOVERNANCE_NEW_COMMENT_ON_PROJECT_UPDATE]: + GovernanceNewCommentOnProjectUpdateNotification, [DecentralandNotificationType.GOVERNANCE_PROPOSAL_ENACTED]: GovernanceProposalEnactedNotification, [DecentralandNotificationType.GOVERNANCE_VOTING_ENDED_VOTER]: