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

10267 add cornerstone toggle to sidebar #10405

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
11 changes: 10 additions & 1 deletion js/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import ClassicEditorData from "./analysis/classicEditorData.js";
import isGutenbergDataAvailable from "./helpers/isGutenbergDataAvailable";
import SnippetEditor from "./containers/SnippetEditor";
import { ThemeProvider } from "styled-components";
import CornerstoneToggle from "yoast-components/composites/Plugin/CornerstoneContent/components/CornerstoneToggle";
import styled from "styled-components";

// This should be the entry point for all the edit screens. Because of backwards compatibility we can't change this at once.
let localizedData = { intl: {}, isRtl: false };
Expand All @@ -35,6 +37,10 @@ function registerStoreInGutenberg() {
} );
}

const YoastSidebarContainer = styled.div`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me this padding shouldn't be on the sidebar itself, but on the underlying components. For instance, a <Collapsible> should have the padding (which it already does).

padding: 16px;
`;

/**
* Registers the plugin into the gutenberg editor, creates a sidebar entry for the plugin,
* and creates that sidebar's content.
Expand All @@ -59,7 +65,10 @@ function registerPlugin() {
name="seo-sidebar"
title="Yoast SEO"
>
<p> Contents of the sidebar </p>
<YoastSidebarContainer>
<p> Contents of the sidebar </p>
<CornerstoneToggle onChange={ () => {} } checked={ true } />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to rebase against the latest trunk and put this inside the <Fill>.

</YoastSidebarContainer>
</PluginSidebar>
</Fragment>
);
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"babel-preset-react": "^6.11.1",
"babelify": "^7.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^1.0.0",
"envify": "^3.4.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
Expand Down Expand Up @@ -90,15 +91,17 @@
"i18n-calypso": "^1.8.4",
"jest": "^23.3.0",
"load-grunt-config": "^0.19.2",
"node-sass": "^4.9.2",
"raf": "^3.4.0",
"react": "^16.2.0",
"react-dom": "16.2.0",
"redux-logger": "^3.0.6",
"sass-loader": "^7.0.3",
"sassdash": "^0.8.1",
"svg-react-loader": "^0.4.5",
"time-grunt": "^1.0.0",
"unminified-webpack-plugin": "^1.4.2",
"webpack": "^3.4.1",
"webpack": "^3.12.0",
"webpack-dev-server": "^2.11.0"
},
"optionalDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions webpack/webpack.config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ const defaultWebpackConfig = {
test: /\.json$/,
use: [ "json-loader" ],
},
{
test: /\.scss$/,
use: [
"css-loader",
"sass-loader",
],
},
],
},
externals,
Expand Down