about summary refs log tree commit diff
path: root/app/assets/javascripts/components
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-02 14:52:41 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-02 14:52:41 +0100
commit470f629b06477eb3fb049de16de73c6e829f20b5 (patch)
treefbeca8e77a88228d0e363941850872395b7d9b20 /app/assets/javascripts/components
parentd9232959dff4f9408e9a31bdba4ea565ba292962 (diff)
Fix #284 - Alignment in notifications column
Diffstat (limited to 'app/assets/javascripts/components')
-rw-r--r--app/assets/javascripts/components/components/account.jsx17
-rw-r--r--app/assets/javascripts/components/features/notifications/components/notification.jsx33
2 files changed, 36 insertions, 14 deletions
diff --git a/app/assets/javascripts/components/components/account.jsx b/app/assets/javascripts/components/components/account.jsx
index 413a956b9..558b38b42 100644
--- a/app/assets/javascripts/components/components/account.jsx
+++ b/app/assets/javascripts/components/components/account.jsx
@@ -31,7 +31,8 @@ const noteStyle = {
 };
 
 const buttonsStyle = {
-  padding: '10px'
+  padding: '10px',
+  height: '18px'
 };
 
 const Account = React.createClass({
@@ -68,25 +69,23 @@ const Account = React.createClass({
       note = <div style={noteStyle}>{account.get('note')}</div>;
     }
 
-    if (account.get('id') !== me) {
+    if (account.get('id') !== me && account.get('relationship', null) != null) {
       const following = account.getIn(['relationship', 'following']);
 
-      buttons = (
-        <div style={buttonsStyle}>
-          <IconButton icon={following ? 'user-times' : 'user-plus'} title={intl.formatMessage(messages.follow)} onClick={this.handleFollow} active={following} />
-        </div>
-      );
+      buttons = <IconButton icon={following ? 'user-times' : 'user-plus'} title={intl.formatMessage(messages.follow)} onClick={this.handleFollow} active={following} />;
     }
 
     return (
       <div style={outerStyle}>
         <div style={{ display: 'flex' }}>
           <Link key={account.get('id')} style={itemStyle} className='account__display-name' to={`/accounts/${account.get('id')}`}>
-            <div style={{ float: 'left', marginRight: '10px' }}><Avatar src={account.get('avatar')} size={36} /></div>
+            <div style={{ float: 'left', marginLeft: '12px', marginRight: '10px' }}><Avatar src={account.get('avatar')} size={36} /></div>
             <DisplayName account={account} />
           </Link>
 
-          {buttons}
+          <div style={buttonsStyle}>
+            {buttons}
+          </div>
         </div>
 
         {note}
diff --git a/app/assets/javascripts/components/features/notifications/components/notification.jsx b/app/assets/javascripts/components/features/notifications/components/notification.jsx
index be8cf3616..a8208f02c 100644
--- a/app/assets/javascripts/components/features/notifications/components/notification.jsx
+++ b/app/assets/javascripts/components/features/notifications/components/notification.jsx
@@ -6,11 +6,13 @@ import { FormattedMessage } from 'react-intl';
 import { Link } from 'react-router';
 
 const messageStyle = {
-  padding: '8px 10px',
+  marginLeft: '68px',
+  padding: '8px 0',
   paddingBottom: '0',
   cursor: 'default',
   color: '#d9e1e8',
-  fontSize: '15px'
+  fontSize: '15px',
+  position: 'relative'
 };
 
 const linkStyle = {
@@ -28,7 +30,14 @@ const Notification = React.createClass({
   renderFollow (account, link) {
     return (
       <div className='notification'>
-        <div style={messageStyle}><i className='fa fa-fw fa-user-plus' style={{ color: '#2b90d9' }} /> <FormattedMessage id='notification.follow' defaultMessage='{name} followed you' values={{ name: link }} /></div>
+        <div style={messageStyle}>
+          <div style={{ position: 'absolute', 'left': '-26px'}}>
+            <i className='fa fa-fw fa-user-plus' style={{ color: '#2b90d9' }} />
+          </div>
+
+          <FormattedMessage id='notification.follow' defaultMessage='{name} followed you' values={{ name: link }} />
+        </div>
+
         <AccountContainer id={account.get('id')} withNote={false} />
       </div>
     );
@@ -41,7 +50,14 @@ const Notification = React.createClass({
   renderFavourite (notification, link) {
     return (
       <div className='notification'>
-        <div style={messageStyle}><i className='fa fa-fw fa-star' style={{ color: '#ca8f04' }} /> <FormattedMessage id='notification.favourite' defaultMessage='{name} favourited your status' values={{ name: link }} /></div>
+        <div style={messageStyle}>
+          <div style={{ position: 'absolute', 'left': '-26px'}}>
+            <i className='fa fa-fw fa-star' style={{ color: '#ca8f04' }} />
+          </div>
+
+          <FormattedMessage id='notification.favourite' defaultMessage='{name} favourited your status' values={{ name: link }} />
+        </div>
+
         <StatusContainer id={notification.get('status')} muted={true} />
       </div>
     );
@@ -50,7 +66,14 @@ const Notification = React.createClass({
   renderReblog (notification, link) {
     return (
       <div className='notification'>
-        <div style={messageStyle}><i className='fa fa-fw fa-retweet' style={{ color: '#2b90d9' }} /> <FormattedMessage id='notification.reblog' defaultMessage='{name} reblogged your status' values={{ name: link }} /></div>
+        <div style={messageStyle}>
+          <div style={{ position: 'absolute', 'left': '-26px'}}>
+            <i className='fa fa-fw fa-retweet' style={{ color: '#2b90d9' }} />
+          </div>
+
+          <FormattedMessage id='notification.reblog' defaultMessage='{name} reblogged your status' values={{ name: link }} />
+        </div>
+
         <StatusContainer id={notification.get('status')} muted={true} />
       </div>
     );