mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 15:15:12 +08:00
feat(form): better form headers
This commit is contained in:
parent
7b7e34e819
commit
f169df496d
3 changed files with 13 additions and 5 deletions
|
@ -322,6 +322,8 @@ class GeneratedForm extends React.Component
|
|||
|
||||
formType: React.PropTypes.oneOf(['new', 'update'])
|
||||
prefilled: React.PropTypes.bool
|
||||
formHeader: React.PropTypes.node,
|
||||
formFooter: React.PropTypes.node,
|
||||
contextData: React.PropTypes.object,
|
||||
|
||||
@defaultProps:
|
||||
|
@ -329,8 +331,9 @@ class GeneratedForm extends React.Component
|
|||
onSubmit: ->
|
||||
|
||||
render: =>
|
||||
submitText = if @props.formType is "new" then "Create" else "Update"
|
||||
submitText = if @props.formType is "new" then "Create" else "Save"
|
||||
<form className="generated-form" ref="form" style={this.props.style} onSubmit={this.props.onSubmit} onKeyDown={this._onKeyDown} noValidate>
|
||||
{if this.props.formHeader then this.props.formHeader else false}
|
||||
<TabGroupRegion>
|
||||
{@_renderHeaderFormError()}
|
||||
{@_renderPrefilledMessage()}
|
||||
|
@ -338,9 +341,10 @@ class GeneratedForm extends React.Component
|
|||
{@_renderFieldsets()}
|
||||
</div>
|
||||
<div className="form-footer">
|
||||
<button type="button" className="btn btn-emphasis" onClick={this.props.onSubmit}>
|
||||
{submitText}
|
||||
</button>
|
||||
<div className="submit-button-wrap">
|
||||
<button type="button" className="btn btn-emphasis" onClick={this.props.onSubmit}>{submitText}</button>
|
||||
</div>
|
||||
{if this.props.formFooter then this.props.formFooter else false}
|
||||
</div>
|
||||
</TabGroupRegion>
|
||||
</form>
|
||||
|
|
2
src/pro
2
src/pro
|
@ -1 +1 @@
|
|||
Subproject commit 079eb8b1c8c6d3ba9db4c01da4f56360c0dab8b1
|
||||
Subproject commit 14a30426033fbba6ccd99b743544fb01afdf1158
|
|
@ -177,9 +177,13 @@ body.is-blurred, body.platform-win32.is-blurred {
|
|||
}
|
||||
|
||||
.form-footer {
|
||||
display: flex;
|
||||
background: @background-off-primary;
|
||||
border-top: 1px solid darken(@background-off-primary, 7%);
|
||||
padding: 9px 22px;
|
||||
.submit-button-wrap {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
|
|
Loading…
Reference in a new issue