diff --git a/src/layout/notification-bubble/NotificationBubbleView.tsx b/src/layout/notification-bubble/NotificationBubbleView.tsx index 5c91505d..b34f4633 100644 --- a/src/layout/notification-bubble/NotificationBubbleView.tsx +++ b/src/layout/notification-bubble/NotificationBubbleView.tsx @@ -1,21 +1,27 @@ import { FC, useEffect, useMemo, useState } from 'react'; -import { NitroLayoutBase } from '../base'; +import { Base, BaseProps } from '../../common'; import { TransitionAnimation, TransitionAnimationTypes } from '../transitions'; -import { NotificationBubbleViewProps } from './NotificationBubbleView.types'; + +interface NotificationBubbleViewProps extends BaseProps +{ + fadesOut?: boolean; + timeoutMs?: number; + close: () => void; +} export const NotificationBubbleView: FC = props => { - const { fadesOut = true, timeoutMs = 8000, close = null, className = '', ...rest } = props; + const { fadesOut = true, timeoutMs = 8000, close = null, classNames = [], ...rest } = props; const [ isVisible, setIsVisible ] = useState(false); - const getClassName = useMemo(() => + const getClassNames = useMemo(() => { - let newClassName = 'nitro-notification-bubble rounded'; + const newClassNames: string[] = [ 'nitro-notification-bubble', 'rounded' ]; - if(className && className.length) newClassName += ` ${ className }`; + if(classNames.length) newClassNames.push(...classNames); - return newClassName; - }, [ className ]); + return newClassNames; + }, [ classNames ]); useEffect(() => { @@ -40,7 +46,7 @@ export const NotificationBubbleView: FC = props => return ( - + ); }