mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
Move Docusaurus 1 files into directory (#966)
* Move Docusaurus 1 into v1 directory * Update Circle CI commands for new v1 dir * Remove OC * Fix tests
This commit is contained in:
parent
9d4a5d5359
commit
f2927a9fc4
291 changed files with 7591 additions and 6532 deletions
44
v1/lib/core/Container.js
Normal file
44
v1/lib/core/Container.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
const classNames = require('classnames');
|
||||
|
||||
class Container extends React.Component {
|
||||
render() {
|
||||
const containerClasses = classNames('container', this.props.className, {
|
||||
darkBackground: this.props.background === 'dark',
|
||||
highlightBackground: this.props.background === 'highlight',
|
||||
lightBackground: this.props.background === 'light',
|
||||
paddingAll: this.props.padding.indexOf('all') >= 0,
|
||||
paddingBottom: this.props.padding.indexOf('bottom') >= 0,
|
||||
paddingLeft: this.props.padding.indexOf('left') >= 0,
|
||||
paddingRight: this.props.padding.indexOf('right') >= 0,
|
||||
paddingTop: this.props.padding.indexOf('top') >= 0,
|
||||
});
|
||||
let wrappedChildren;
|
||||
|
||||
if (this.props.wrapper) {
|
||||
wrappedChildren = <div className="wrapper">{this.props.children}</div>;
|
||||
} else {
|
||||
wrappedChildren = this.props.children;
|
||||
}
|
||||
return (
|
||||
<div className={containerClasses} id={this.props.id}>
|
||||
{wrappedChildren}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Container.defaultProps = {
|
||||
background: null,
|
||||
padding: [],
|
||||
wrapper: true,
|
||||
};
|
||||
|
||||
module.exports = Container;
|
Loading…
Add table
Add a link
Reference in a new issue