Skip to content

Commit

Permalink
feat(cssModules): adding missing classes (#271)
Browse files Browse the repository at this point in the history
* adding missing and cleaning up cssModule

* adding more className under cssModule
  • Loading branch information
skoranga authored and eddywashere committed Jan 6, 2017
1 parent 62b13ad commit e8e818b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class Modal extends React.Component {
transitionLeaveTimeout={300}
onClickCapture={this.handleBackdropClick}
onKeyUp={this.handleEscape}
className="modal"
className={mapToCssModules('modal', cssModule)}
style={{ display: 'block' }}
tabIndex="-1"
>
Expand All @@ -196,7 +196,7 @@ class Modal extends React.Component {
ref={(c) => (this._dialog = c)}
{...attributes}
>
<div className="modal-content">
<div className={mapToCssModules('modal-content', cssModule)}>
{children}
</div>
</div>
Expand All @@ -208,7 +208,7 @@ class Modal extends React.Component {
transitionAppearTimeout={150}
transitionEnterTimeout={150}
transitionLeaveTimeout={150}
className="modal-backdrop"
className={mapToCssModules('modal-backdrop', cssModule)}
/>
)}
</TransitionGroup>
Expand Down
10 changes: 7 additions & 3 deletions src/ModalBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ const propTypes = {
};

const ModalBody = (props) => {
const {
className,
cssModule,
...attributes } = props;
const classes = mapToCssModules(classNames(
props.className,
className,
'modal-body'
), props.cssModule);
), cssModule);

return (
<div {...props} className={classes} />
<div {...attributes} className={classes} />
);
};

Expand Down
10 changes: 7 additions & 3 deletions src/ModalFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ const propTypes = {
};

const ModalFooter = (props) => {
const {
className,
cssModule,
...attributes } = props;
const classes = mapToCssModules(classNames(
props.className,
className,
'modal-footer'
), props.cssModule);
), cssModule);

return (
<div {...props} className={classes} />
<div {...attributes} className={classes} />
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/ModalHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ModalHeader = (props) => {
return (
<div {...attributes} className={classes}>
{closeButton}
<h4 className="modal-title">
<h4 className={mapToCssModules('modal-title', cssModule)}>
{children}
</h4>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Popover extends React.Component {

return (
<TetherContent
className="popover"
className={mapToCssModules('popover', this.props.cssModule)}
tether={tetherConfig}
tetherRef={this.props.tetherRef}
isOpen={this.props.isOpen}
Expand Down

0 comments on commit e8e818b

Please sign in to comment.