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
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";
Copy link
Contributor

Choose a reason for hiding this comment

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

Styled should be lowercase: it's not a component.


// 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.

Styled should be lowercase

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>
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, I know this is for testing purposes but the indentation should be fixed.

</PluginSidebar>
</Fragment>
);
Expand Down