forked from vtex-apps/store-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotificationBar.js
42 lines (36 loc) · 1.05 KB
/
notificationBar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { memo } from 'react'
import { string } from 'prop-types'
import NotificationContent from './notificationContent'
import hoistNonReactStatics from 'hoist-non-react-statics'
import { formatIOMessage } from 'vtex.native-types'
import { injectIntl } from 'react-intl'
import styles from './styles.css'
const NotificationBar = ({ content, intl }) => {
return (
content && (
<div
className={`${
styles.notificationBarContainer
} bg-base--inverted c-on-base--inverted w-100`}
>
<div
className={`${
styles.notificationBarInner
} min-h-large flex items-center justify-center`}
>
<NotificationContent content={formatIOMessage({ id: content, intl })} />
</div>
</div>
)
)
}
NotificationBar.propTypes = {
content: string,
}
NotificationBar.defaultProps = {
content: '',
}
NotificationBar.schema = {
title: 'admin/editor.notification-bar.title'
}
export default hoistNonReactStatics(injectIntl(NotificationBar), memo(NotificationBar))