From 157f0a2aa74737fbe1654984cbe6879b584f2721 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 8 Apr 2017 13:07:55 +0200 Subject: [PATCH] Add titles to more icons, and change clear notifications icon. (#1101) --- .../components/column_collapsable.jsx | 5 +-- .../components/column_settings.jsx | 5 +-- .../components/clear_column_button.jsx | 32 +++++++++++++------ .../components/column_settings.jsx | 12 ++++--- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/components/components/column_collapsable.jsx b/app/assets/javascripts/components/components/column_collapsable.jsx index 44added8a01..85ce6383594 100644 --- a/app/assets/javascripts/components/components/column_collapsable.jsx +++ b/app/assets/javascripts/components/components/column_collapsable.jsx @@ -15,6 +15,7 @@ const ColumnCollapsable = React.createClass({ propTypes: { icon: React.PropTypes.string.isRequired, + title: React.PropTypes.string, fullHeight: React.PropTypes.number.isRequired, children: React.PropTypes.node, onCollapse: React.PropTypes.func @@ -39,13 +40,13 @@ const ColumnCollapsable = React.createClass({ }, render () { - const { icon, fullHeight, children } = this.props; + const { icon, title, fullHeight, children } = this.props; const { collapsed } = this.state; const collapsedClassName = collapsed ? 'collapsable-collapsed' : 'collapsable'; return (
-
+
{({ opacity, height }) => diff --git a/app/assets/javascripts/components/features/home_timeline/components/column_settings.jsx b/app/assets/javascripts/components/features/home_timeline/components/column_settings.jsx index 92e700874b7..129fbf841de 100644 --- a/app/assets/javascripts/components/features/home_timeline/components/column_settings.jsx +++ b/app/assets/javascripts/components/features/home_timeline/components/column_settings.jsx @@ -6,7 +6,8 @@ import SettingToggle from '../../notifications/components/setting_toggle'; import SettingText from './setting_text'; const messages = defineMessages({ - filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' } + filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }, + settings: { id: 'home.settings', defaultMessage: 'Column settings' } }); const outerStyle = { @@ -39,7 +40,7 @@ const ColumnSettings = React.createClass({ const { settings, onChange, onSave, intl } = this.props; return ( - +
diff --git a/app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx b/app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx index 6aa9d1efaf3..62c3e61e078 100644 --- a/app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx +++ b/app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx @@ -1,3 +1,9 @@ +import { defineMessages, injectIntl } from 'react-intl'; + +const messages = defineMessages({ + clear: { id: 'notifications.clear', defaultMessage: 'Clear notifications' } +}); + const iconStyle = { fontSize: '16px', padding: '15px', @@ -8,14 +14,22 @@ const iconStyle = { zIndex: '2' }; -const ClearColumnButton = ({ onClick }) => ( -
- -
-); +const ClearColumnButton = React.createClass({ -ClearColumnButton.propTypes = { - onClick: React.PropTypes.func.isRequired -}; + propTypes: { + onClick: React.PropTypes.func.isRequired, + intl: React.PropTypes.object.isRequired + }, -export default ClearColumnButton; + render () { + const { intl } = this.props; + + return ( +
+ +
+ ); + } +}) + +export default injectIntl(ClearColumnButton); diff --git a/app/assets/javascripts/components/features/notifications/components/column_settings.jsx b/app/assets/javascripts/components/features/notifications/components/column_settings.jsx index f1b8ef57fac..4e5fe1263bb 100644 --- a/app/assets/javascripts/components/features/notifications/components/column_settings.jsx +++ b/app/assets/javascripts/components/features/notifications/components/column_settings.jsx @@ -1,9 +1,13 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ColumnCollapsable from '../../../components/column_collapsable'; import SettingToggle from './setting_toggle'; +const messages = defineMessages({ + settings: { id: 'notifications.settings', defaultMessage: 'Column settings' } +}); + const outerStyle = { padding: '15px' }; @@ -30,14 +34,14 @@ const ColumnSettings = React.createClass({ mixins: [PureRenderMixin], render () { - const { settings, onChange, onSave } = this.props; + const { settings, intl, onChange, onSave } = this.props; const alertStr = ; const showStr = ; const soundStr = ; return ( - +
@@ -77,4 +81,4 @@ const ColumnSettings = React.createClass({ }); -export default ColumnSettings; +export default injectIntl(ColumnSettings);