diff options
author | Stephen Burgess <stephenburgess8@gmail.com> | 2017-04-22 21:26:55 -0500 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-23 04:26:55 +0200 |
commit | cca41ea544fe7de3e7afdc250992a1c6e48d2a31 (patch) | |
tree | a5e2f06b2da112342de7725b85b5a18e0d09ef37 /app/assets/javascripts/components/features/account | |
parent | 532bec6e564884c2bd5b2bcc7cab929f4f2cabf5 (diff) |
Replace inline styles with CSS classes (BEM) (#2338)
* fix(classnames): Status icon style classnames Take out inline css and put into classnames for the following components: account, avatar, icon button, status action bar, notification. * fix(status): Move styles from inline to classes for statuses Move styles to classnames in components.scss for the following components: display name media gallery status status content video player * fix(classnames): Add classnames to rest of components Take out inline styles and apply them to classnames in the sass for the following components: button column back button slim column back button collapsable column dropdown menu loading indicator status list * fix(classnames): Remove all non-dynamic inline styles Components affected: autosuggested permalink action bar header character counter compose form emoji dropdown privacy dropdown reply indicator upload form account auth followers getting started column settings mutes settings reblogs status checkbox report action bar status card boost modal media modal video modal * fix(permalink): Do not lose classname * fix(tests): Add space back in display name * fix(status__wrapper): Remove duplicate css name Remove incorrect style attribute. Remove style attribute all together. Cursor defaults to "auto" when not specified as 'default'. * fix(nl): do not lose translations
Diffstat (limited to 'app/assets/javascripts/components/features/account')
-rw-r--r-- | app/assets/javascripts/components/features/account/components/action_bar.jsx | 15 | ||||
-rw-r--r-- | app/assets/javascripts/components/features/account/components/header.jsx | 6 |
2 files changed, 5 insertions, 16 deletions
diff --git a/app/assets/javascripts/components/features/account/components/action_bar.jsx b/app/assets/javascripts/components/features/account/components/action_bar.jsx index 3aefee027..772ea3a38 100644 --- a/app/assets/javascripts/components/features/account/components/action_bar.jsx +++ b/app/assets/javascripts/components/features/account/components/action_bar.jsx @@ -17,17 +17,6 @@ const messages = defineMessages({ disclaimer: { id: 'account.disclaimer', defaultMessage: 'This user is from another instance. This number may be larger.' } }); -const outerDropdownStyle = { - padding: '10px', - flex: '1 1 auto' -}; - -const outerLinksStyle = { - flex: '1 1 auto', - display: 'flex', - lineHeight: '18px' -}; - class ActionBar extends React.PureComponent { render () { @@ -63,11 +52,11 @@ class ActionBar extends React.PureComponent { return ( <div className='account__action-bar'> - <div style={outerDropdownStyle}> + <div className='account__action-bar-dropdown'> <DropdownMenu items={menu} icon='bars' size={24} direction="right" /> </div> - <div style={outerLinksStyle}> + <div className='account__action-bar-links'> <Link className='account__action-bar__tab' to={`/accounts/${account.get('id')}`}> <span><FormattedMessage id='account.posts' defaultMessage='Posts' /></span> <strong><FormattedNumber value={account.get('statuses_count')} /> {extraInfo}</strong> diff --git a/app/assets/javascripts/components/features/account/components/header.jsx b/app/assets/javascripts/components/features/account/components/header.jsx index 3ebfb7df3..958a5206b 100644 --- a/app/assets/javascripts/components/features/account/components/header.jsx +++ b/app/assets/javascripts/components/features/account/components/header.jsx @@ -25,11 +25,11 @@ class Avatar extends React.PureComponent { constructor (props, context) { super(props, context); - + this.state = { isHovered: false }; - + this.handleMouseOver = this.handleMouseOver.bind(this); this.handleMouseOut = this.handleMouseOut.bind(this); } @@ -56,7 +56,7 @@ class Avatar extends React.PureComponent { className='account__header__avatar' target='_blank' rel='noopener' - style={{ display: 'block', width: '90px', height: '90px', margin: '0 auto', marginBottom: '10px', borderRadius: `${radius}px`, overflow: 'hidden', backgroundSize: '90px 90px', backgroundImage: `url(${autoPlayGif || isHovered ? account.get('avatar') : account.get('avatar_static')})` }} + style={{ borderRadius: `${radius}px`, backgroundImage: `url(${autoPlayGif || isHovered ? account.get('avatar') : account.get('avatar_static')})` }} onMouseOver={this.handleMouseOver} onMouseOut={this.handleMouseOut} onFocus={this.handleMouseOver} |