]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix logo button style
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Sat, 26 Dec 2020 22:50:34 +0000 (07:50 +0900)
committerClaire <claire.github-309c@sitedethib.com>
Wed, 6 Jan 2021 18:03:21 +0000 (19:03 +0100)
Port ba748a83f2050dff27758bce67c05d37a8b7d8f3 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/components/button.js
app/javascript/flavours/glitch/features/account/components/header.js
app/javascript/flavours/glitch/styles/components/index.scss
app/javascript/flavours/glitch/styles/containers.scss
app/javascript/flavours/glitch/styles/rtl.scss
app/javascript/flavours/glitch/styles/statuses.scss

index cd6528f5837cae1d8d33637d94e51c15a3aa0ca1..b1815c3e190e6fce0f5911bbf6cd64bd45e6cd0b 100644 (file)
@@ -10,17 +10,11 @@ export default class Button extends React.PureComponent {
     disabled: PropTypes.bool,
     block: PropTypes.bool,
     secondary: PropTypes.bool,
-    size: PropTypes.number,
     className: PropTypes.string,
     title: PropTypes.string,
-    style: PropTypes.object,
     children: PropTypes.node,
   };
 
-  static defaultProps = {
-    size: 36,
-  };
-
   handleClick = (e) => {
     if (!this.props.disabled) {
       this.props.onClick(e);
@@ -44,12 +38,6 @@ export default class Button extends React.PureComponent {
       disabled: this.props.disabled,
       onClick: this.handleClick,
       ref: this.setRef,
-      style: {
-        padding: `0 ${this.props.size / 2.25}px`,
-        height: `${this.props.size}px`,
-        lineHeight: `${this.props.size}px`,
-        ...this.props.style,
-      },
     };
 
     if (this.props.title) attrs.title = this.props.title;
index 9b080a14e3d0afe3112f53204ead8301c6f999b6..15515a99a73bcc834f18b597cdbc553b2128465b 100644 (file)
@@ -159,13 +159,17 @@ class Header extends ImmutablePureComponent {
       info.push(<span className='relationship-tag'><FormattedMessage id='account.domain_blocked' defaultMessage='Domain blocked' /></span>);
     }
 
+    if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) {
+      bellBtn = <IconButton icon='bell-o' size={24} active={account.getIn(['relationship', 'notifying'])} title={intl.formatMessage(account.getIn(['relationship', 'notifying']) ? messages.disableNotifications : messages.enableNotifications, { name: account.get('username') })} onClick={this.props.onNotifyToggle} />;
+    }
+
     if (me !== account.get('id')) {
       if (!account.get('relationship')) { // Wait until the relationship is loaded
         actionBtn = '';
       } else if (account.getIn(['relationship', 'requested'])) {
-        actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />;
+        actionBtn = <Button className={classNames('logo-button', { 'button--with-bell': bellBtn !== '' })} text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />;
       } else if (!account.getIn(['relationship', 'blocking'])) {
-        actionBtn = <Button className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />;
+        actionBtn = <Button className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']), 'button--with-bell': bellBtn !== '' })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />;
       } else if (account.getIn(['relationship', 'blocking'])) {
         actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.props.onBlock} />;
       }
@@ -173,10 +177,6 @@ class Header extends ImmutablePureComponent {
       actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.edit_profile)} onClick={this.openEditProfile} />;
     }
 
-    if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) {
-      bellBtn = <IconButton icon='bell-o' size={24} active={account.getIn(['relationship', 'notifying'])} title={intl.formatMessage(account.getIn(['relationship', 'notifying']) ? messages.disableNotifications : messages.enableNotifications, { name: account.get('username') })} onClick={this.props.onNotifyToggle} />;
-    }
-
     if (account.get('moved') && !account.getIn(['relationship', 'following'])) {
       actionBtn = '';
     }
index cfaee6557402aee4f338f2b88603fbd54c935892..40206c696a08f11b287a6f5157b5c1e03459b68b 100644 (file)
     display: block;
     width: 100%;
   }
+
+  .layout-multiple-columns &.button--with-bell {
+    font-size: 12px;
+    padding: 0 8px;
+  }
 }
 
 .icon-button {
index d1c6c33d7bc00ad63db2fe9ba3c73de2c534b1cc..e5d95d16f8846aa56012ec71df57a771af2bece2 100644 (file)
       }
     }
 
+    .logo-button {
+      line-height: 36px;
+      padding: 3px 15px;
+    }
+
     &__image {
       border-radius: 4px 4px 0 0;
       overflow: hidden;
index 2375bac90bf89d351acce84f2865f608d4eee714..f6a90d271d8aa1c12ec2b6ea17be5297e2d86e2c 100644 (file)
@@ -163,6 +163,11 @@ body.rtl {
     right: 42px;
   }
 
+  .account__header__tabs__buttons > .icon-button {
+    margin-right: 0;
+    margin-left: 8px;
+  }
+
   .account__avatar-overlay-overlay {
     right: auto;
     left: 0;
index 58f74f954e6da32e159c6db42615866c5212503c..9c2667bb8b4d9cab247385200d43cc90790acdf8 100644 (file)
   background: $ui-highlight-color;
   color: $primary-text-color;
   text-transform: none;
-  line-height: 36px;
+  line-height: 16px;
   height: auto;
-  padding: 3px 15px;
+  min-height: 36px;
+  min-width: 88px;
+  white-space: normal;
+  overflow-wrap: break-word;
+  hyphens: auto;
+  padding: 0 15px;
   border: 0;
 
   svg {