2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-04-08 02:06:59 +01:00
|
|
|
import { injectIntl, defineMessages } from 'react-intl'
|
|
|
|
import Button from './button'
|
|
|
|
import Text from './text'
|
|
|
|
|
2020-08-17 21:07:16 +01:00
|
|
|
class SensitiveMediaItem extends React.PureComponent {
|
2020-04-08 02:06:59 +01:00
|
|
|
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
intl,
|
|
|
|
onClick,
|
|
|
|
} = this.props
|
|
|
|
|
|
|
|
return (
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.px15, _s.pt5].join(' ')}>
|
|
|
|
<div className={[_s.d, _s.flexRow, _s.radiusSmall, _s.bgTertiary, _s.py10, _s.px15, _s.h100PC, _s.w100PC].join(' ')}>
|
|
|
|
<div className={[_s.d, _s.jcCenter, _s.flexNormal].join(' ')}>
|
2020-04-08 02:06:59 +01:00
|
|
|
<Text color='secondary'>
|
|
|
|
{intl.formatMessage(messages.warning)}
|
|
|
|
</Text>
|
|
|
|
</div>
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.jcCenter, _s.mlAuto].join(' ')}>
|
2020-04-08 02:06:59 +01:00
|
|
|
<Button
|
|
|
|
onClick={onClick}
|
|
|
|
color='tertiary'
|
|
|
|
backgroundColor='none'
|
2020-04-29 23:32:49 +01:00
|
|
|
className={_s.bgSecondaryDark_onHover}
|
2020-04-08 02:06:59 +01:00
|
|
|
>
|
|
|
|
<Text color='inherit' weight='bold' size='medium'>
|
|
|
|
{intl.formatMessage(messages.view)}
|
|
|
|
</Text>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-18 01:57:35 +01:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
2020-09-02 19:11:54 +01:00
|
|
|
warning: { id: 'status.sensitive_warning_2', defaultMessage: 'The author of this gab has added a warning to this media.' },
|
2020-08-18 01:57:35 +01:00
|
|
|
view: { id: 'view', defaultMessage: 'View' },
|
|
|
|
});
|
|
|
|
|
|
|
|
SensitiveMediaItem.propTypes = {
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
onClick: PropTypes.func.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(SensitiveMediaItem)
|