2020-03-27 13:59:38 -07:00
import React from 'react' ;
import PropTypes from 'prop-types' ;
import ImmutablePropTypes from 'react-immutable-proptypes' ;
2021-10-15 17:23:24 -07:00
import { injectIntl , defineMessages , FormattedMessage } from 'react-intl' ;
2020-03-27 13:59:38 -07:00
import SettingToggle from '../../notifications/components/setting_toggle' ;
2021-10-15 17:23:24 -07:00
import IconButton from 'soapbox/components/icon_button' ;
const messages = defineMessages ( {
close : { id : 'lightbox.close' , defaultMessage : 'Close' } ,
} ) ;
2020-03-27 13:59:38 -07:00
export default @ injectIntl
class ColumnSettings extends React . PureComponent {
static propTypes = {
2021-10-15 17:23:24 -07:00
intl : PropTypes . object . isRequired ,
2020-03-27 13:59:38 -07:00
settings : ImmutablePropTypes . map . isRequired ,
onChange : PropTypes . func . isRequired ,
2021-10-15 17:23:24 -07:00
onClose : PropTypes . func . isRequired ,
2020-03-27 13:59:38 -07:00
} ;
2020-04-14 14:47:35 -07:00
render ( ) {
2021-10-15 17:23:24 -07:00
const { intl , settings , onChange , onClose } = this . props ;
2020-03-27 13:59:38 -07:00
return (
2021-10-15 17:23:24 -07:00
< div className = 'column-settings' >
< div className = 'column-settings__header' >
< h1 className = 'column-settings__title' >
< FormattedMessage id = 'home.column_settings.title' defaultMessage = 'Home settings' / >
< / h 1 >
< div className = 'column-settings__close' >
< IconButton title = { intl . formatMessage ( messages . close ) } src = { require ( '@tabler/icons/icons/x.svg' ) } onClick = { onClose } / >
< / d i v >
2020-03-27 13:59:38 -07:00
< / d i v >
2021-10-15 17:23:24 -07:00
< div className = 'column-settings__content' >
< div className = 'column-settings__row' >
< SettingToggle prefix = 'home_timeline' settings = { settings } settingPath = { [ 'shows' , 'reblog' ] } onChange = { onChange } label = { < FormattedMessage id = 'home.column_settings.show_reblogs' defaultMessage = 'Show reposts' / > } / >
< / d i v >
< div className = 'column-settings__row' >
< SettingToggle prefix = 'home_timeline' settings = { settings } settingPath = { [ 'shows' , 'reply' ] } onChange = { onChange } label = { < FormattedMessage id = 'home.column_settings.show_replies' defaultMessage = 'Show replies' / > } / >
< / d i v >
2020-08-07 18:47:04 -07:00
2021-10-15 17:23:24 -07:00
< div className = 'column-settings__row' >
< SettingToggle prefix = 'home_timeline' settings = { settings } settingPath = { [ 'shows' , 'direct' ] } onChange = { onChange } label = { < FormattedMessage id = 'home.column_settings.show_direct' defaultMessage = 'Show direct messages' / > } / >
< / d i v >
2020-08-07 18:47:04 -07:00
< / d i v >
2020-03-27 13:59:38 -07:00
< / d i v >
) ;
}
}