Skip to content

Commit

Permalink
fix: anotify add message
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuangs committed Aug 15, 2024
1 parent a6db76c commit db3f1cb
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 86 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bytetrade/ui",
"version": "0.1.16",
"version": "0.1.17",
"private": false,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
158 changes: 84 additions & 74 deletions packages/notify/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Notify, QSpinner } from "quasar";
import { NotifyDefinedType, BtNotifyProps } from "./type";
import { Notify, QSpinner } from 'quasar';
import { NotifyDefinedType, BtNotifyProps } from './type';

const BtNotify: BtNotifyProps = {
alwaysShow: null,
notify: Notify,
notify: Notify,
async show(props: any): Promise<void> {
if (!this.notify) {
this.init(Notify)
}
if (!this.notify) {
this.init(Notify);
}
if (props.closeTimeout) {
this.alwaysShow = this.notify?.create({
...props
Expand All @@ -25,79 +25,89 @@ const BtNotify: BtNotifyProps = {
},

async init(notify?: Notify): Promise<void> {
if (!notify) {
return
}
this.notify = notify;
notify.registerType(NotifyDefinedType.LOGIN_NOTIFY, {
position: "bottom",
html: true,
timeout: 0,
color: "transparent",
textColor: "warning",
classes: "login-notification-add",
icon: "sym_r_cancel"
});
if (!notify) {
return;
}
this.notify = notify;
notify.registerType(NotifyDefinedType.LOGIN_NOTIFY, {
position: 'bottom',
html: true,
timeout: 0,
color: 'transparent',
textColor: 'warning',
classes: 'login-notification-add',
icon: 'sym_r_cancel'
});

notify.registerType(NotifyDefinedType.SUCCESS, {
position: 'bottom',
html: true,
timeout: 0,
color: 'white',
textColor: 'positive',
classes: 'success-notify-class',
icon: 'sym_r_check_circle',
group: false
});

notify.registerType(NotifyDefinedType.SUCCESS, {
position: "bottom",
html: true,
timeout: 0,
color: "white",
textColor: "positive",
classes: "success-notify-class",
icon: "sym_r_check_circle",
group: false
});
notify.registerType(NotifyDefinedType.FAILED, {
position: 'bottom',
html: true,
timeout: 0,
color: 'white',
textColor: 'negative',
classes: 'failed-notify-class',
icon: 'sym_r_cancel',
group: false
});

notify.registerType(NotifyDefinedType.FAILED, {
position: "bottom",
html: true,
timeout: 0,
color: "white",
textColor: "negative",
classes: "failed-notify-class",
icon: "sym_r_cancel",
group: false
});
notify.registerType(NotifyDefinedType.WARNING, {
position: 'bottom',
html: true,
timeout: 0,
color: 'white',
textColor: 'warning',
classes: 'warning-notify-class',
icon: 'sym_r_error',
group: false
});

notify.registerType(NotifyDefinedType.WARNING, {
position: "bottom",
html: true,
timeout: 0,
color: "white",
textColor: "warning",
classes: "warning-notify-class",
icon: "sym_r_error",
group: false
});
notify.registerType(NotifyDefinedType.LOADING, {
position: 'bottom',
html: true,
timeout: 0,
color: 'white',
textColor: 'grey-8',
classes: 'loading-notify-class',
spinner: QSpinner,
spinnerSize: 'xs',
spinnerColor: 'grey-8',
group: false
});

notify.registerType(NotifyDefinedType.LOADING, {
position: "bottom",
html: true,
timeout: 0,
color: "white",
textColor: "grey-8",
classes: "loading-notify-class",
spinner: QSpinner,
spinnerSize: "xs",
spinnerColor: "grey-8",
group: false
});
notify.registerType(NotifyDefinedType.PROGRESS, {
position: 'bottom',
html: true,
timeout: 0,
color: 'white',
textColor: 'info',
classes: 'progress-notify-class',
spinner: QSpinner,
spinnerSize: 'sm',
spinnerColor: 'info',
group: false
});

notify.registerType(NotifyDefinedType.PROGRESS, {
position: "bottom",
html: true,
timeout: 0,
color: "white",
textColor: "info",
classes: "progress-notify-class",
spinner: QSpinner,
spinnerSize: "sm",
spinnerColor: "info",
group: false
});
notify.registerType(NotifyDefinedType.MESSAGE, {
position: 'bottom',
html: true,
timeout: 0,
color: 'white',
textColor: 'grey-8',
classes: 'loading-notify-class',
group: false
});
}
};

export default BtNotify;
export default BtNotify;
22 changes: 11 additions & 11 deletions packages/notify/type.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export enum NotifyDefinedType {
DEFAULT = "bt-default",
LOGIN_NOTIFY = "bt-login",
POSITIVE = "bt-positive",
SUCCESS = "bt-success",
FAILED = "bt-failed",
WARNING = "bt-warning",
LOADING = "bt-loading",
PROGRESS = "bt-progress"
DEFAULT = 'bt-default',
LOGIN_NOTIFY = 'bt-login',
POSITIVE = 'bt-positive',
SUCCESS = 'bt-success',
FAILED = 'bt-failed',
WARNING = 'bt-warning',
LOADING = 'bt-loading',
PROGRESS = 'bt-progress',
MESSAGE = 'bt-message'
}


export interface BtNotifyProps {
alwaysShow: any;
show: any;
hide: any;
init(notify: any): void;
notify: any;
init(notify: any): void;
notify: any;
}

0 comments on commit db3f1cb

Please sign in to comment.