From cca41ea544fe7de3e7afdc250992a1c6e48d2a31 Mon Sep 17 00:00:00 2001 From: Stephen Burgess Date: Sat, 22 Apr 2017 21:26:55 -0500 Subject: 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 --- .../notifications/components/column_settings.jsx | 33 ++++++---------------- .../notifications/components/notification.jsx | 14 ++++----- .../notifications/components/setting_toggle.jsx | 17 ++--------- 3 files changed, 16 insertions(+), 48 deletions(-) (limited to 'app/assets/javascripts/components/features/notifications') 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 41c2e7d36..30063010c 100644 --- a/app/assets/javascripts/components/features/notifications/components/column_settings.jsx +++ b/app/assets/javascripts/components/features/notifications/components/column_settings.jsx @@ -8,21 +8,6 @@ const messages = defineMessages({ settings: { id: 'notifications.settings', defaultMessage: 'Column settings' } }); -const outerStyle = { - padding: '15px' -}; - -const sectionStyle = { - cursor: 'default', - display: 'block', - fontWeight: '500', - marginBottom: '10px' -}; - -const rowStyle = { - -}; - class ColumnSettings extends React.PureComponent { render () { @@ -34,34 +19,34 @@ class ColumnSettings extends React.PureComponent { return ( -
- +
+ -
+
- + -
+
- + -
+
- + -
+
diff --git a/app/assets/javascripts/components/features/notifications/components/notification.jsx b/app/assets/javascripts/components/features/notifications/components/notification.jsx index dadc6696a..34dd76bb7 100644 --- a/app/assets/javascripts/components/features/notifications/components/notification.jsx +++ b/app/assets/javascripts/components/features/notifications/components/notification.jsx @@ -6,17 +6,13 @@ import Permalink from '../../../components/permalink'; import emojify from '../../../emoji'; import escapeTextContentForBrowser from 'escape-html'; -const linkStyle = { - fontWeight: '500' -}; - class Notification extends React.PureComponent { renderFollow (account, link) { return (
-
+
@@ -36,8 +32,8 @@ class Notification extends React.PureComponent { return (
-
- +
+
@@ -52,7 +48,7 @@ class Notification extends React.PureComponent { return (
-
+
@@ -69,7 +65,7 @@ class Notification extends React.PureComponent { const account = notification.get('account'); const displayName = account.get('display_name').length > 0 ? account.get('display_name') : account.get('username'); const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) }; - const link = ; + const link = ; switch(notification.get('type')) { case 'follow': diff --git a/app/assets/javascripts/components/features/notifications/components/setting_toggle.jsx b/app/assets/javascripts/components/features/notifications/components/setting_toggle.jsx index 1c3957651..e9bca5928 100644 --- a/app/assets/javascripts/components/features/notifications/components/setting_toggle.jsx +++ b/app/assets/javascripts/components/features/notifications/components/setting_toggle.jsx @@ -2,23 +2,10 @@ import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Toggle from 'react-toggle'; -const labelStyle = { - display: 'block', - lineHeight: '24px', - verticalAlign: 'middle' -}; - -const labelSpanStyle = { - display: 'inline-block', - verticalAlign: 'middle', - marginBottom: '14px', - marginLeft: '8px' -}; - const SettingToggle = ({ settings, settingKey, label, onChange, htmlFor = '' }) => ( -