import PropTypes from 'prop-types' ; import React from 'react' ; import { Translate } from '../../../MobilizationClass' ; import { Wrap } from './styles' ; const TwitterShareButton = ( { href , text } ) => { const handleClick = ( ) => { window . open ( `https://twitter.com/intent/tweet?text=${ encodeURIComponent ( text ) }&url=${ href }` , 'Compartilhar no Twitter' , 'width=800,height=600' ) ; } ; return ( < Translate > { ( { t } ) => ( < Wrap > < button onClick = { handleClick } style = { { backgroundColor : '#3DD1F4' } } > { t ( 'Share Social Midia' , { app : 'Twitter' } ) } < /button> < /Wrap>)} < /Translate>); } ; TwitterShareButton . propTypes = { href : PropTypes . string . isRequired , text : PropTypes . string . isRequired , } ; export default TwitterShareButton ;