2019-08-09 17:06:27 +01:00
import { FormattedMessage } from 'react-intl' ;
import spring from 'react-motion/lib/spring' ;
import Motion from '../../features/ui/util/optional_motion' ;
import { searchEnabled } from '../../initial_state' ;
export default class SearchPopout extends PureComponent {
static propTypes = {
style : PropTypes . object ,
} ;
render ( ) {
const { style } = this . props ;
2020-01-29 21:53:33 +00:00
2019-08-09 17:06:27 +01:00
return (
< div className = 'search-popout-container' style = { { ... style , position : 'absolute' , zIndex : 1000 } } >
< Motion defaultStyle = { { opacity : 0 , scaleX : 1 , scaleY : 1 } } style = { { opacity : spring ( 1 , { damping : 35 , stiffness : 400 } ) , scaleX : spring ( 1 , { damping : 35 , stiffness : 400 } ) , scaleY : spring ( 1 , { damping : 35 , stiffness : 400 } ) } } >
{ ( { opacity , scaleX , scaleY } ) => (
< div className = 'search-popout' style = { { opacity : opacity , transform : ` scale( ${ scaleX } , ${ scaleY } ) ` } } >
< h4 >
< FormattedMessage id = 'search_popout.search_format' defaultMessage = 'Advanced search format' / >
< / h 4 >
< ul >
< li >
< em > # example < / e m >
< FormattedMessage id = 'search_popout.tips.hashtag' defaultMessage = 'hashtag' / >
< / l i >
< li >
< em > @ username < / e m >
< FormattedMessage id = 'search_popout.tips.user' defaultMessage = 'user' / >
< / l i >
< li >
< em > URL < / e m >
< FormattedMessage id = 'search_popout.tips.user' defaultMessage = 'user' / >
< / l i >
< li >
< em > URL < / e m >
< FormattedMessage id = 'search_popout.tips.status' defaultMessage = 'status' / >
< / l i >
< / u l >
{
searchEnabled
? < FormattedMessage id = 'search_popout.tips.full_text' defaultMessage = 'Simple text returns statuses you have written, favorited, reposted, or have been mentioned in, as well as matching usernames, display names, and hashtags.' / >
: < FormattedMessage id = 'search_popout.tips.text' defaultMessage = 'Simple text returns matching display names, usernames and hashtags' / >
}
< / d i v >
) }
< / M o t i o n >
< / d i v >
) ;
}
}