You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
soapbox/app/gabsocial/features/ui/components/explanation_box.js

28 lines
747 B

import React from 'react';
import PropTypes from 'prop-types';
export default
class ExplanationBox extends React.PureComponent {
static propTypes = {
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
explanation: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
dismissable: PropTypes.bool,
};
render() {
const { title, explanation, dismissable } = this.props;
return (
<div className='explanation-box'>
{title && <div className='explanation-box__title'>{title}</div>}
<div className='explanation-box__explanation'>
{explanation}
{dismissable && <span className='explanation-box__dismiss'>Dismiss</span>}
</div>
</div>
);
}
}