From db5500cbe83ccc7798e9e9a62262f53e1a62393b Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Mon, 4 Dec 2023 11:38:26 +0100 Subject: [PATCH] Merge pull request #15917 from overleaf/msm-new-notification-common [web] new notification style for dashboard common.tsx GitOrigin-RevId: e80d1c754d850ad3e8a48cc6871c2d98bcaba452 --- .../notifications/groups/common.tsx | 270 ++++++++++-------- 1 file changed, 144 insertions(+), 126 deletions(-) diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx index d374b57cf7..26ada1886c 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/common.tsx @@ -62,9 +62,11 @@ function CommonNotification({ notification }: CommonNotificationProps) { return ( <> {templateKey === 'notification_project_invite' ? ( - id && handleDismiss(id)}> - - {accepted ? ( + id && handleDismiss(id)} + body={ + accepted ? ( }} @@ -83,10 +85,10 @@ function CommonNotification({ notification }: CommonNotificationProps) { shouldUnescape tOptions={{ interpolation: { escapeValue: true } }} /> - )} - - - {accepted ? ( + ) + } + action={ + accepted ? ( - - + } + /> ) : templateKey === 'notification_ip_matched_affiliation' ? ( - id && handleDismiss(id)}> - - ]} // eslint-disable-line react/jsx-key - values={{ - institutionName: notification.messageOpts.university_name, - }} - shouldUnescape - tOptions={{ interpolation: { escapeValue: true } }} - /> -
- {notification.messageOpts.ssoEnabled ? ( - <> - ]} // eslint-disable-line react/jsx-key - /> -
- {t('link_institutional_email_get_started')}{' '} - - {t('find_out_more_nt')} - - - ) : ( - <> - ]} // eslint-disable-line react/jsx-key - values={{ - institutionName: notification.messageOpts.university_name, - }} - shouldUnescape - tOptions={{ interpolation: { escapeValue: true } }} - /> -
- {t('add_email_to_claim_features')} - - )} -
- + id && handleDismiss(id)} + body={ + <> + ]} // eslint-disable-line react/jsx-key + values={{ + institutionName: notification.messageOpts.university_name, + }} + shouldUnescape + tOptions={{ interpolation: { escapeValue: true } }} + /> +
+ {notification.messageOpts.ssoEnabled ? ( + <> + ]} // eslint-disable-line react/jsx-key + /> +
+ {t('link_institutional_email_get_started')}{' '} + + {t('find_out_more_nt')} + + + ) : ( + <> + ]} // eslint-disable-line react/jsx-key + values={{ + institutionName: notification.messageOpts.university_name, + }} + shouldUnescape + tOptions={{ interpolation: { escapeValue: true } }} + /> +
+ {t('add_email_to_claim_features')} + + )} + + } + action={ -
-
+ } + /> ) : templateKey === 'notification_dropbox_duplicate_project_names' ? ( id && handleDismiss(id)} - > - -

- ]} // eslint-disable-line react/jsx-key - values={{ projectName: notification.messageOpts.projectName }} - shouldUnescape - tOptions={{ interpolation: { escapeValue: true } }} - /> -

-

- ]} // eslint-disable-line react/jsx-key - />{' '} - - {t('learn_more')} - - . -

-
-
+ body={ + <> +

+ ]} // eslint-disable-line react/jsx-key + values={{ projectName: notification.messageOpts.projectName }} + shouldUnescape + tOptions={{ interpolation: { escapeValue: true } }} + /> +

+

+ ]} // eslint-disable-line react/jsx-key + />{' '} + + {t('learn_more')} + + . +

+ + } + /> ) : templateKey === 'notification_dropbox_unlinked_due_to_lapsed_reconfirmation' ? ( - id && handleDismiss(id)}> - - ]} // eslint-disable-line react/jsx-key - />{' '} - {user.features?.dropbox ? ( + id && handleDismiss(id)} + body={ + <> ]} - /> - ) : ( - t('confirm_affiliation_to_relink_dropbox') - )}{' '} - - {t('learn_more')} - - - + i18nKey="dropbox_unlinked_premium_feature" + components={[]} // eslint-disable-line react/jsx-key + />{' '} + {user.features?.dropbox ? ( + ]} + /> + ) : ( + t('confirm_affiliation_to_relink_dropbox') + )}{' '} + + {t('learn_more')} + + + } + /> ) : templateKey === 'notification_group_invitation' ? ( ) : templateKey === 'notification_personal_and_group_subscriptions' ? ( id && handleDismiss(id)} - > - + body={ , ]} /> - - + } + /> ) : ( - id && handleDismiss(id)}> - {html} - + id && handleDismiss(id)} + body={html} + /> )} )