Skip to content

Commit dd2c5b6

Browse files
committed
add footer
1 parent 239e181 commit dd2c5b6

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

dist/Footer.react.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ var defaultProps = {
154154
defaultCancel: null,
155155
buttonClick: null,
156156
onOk: null,
157-
onClose: null
157+
onClose: null,
158+
footer: null
158159
};
159160

160161
var Component = function (_React$Component2) {
@@ -184,6 +185,7 @@ var Component = function (_React$Component2) {
184185
defaultCancel: this.props.defaultCancel,
185186
buttons: this.props.buttons.left
186187
}),
188+
this.props.footer,
187189
_react2.default.createElement(ButtonsSpace, {
188190
buttonClick: this.props.buttonClick,
189191
onOk: this.props.onOk,
@@ -196,8 +198,13 @@ var Component = function (_React$Component2) {
196198
buttons: this.props.buttons.right
197199
})
198200
);
201+
} else if (this.props.footer) {
202+
return _react2.default.createElement(
203+
'footer',
204+
{ className: this.props.className },
205+
this.props.footer
206+
);
199207
}
200-
201208
return null;
202209
}
203210
}]);

dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ var initialState = {
7171
className: null,
7272
noOverlay: false,
7373
position: false,
74-
closeOnOutsideClick: true
74+
closeOnOutsideClick: true,
75+
footer: null
7576
};
7677

7778
var Store = new _Store2.default();
@@ -268,7 +269,8 @@ var Component = function (_React$Component) {
268269
className: popup.className,
269270
noOverlay: popup.noOverlay,
270271
position: popup.position,
271-
closeOnOutsideClick: popup.closeOnOutsideClick
272+
closeOnOutsideClick: popup.closeOnOutsideClick,
273+
footer: popup.footer
272274
});
273275
}
274276
}, {
@@ -416,7 +418,8 @@ var Component = function (_React$Component) {
416418
},
417419
defaultOk: this.props.defaultOk,
418420
defaultCancel: this.props.defaultCancel,
419-
buttons: this.state.buttons
421+
buttons: this.state.buttons,
422+
footer: this.state.footer
420423
})
421424
);
422425
}

src/Footer.react.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ const defaultProps = {
102102
defaultCancel: null,
103103
buttonClick: null,
104104
onOk: null,
105-
onClose: null
105+
onClose: null,
106+
footer: null,
106107
};
107108

108109
class Component extends React.Component {
@@ -127,6 +128,8 @@ class Component extends React.Component {
127128
buttons={this.props.buttons.left}
128129
/>
129130

131+
{this.props.footer}
132+
130133
<ButtonsSpace
131134
buttonClick={this.props.buttonClick}
132135
onOk={this.props.onOk}
@@ -140,8 +143,13 @@ class Component extends React.Component {
140143
/>
141144
</footer>
142145
);
146+
} else if (this.props.footer) {
147+
return (
148+
<footer className={this.props.className}>
149+
{this.props.footer}
150+
</footer>
151+
);
143152
}
144-
145153
return null;
146154
}
147155

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const initialState = {
3737
noOverlay: false,
3838
position: false,
3939
closeOnOutsideClick: true,
40+
footer: null,
4041
};
4142

4243
const Store = new PopupStore();
@@ -203,6 +204,7 @@ class Component extends React.Component {
203204
noOverlay: popup.noOverlay,
204205
position: popup.position,
205206
closeOnOutsideClick: popup.closeOnOutsideClick,
207+
footer: popup.footer,
206208
});
207209
}
208210

@@ -326,6 +328,7 @@ class Component extends React.Component {
326328
defaultOk={this.props.defaultOk}
327329
defaultCancel={this.props.defaultCancel}
328330
buttons={this.state.buttons}
331+
footer={this.state.footer}
329332
/>
330333
</article>
331334
);

0 commit comments

Comments
 (0)