about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/notifications
diff options
context:
space:
mode:
authorMarkus Amalthea Magnuson <markus.magnuson@gmail.com>2017-04-08 13:07:55 +0200
committerEugen <eugen@zeonfederated.com>2017-04-08 13:07:55 +0200
commit157f0a2aa74737fbe1654984cbe6879b584f2721 (patch)
treea513a451a75de6393524588d942a24f5e0a41624 /app/assets/javascripts/components/features/notifications
parent49043f644d668e6c525d299e4193033236d22c35 (diff)
Add titles to more icons, and change clear notifications icon. (#1101)
Diffstat (limited to 'app/assets/javascripts/components/features/notifications')
-rw-r--r--app/assets/javascripts/components/features/notifications/components/clear_column_button.jsx32
-rw-r--r--app/assets/javascripts/components/features/notifications/components/column_settings.jsx12
2 files changed, 31 insertions, 13 deletions
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 6aa9d1efa..62c3e61e0 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 }) => (
-  <div className='column-icon' tabindex='0' style={iconStyle} onClick={onClick}>
-    <i className='fa fa-trash' />
-  </div>
-);
+const ClearColumnButton = React.createClass({
 
-ClearColumnButton.propTypes = {
-  onClick: React.PropTypes.func.isRequired
-};
+  propTypes: {
+    onClick: React.PropTypes.func.isRequired,
+    intl: React.PropTypes.object.isRequired
+  },
+
+  render () {
+    const { intl } = this.props;
+
+    return (
+      <div title={intl.formatMessage(messages.clear)} className='column-icon' tabIndex='0' style={iconStyle} onClick={this.onClick}>
+        <i className='fa fa-eraser' />
+      </div>
+    );
+  }
+})
 
-export default ClearColumnButton;
+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 f1b8ef57f..4e5fe1263 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 = <FormattedMessage id='notifications.column_settings.alert' defaultMessage='Desktop notifications' />;
     const showStr  = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
     const soundStr = <FormattedMessage id='notifications.column_settings.sound' defaultMessage='Play sound' />;
 
     return (
-      <ColumnCollapsable icon='sliders' fullHeight={616} onCollapse={onSave}>
+      <ColumnCollapsable icon='sliders' title={intl.formatMessage(messages.settings)} fullHeight={616} onCollapse={onSave}>
         <div className='column-settings--outer' style={outerStyle}>
           <span className='column-settings--section' style={sectionStyle}><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>
 
@@ -77,4 +81,4 @@ const ColumnSettings = React.createClass({
 
 });
 
-export default ColumnSettings;
+export default injectIntl(ColumnSettings);