Skip to content

Commit

Permalink
fixing notification types
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Grato committed Aug 1, 2023
1 parent 88a0389 commit 2521bba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/Notification/CrumbMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { ForwardedRef, useCallback, forwardRef } from 'react';
import styles from './CrumbMessage.module.scss';
import { NotificationTypesE } from './types';
import { NotificationTypesT } from './types';
import Icon, { IconT } from '../Icon';
import { CustomIcon } from './icons';
import NotificationIcon from './NotificationIcon';

export type CrumbPropsT = {
description: string;
type?: NotificationTypesE;
type?: NotificationTypesT;
hasIcon?: boolean;
icon?: IconT;
mouseEnter: () => void;
Expand All @@ -20,7 +20,7 @@ const CrumbMessage = forwardRef(
(
{
description,
type = NotificationTypesE.SUCCESS,
type = 'success',
hasIcon = false,
icon,
mouseEnter,
Expand Down
12 changes: 6 additions & 6 deletions src/components/Notification/NotificationIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React from 'react';
import { NotificationTypesE } from './types';
import { NotificationTypesT } from './types';
import { InfoIcon, SuccessIcon, WarningIcon, ErrorIcon } from './icons';

type NotificationIconPropsT = {
type: NotificationTypesE;
type: NotificationTypesT;
classProp?: string;
};

const NotificationIcon = ({ type, classProp }: NotificationIconPropsT) => {
switch (type) {
case NotificationTypesE.INFO:
case 'info':
return <InfoIcon classProp={classProp} />;
case NotificationTypesE.SUCCESS:
case 'success':
return <SuccessIcon classProp={classProp} />;
case NotificationTypesE.WARNING:
case 'warning':
return <WarningIcon classProp={classProp} />;
case NotificationTypesE.ERROR:
case 'error':
return <ErrorIcon classProp={classProp} />;
default:
return <InfoIcon classProp={classProp} />;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Notification/ToastMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { useCallback, forwardRef, ForwardedRef, ReactNode } from 'react';
import styles from './ToastMessage.module.scss';
import Button from '../Button';
import { NotificationTypesE } from './types';
import { NotificationTypesT } from './types';
import NotificationIcon from './NotificationIcon';

export type ToastPropsT = {
title: string;
description: string;
callback?: Function;
callbackCta?: string;
type?: NotificationTypesE;
type?: NotificationTypesT;
mouseEnter: () => void;
mouseLeave: () => void;
close: () => void;
Expand All @@ -24,7 +24,7 @@ const ToastMessage = forwardRef(
description,
callback,
callbackCta = 'Confirm',
type = NotificationTypesE.SUCCESS,
type = 'success',
mouseEnter,
mouseLeave,
close,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Notification/icons/CustomIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import Icon, { IconT } from '../../Icon';
import { NotificationTypesE } from '../types';
import { NotificationTypesT } from '../types';
import styles from './icon.module.scss';

type InfoIconPropsT = {
icon: IconT;
type: NotificationTypesE;
type: NotificationTypesT;
classProp?: string;
};

Expand Down

0 comments on commit 2521bba

Please sign in to comment.