Skip to content

Commit

Permalink
chore: added the ability to add a class to Container
Browse files Browse the repository at this point in the history
  • Loading branch information
zstix committed Apr 24, 2020
1 parent 53f565e commit 6ad8388
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/Container.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';

import './Container.scss';

const Container = ({ children }) => (
<div className="u-container">{children}</div>
const Container = ({ children, className }) => (
<div className={cx('u-container', className)}>{children}</div>
);

Container.propTypes = {
children: PropTypes.node.isRequired,
className: PropTypes.string,
};

export default Container;
5 changes: 3 additions & 2 deletions src/pages/reference.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import Container from '../components/Container';
import Layout from '../components/Layout';
import Sidebar from '../components/Sidebar';

Expand Down Expand Up @@ -57,12 +58,12 @@ const pages = [

const Reference = () => (
<Layout>
<div className="ReferenceTemplate">
<Container className="ReferenceTemplate">
<Sidebar pages={pages} />
<main className="ReferenceTemplate-content">
The main page content goes here
</main>
</div>
</Container>
</Layout>
);

Expand Down

0 comments on commit 6ad8388

Please sign in to comment.