mon-entreprise/source/components/Banner.js

33 lines
782 B
JavaScript
Raw Normal View History

/* @flow */
import React from 'react'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { firstStepCompletedSelector } from 'Selectors/analyseSelectors'
import Animate from 'Ui/animate'
import './Banner.css'
2018-07-12 08:09:41 +00:00
import type { Node } from 'react'
import type { State } from 'Types/State'
type PropTypes = {
hidden: boolean,
children: Node,
2019-05-09 15:13:59 +00:00
icon?: string
}
let Banner = ({ hidden = false, children, icon }: PropTypes) =>
!hidden ? (
<Animate.fadeIn>
<div className="ui__ banner">
{icon && emoji(icon)}
<p>{children}</p>
</div>
</Animate.fadeIn>
) : null
export default (connect(
2019-01-21 18:19:49 +00:00
(state: State, { hidden }: PropTypes) => ({
hidden: hidden || firstStepCompletedSelector(state)
2019-01-21 18:19:49 +00:00
}),
{}
)(Banner): React$ComponentType<PropTypes>)