Skip to content

Commit

Permalink
add footer
Browse files Browse the repository at this point in the history
  • Loading branch information
z-vr committed Jun 8, 2017
1 parent 239e181 commit 20c0d01
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
11 changes: 9 additions & 2 deletions dist/Footer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ var defaultProps = {
defaultCancel: null,
buttonClick: null,
onOk: null,
onClose: null
onClose: null,
footer: null
};

var Component = function (_React$Component2) {
Expand Down Expand Up @@ -184,6 +185,7 @@ var Component = function (_React$Component2) {
defaultCancel: this.props.defaultCancel,
buttons: this.props.buttons.left
}),
this.props.footer,
_react2.default.createElement(ButtonsSpace, {
buttonClick: this.props.buttonClick,
onOk: this.props.onOk,
Expand All @@ -196,8 +198,13 @@ var Component = function (_React$Component2) {
buttons: this.props.buttons.right
})
);
} else if (this.props.footer) {
return _react2.default.createElement(
'footer',
{ className: this.props.className },
this.props.footer
);
}

return null;
}
}]);
Expand Down
9 changes: 6 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ var initialState = {
className: null,
noOverlay: false,
position: false,
closeOnOutsideClick: true
closeOnOutsideClick: true,
footer: null
};

var Store = new _Store2.default();
Expand Down Expand Up @@ -268,7 +269,8 @@ var Component = function (_React$Component) {
className: popup.className,
noOverlay: popup.noOverlay,
position: popup.position,
closeOnOutsideClick: popup.closeOnOutsideClick
closeOnOutsideClick: popup.closeOnOutsideClick,
footer: popup.footer
});
}
}, {
Expand Down Expand Up @@ -416,7 +418,8 @@ var Component = function (_React$Component) {
},
defaultOk: this.props.defaultOk,
defaultCancel: this.props.defaultCancel,
buttons: this.state.buttons
buttons: this.state.buttons,
footer: this.state.footer
})
);
}
Expand Down
11 changes: 10 additions & 1 deletion src/Footer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ const defaultProps = {
defaultCancel: null,
buttonClick: null,
onOk: null,
onClose: null
onClose: null,
footer: null,
};

class Component extends React.Component {
Expand All @@ -127,6 +128,8 @@ class Component extends React.Component {
buttons={this.props.buttons.left}
/>

{this.props.footer}

<ButtonsSpace
buttonClick={this.props.buttonClick}
onOk={this.props.onOk}
Expand All @@ -140,6 +143,12 @@ class Component extends React.Component {
/>
</footer>
);
} else if (this.props.footer) {
return (
<footer className={this.props.className}>
{this.props.footer}
</footer>
);
}

return null;
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const initialState = {
noOverlay: false,
position: false,
closeOnOutsideClick: true,
footer: null,
};

const Store = new PopupStore();
Expand Down Expand Up @@ -203,6 +204,7 @@ class Component extends React.Component {
noOverlay: popup.noOverlay,
position: popup.position,
closeOnOutsideClick: popup.closeOnOutsideClick,
footer: popup.footer,
});
}

Expand Down Expand Up @@ -326,6 +328,7 @@ class Component extends React.Component {
defaultOk={this.props.defaultOk}
defaultCancel={this.props.defaultCancel}
buttons={this.state.buttons}
footer={this.state.footer}
/>
</article>
);
Expand Down

0 comments on commit 20c0d01

Please sign in to comment.