Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Migrate my-sites/sharing to webpack css pipeline (#28607)" #29463

Merged
merged 1 commit into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/stylesheets/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@
@import 'my-sites/plugins/plugins-browser-item/style';
@import 'my-sites/plugins/plugins-browser-list/style';
@import 'my-sites/plugins/plugins-browser/style';
@import 'my-sites/sharing/style';
@import 'my-sites/sharing/connections/account-dialog.scss';
@import 'my-sites/sharing/connections/account-dialog-account.scss';
@import 'my-sites/sharing/connections/services-group.scss';
@import 'my-sites/sidebar/style';
@import 'my-sites/sidebar-navigation/style';
@import 'my-sites/site-indicator/style';
Expand Down
6 changes: 5 additions & 1 deletion assets/stylesheets/shared/_extends-forms.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// SASS placeholder selectors for form styles
/**
* SASS placeholder selectors for form styles
*
* @format
*/

%form {
ul {
Expand Down
12 changes: 2 additions & 10 deletions client/my-sites/sharing/connections/account-dialog-account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
/**
* External dependencies
*/

import PropTypes from 'prop-types';
import React from 'react';
import Image from 'components/image';
import classNames from 'classnames';
import Gridicon from 'gridicons';

/**
* Internal dependencies
*/
import Image from 'components/image';

/**
* Style dependencies
*/
import './account-dialog-account.scss';

/* eslint-disable wpcalypso/jsx-classname-namespace */
const AccountDialogAccount = ( { account, conflicting, onChange, selected, defaultIcon } ) => {
const classes = classNames( 'account-dialog-account', {
Expand Down
37 changes: 16 additions & 21 deletions client/my-sites/sharing/connections/account-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ import AccountDialogAccount from './account-dialog-account';
import Dialog from 'components/dialog';
import { warningNotice } from 'state/notices/actions';

/**
* Style dependencies
*/
import './account-dialog.scss';

/* eslint-disable wpcalypso/jsx-classname-namespace */
class AccountDialog extends Component {
static propTypes = {
accounts: PropTypes.arrayOf( PropTypes.object ),
Expand All @@ -45,20 +39,6 @@ class AccountDialog extends Component {
warningNotice: () => {},
};

state = {
selectedAccount: null,
};

static getDerivedStateFromProps( props, state ) {
// When the account dialog is closed, reset the selected account so
// that the state doesn't leak into a future dialog
if ( ! props.visible && state.selectedAccount ) {
return { selectedAccount: null };
}

return null;
}

onClose = action => {
const accountToConnect = this.getAccountToConnect();
const externalUserId =
Expand All @@ -79,6 +59,22 @@ class AccountDialog extends Component {

onSelectedAccountChanged = account => this.setState( { selectedAccount: account } );

constructor( props ) {
super( props );

this.state = {
selectedAccount: null,
};
}

componentWillReceiveProps( nextProps ) {
// When the account dialog is closed, reset the selected account so
// that the state doesn't leak into a future dialog
if ( ! nextProps.visible ) {
this.setState( { selectedAccount: null } );
}
}

getSelectedAccount() {
if ( this.state.selectedAccount ) {
return this.state.selectedAccount;
Expand Down Expand Up @@ -229,7 +225,6 @@ class AccountDialog extends Component {
);
}
}
/* eslint-enable wpcalypso/jsx-classname-namespace */

export default connect(
null,
Expand Down
7 changes: 0 additions & 7 deletions client/my-sites/sharing/connections/services-group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ import Service from './service';
import * as Components from './services';
import ServicePlaceholder from './service-placeholder';

/**
* Style dependencies
*/
import './services-group.scss';

/**
* Module constants
*/
Expand All @@ -37,7 +32,6 @@ const SharingServicesGroup = ( { isFetching, services, title } ) => {
return null;
}

/* eslint-disable wpcalypso/jsx-classname-namespace */
return (
<div className="sharing-services-group">
<SectionHeader label={ title } />
Expand All @@ -56,7 +50,6 @@ const SharingServicesGroup = ( { isFetching, services, title } ) => {
</ul>
</div>
);
/* eslint-enable wpcalypso/jsx-classname-namespace */
};

SharingServicesGroup.propTypes = {
Expand Down
9 changes: 9 additions & 0 deletions client/my-sites/sharing/connections/services-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
display: none;
}

.sharing-services-group__header {
margin: 0 0 30px 20px;
}

.sharing-service-group__title {
@include heading;
margin: 0 0 4px;
}

.sharing-services-group__services {
margin: 0 0 30px;
padding: 0;
Expand Down
5 changes: 0 additions & 5 deletions client/my-sites/sharing/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ import SidebarNavigation from 'my-sites/sidebar-navigation';
import UpgradeNudge from 'my-sites/upgrade-nudge';
import { FEATURE_NO_ADS } from 'lib/plans/constants';

/**
* Style Dependencies
*/
import './style.scss';

export const Sharing = ( {
contentComponent,
path,
Expand Down
12 changes: 12 additions & 0 deletions client/my-sites/sharing/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1100,3 +1100,15 @@
.sharing-buttons-label-editor__input {
max-width: 300px;
}

@include breakpoint( '<660px' ) {
.right-column {
box-sizing: border-box;
}

.sharing-content {
.new-account {
margin-left: 10px;
}
}
}