Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/core/models/snackbar-properties.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface SnackbarProperties {
data: {
icon: string;
showCloseButton: boolean;
messageType: 'success' | 'failure' | 'information';
message: string;
redirectionText?: string;
};
Expand Down
7 changes: 5 additions & 2 deletions src/app/core/services/snackbar-properties.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ export class SnackbarPropertiesService {
): SnackbarProperties {
if (!snackbarIcon) {
if (toastMessageType === 'success') {
snackbarIcon = 'check-square-fill';
snackbarIcon = 'success-toast-icon';
} else if (toastMessageType === 'failure') {
snackbarIcon = 'warning-fill';
snackbarIcon = 'failure-toast-icon';
} else if (toastMessageType === 'information') {
snackbarIcon = 'info-toast-icon';
}
}
return {
data: {
icon: snackbarIcon,
showCloseButton: true,
messageType: toastMessageType,
...toastMessageData,
},
duration: 3000,
Expand Down
6 changes: 1 addition & 5 deletions src/app/fyle/my-profile/my-profile.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,8 @@ export class MyProfilePage {

showToastMessage(message: string, type: 'success' | 'failure'): void {
const panelClass = type === 'success' ? 'msb-success' : 'msb-failure';
let snackbarIcon: string;
if (message.toLowerCase().includes('copied')) {
snackbarIcon = 'check-circle-outline';
}
this.matSnackBar.openFromComponent(ToastMessageComponent, {
...this.snackbarProperties.setSnackbarProperties(type, { message }, snackbarIcon),
...this.snackbarProperties.setSnackbarProperties(type, { message }),
panelClass,
});
this.trackingService.showToastMessage({ ToastContent: message });
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading