mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #15917 from overleaf/msm-new-notification-common
[web] new notification style for dashboard common.tsx GitOrigin-RevId: e80d1c754d850ad3e8a48cc6871c2d98bcaba452
This commit is contained in:
parent
b61f34c740
commit
db5500cbe8
1 changed files with 144 additions and 126 deletions
|
@ -62,9 +62,11 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
return (
|
||||
<>
|
||||
{templateKey === 'notification_project_invite' ? (
|
||||
<Notification bsStyle="info" onDismiss={() => id && handleDismiss(id)}>
|
||||
<Notification.Body>
|
||||
{accepted ? (
|
||||
<Notification
|
||||
bsStyle="info"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
body={
|
||||
accepted ? (
|
||||
<Trans
|
||||
i18nKey="notification_project_invite_accepted_message"
|
||||
components={{ b: <b /> }}
|
||||
|
@ -83,10 +85,10 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
shouldUnescape
|
||||
tOptions={{ interpolation: { escapeValue: true } }}
|
||||
/>
|
||||
)}
|
||||
</Notification.Body>
|
||||
<Notification.Action>
|
||||
{accepted ? (
|
||||
)
|
||||
}
|
||||
action={
|
||||
accepted ? (
|
||||
<Button
|
||||
bsStyle="info"
|
||||
bsSize="sm"
|
||||
|
@ -110,17 +112,21 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
t('join_project')
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
</Notification.Action>
|
||||
</Notification>
|
||||
)
|
||||
}
|
||||
/>
|
||||
) : templateKey === 'wfh_2020_upgrade_offer' ? (
|
||||
<Notification bsStyle="info" onDismiss={() => id && handleDismiss(id)}>
|
||||
<Notification.Body>
|
||||
<Notification
|
||||
bsStyle="info"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
body={
|
||||
<>
|
||||
Important notice: Your free WFH2020 upgrade came to an end on June
|
||||
30th 2020. We're still providing a number of special initiatives to
|
||||
help you continue collaborating throughout 2020.
|
||||
</Notification.Body>
|
||||
<Notification.Action>
|
||||
30th 2020. We're still providing a number of special initiatives
|
||||
to help you continue collaborating throughout 2020.
|
||||
</>
|
||||
}
|
||||
action={
|
||||
<Button
|
||||
bsStyle="info"
|
||||
bsSize="sm"
|
||||
|
@ -129,11 +135,14 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
>
|
||||
View
|
||||
</Button>
|
||||
</Notification.Action>
|
||||
</Notification>
|
||||
}
|
||||
/>
|
||||
) : templateKey === 'notification_ip_matched_affiliation' ? (
|
||||
<Notification bsStyle="info" onDismiss={() => id && handleDismiss(id)}>
|
||||
<Notification.Body>
|
||||
<Notification
|
||||
bsStyle="info"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
body={
|
||||
<>
|
||||
<Trans
|
||||
i18nKey="looks_like_youre_at"
|
||||
components={[<b />]} // eslint-disable-line react/jsx-key
|
||||
|
@ -176,8 +185,9 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
{t('add_email_to_claim_features')}
|
||||
</>
|
||||
)}
|
||||
</Notification.Body>
|
||||
<Notification.Action>
|
||||
</>
|
||||
}
|
||||
action={
|
||||
<Button
|
||||
bsStyle="info"
|
||||
bsSize="sm"
|
||||
|
@ -192,20 +202,22 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
? t('link_account')
|
||||
: t('add_affiliation')}
|
||||
</Button>
|
||||
</Notification.Action>
|
||||
</Notification>
|
||||
}
|
||||
/>
|
||||
) : templateKey === 'notification_tpds_file_limit' ? (
|
||||
<Notification
|
||||
bsStyle="danger"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
>
|
||||
<Notification.Body>
|
||||
Error: Your project {notification.messageOpts.projectName} has gone
|
||||
over the 2000 file limit using an integration (e.g. Dropbox or
|
||||
GitHub) <br />
|
||||
Please decrease the size of your project to prevent further errors.
|
||||
</Notification.Body>
|
||||
<Notification.Action>
|
||||
body={
|
||||
<>
|
||||
Error: Your project {notification.messageOpts.projectName} has
|
||||
gone over the 2000 file limit using an integration (e.g. Dropbox
|
||||
or GitHub) <br />
|
||||
Please decrease the size of your project to prevent further
|
||||
errors.
|
||||
</>
|
||||
}
|
||||
action={
|
||||
<Button
|
||||
bsStyle="danger"
|
||||
bsSize="sm"
|
||||
|
@ -214,14 +226,14 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
>
|
||||
Account Settings
|
||||
</Button>
|
||||
</Notification.Action>
|
||||
</Notification>
|
||||
}
|
||||
/>
|
||||
) : templateKey === 'notification_dropbox_duplicate_project_names' ? (
|
||||
<Notification
|
||||
bsStyle="warning"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
>
|
||||
<Notification.Body>
|
||||
body={
|
||||
<>
|
||||
<p>
|
||||
<Trans
|
||||
i18nKey="dropbox_duplicate_project_names"
|
||||
|
@ -241,12 +253,16 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
</a>
|
||||
.
|
||||
</p>
|
||||
</Notification.Body>
|
||||
</Notification>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
) : templateKey ===
|
||||
'notification_dropbox_unlinked_due_to_lapsed_reconfirmation' ? (
|
||||
<Notification bsStyle="info" onDismiss={() => id && handleDismiss(id)}>
|
||||
<Notification.Body>
|
||||
<Notification
|
||||
bsStyle="info"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
body={
|
||||
<>
|
||||
<Trans
|
||||
i18nKey="dropbox_unlinked_premium_feature"
|
||||
components={[<b />]} // eslint-disable-line react/jsx-key
|
||||
|
@ -263,27 +279,29 @@ function CommonNotification({ notification }: CommonNotificationProps) {
|
|||
<a href="/learn/how-to/Institutional_Email_Reconfirmation">
|
||||
{t('learn_more')}
|
||||
</a>
|
||||
</Notification.Body>
|
||||
</Notification>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
) : templateKey === 'notification_group_invitation' ? (
|
||||
<GroupInvitationNotification notification={notification} />
|
||||
) : templateKey === 'notification_personal_and_group_subscriptions' ? (
|
||||
<Notification
|
||||
bsStyle="warning"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
>
|
||||
<Notification.Body>
|
||||
body={
|
||||
<Trans
|
||||
i18nKey="notification_personal_and_group_subscriptions"
|
||||
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
|
||||
components={[<strong />, <a href="/user/subscription" />]}
|
||||
/>
|
||||
</Notification.Body>
|
||||
</Notification>
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Notification bsStyle="info" onDismiss={() => id && handleDismiss(id)}>
|
||||
<Notification.Body>{html}</Notification.Body>
|
||||
</Notification>
|
||||
<Notification
|
||||
bsStyle="info"
|
||||
onDismiss={() => id && handleDismiss(id)}
|
||||
body={html}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue