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

Replacing hasSidebar instead of sidebar in Cookbox #369

Conversation

frontend-3
Copy link
Contributor

While I was checking out the new cookbook(btw this new version is amazing) I realized that https://github.com/styleguidist/react-styleguidist/blob/master/docs/Cookbook.md#how-to-change-the-layout-of-a-style-guide is using sidebar prop instead hasSidebar. I'm fixing that because I feel is confusing have a example with the wrong prop. So:

Before

// lib/styleguide/StyleGuideRenderer.js
import React from 'react';
const StyleGuideRenderer = ({ title, homepageUrl, components, toc, sidebar }) => (
  <div className="root">
    <h1>{title}</h1>
    <main className="wrapper">
      <div className="content">
        {components}
        <footer className="footer">
          <Markdown text={`Generated with [React Styleguidist](${homepageUrl})`} />
        </footer>
      </div>
      {sidebar &&
        <div className="sidebar">
          {toc}
        </div>
      }
    </main>
  </div>
);

Now:

// lib/styleguide/StyleGuideRenderer.js
import React from 'react';
const StyleGuideRenderer = ({ title, homepageUrl, components, toc, hasSidebar }) => (
  <div className="root">
    <h1>{title}</h1>
    <main className="wrapper">
      <div className="content">
        {components}
        <footer className="footer">
          <Markdown text={`Generated with [React Styleguidist](${homepageUrl})`} />
        </footer>
      </div>
      {hasSidebar &&
        <div className="sidebar">
          {toc}
        </div>
      }
    </main>
  </div>
);

@codecov-io
Copy link

codecov-io commented Apr 3, 2017

Codecov Report

Merging #369 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #369   +/-   ##
=======================================
  Coverage   94.12%   94.12%           
=======================================
  Files          74       74           
  Lines        1038     1038           
  Branches      220      220           
=======================================
  Hits          977      977           
  Misses         61       61

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fc8abd...2681aaa. Read the comment docs.

@sapegin sapegin merged commit 186575d into styleguidist:master Apr 3, 2017
@sapegin
Copy link
Member

sapegin commented Apr 3, 2017

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants