1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 10:22:46 +00:00

[dir view, toast] redesigned the 'converting' tip for md & sdoc file … (#5822)

* [dir view, toast] redesigned the 'converting' tip for md & sdoc file items; added a new type of toast

* [toast] updated the loading icon of the 'notify-in-progress' toast
This commit is contained in:
llj
2023-12-11 18:19:23 +08:00
committed by GitHub
parent 7efe677798
commit 8712b7d1a6
6 changed files with 9 additions and 43 deletions

View File

@@ -78,6 +78,8 @@ class Alert extends React.PureComponent {
return { borderStyle: this.containerBorderWarn, iconColor: css({color: 'rgb(217, 130, 43)'}) , iconClass: 'fa fa-exclamation-triangle' };
case 'none':
return { borderStyle: this.containerBorderNotify, iconColor: css({color: 'rgb(16, 112, 202)'}), iconClass: 'fa fa-exclamation-circle' };
case 'notify-in-progress':
return { borderStyle: this.containerBorderNotify, iconColor: css({width: '15px', height: '15px', margin: '3px'}), iconClass: 'loading-icon' };
case 'danger':
return { borderStyle: this.containerBorderDanger, iconColor: css({color: 'rgb(236, 76, 71)'}), iconClass: 'fa fa-exclamation-circle' };
}

View File

@@ -67,7 +67,7 @@ export default class Toast extends React.PureComponent {
/**
* The type of the alert.
*/
intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']).isRequired,
intent: PropTypes.oneOf(['none', 'notify-in-progress', 'success', 'warning', 'danger']).isRequired,
/**
* The title of the alert.

View File

@@ -51,6 +51,10 @@ export default class Toaster {
return this.notifyHandler(title, { ...settings, intent: 'none' });
};
notifyInProgress = (title, settings = {}) => {
return this.notifyHandler(title, { ...settings, intent: 'notify-in-progress' });
};
success = (title, settings = {}) => {
return this.notifyHandler(title, { ...settings, intent: 'success' });
};