|
|
@@ -2,8 +2,8 @@ import { useState } from 'react'
|
|
|
import { Alert, AlertProps } from 'react-bootstrap'
|
|
|
import Body from './body'
|
|
|
import Action from './action'
|
|
|
+import Close from './close'
|
|
|
import classnames from 'classnames'
|
|
|
-import { useTranslation } from 'react-i18next'
|
|
|
|
|
|
type NotificationProps = {
|
|
|
bsStyle: AlertProps['bsStyle']
|
|
|
@@ -20,7 +20,6 @@ function Notification({
|
|
|
...props
|
|
|
}: NotificationProps) {
|
|
|
const [show, setShow] = useState(true)
|
|
|
- const { t } = useTranslation()
|
|
|
|
|
|
const handleDismiss = () => {
|
|
|
if (onDismiss) {
|
|
|
@@ -36,12 +35,13 @@ function Notification({
|
|
|
|
|
|
return (
|
|
|
<li className={classnames('notification-entry', className)} {...props}>
|
|
|
- <Alert
|
|
|
- bsStyle={bsStyle}
|
|
|
- onDismiss={onDismiss ? handleDismiss : undefined}
|
|
|
- closeLabel={t('close')}
|
|
|
- >
|
|
|
- <div className="notification-entry-content">{children}</div>
|
|
|
+ <Alert bsStyle={bsStyle}>
|
|
|
+ {children}
|
|
|
+ {onDismiss ? (
|
|
|
+ <div className="notification-close">
|
|
|
+ <Close onDismiss={handleDismiss} />
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
</Alert>
|
|
|
</li>
|
|
|
)
|