Yoast / yoast-components

Accessible React components by Yoast
GNU General Public License v3.0
21 stars 6 forks source link

Style posts/pages HelpCenterButton in Yoast Components #344

Open IreneStr opened 7 years ago

IreneStr commented 7 years ago

Currently, the HelpCenterButton that's on the post and page pages is styled in wordpress-seo. We should move the styling to Yoast Components.

Copied from https://github.com/Yoast/wordpress-seo/issues/8001#issuecomment-334722250:

Ok so the button is meant to have a different style in the edit post screen and in the plugin admin pages. However, I'd argue that adding a class yoast-help-center__button and then style the button from the Plugin scss files defeats a bit the purpose of using styled components.

Regardless, this is probably wrong in the plugin js/src/wp-seo-help-center.js

     * Renders the HelpCenter.
     *
     * @returns {ReactElement} The HelpCenter component.
     */
    render() {
        return (
            <div classID="yoast-help-center">
                <HelpCenterYC
                ... 

not sure what classID is. It produces the following output:

    <div class="yoast-help-center sc-hSdWYo haidUt">
    ...

worth noting the inner div is the HelpCenter component and already has a yoast-help-center class.

Not sure the component needs a wrapper div in the first place, it's a single component.

afercia commented 7 years ago

To recap, the Help Center button has 3 different stylings:

on My Yoast:

screen shot 2017-10-09 at 11 29 58

on the Plugin settings pages:

screen shot 2017-10-09 at 11 31 37

on the Plugin post meta box:

screen shot 2017-10-09 at 11 32 36

I'm not sure passing tons of props to have the 3 different stylings is the best option. Maybe implementing a buttonTheme prop that completely switches the button style? On the plugin, there should also be a way to distinguish the settings pages from the metabox and pass this to the HelpCenter component.