-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b70f0fa
commit 9cf3965
Showing
8 changed files
with
224 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
|
||
import "./ParameterMappingEditor.less"; | ||
import Button from "antd/lib/button"; | ||
|
||
export default function ParameterMappingEditor({ header, children, saveDisabled, onCancel, onSave }) { | ||
return ( | ||
<div className="parameter-mapping-editor" data-test="EditParamMappingPopover"> | ||
{header && <header>{header}</header>} | ||
{children} | ||
<footer> | ||
<Button onClick={onCancel}>Cancel</Button> | ||
<Button onClick={onSave} disabled={saveDisabled} type="primary"> | ||
OK | ||
</Button> | ||
</footer> | ||
</div> | ||
); | ||
} | ||
|
||
ParameterMappingEditor.propTypes = { | ||
header: PropTypes.node, | ||
children: PropTypes.node, | ||
saveDisabled: PropTypes.bool, | ||
onSave: PropTypes.func, | ||
onCancel: PropTypes.func, | ||
}; | ||
|
||
ParameterMappingEditor.defaultProps = { | ||
header: null, | ||
children: null, | ||
saveDisabled: false, | ||
onSave: () => {}, | ||
onCancel: () => {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@import "~antd/lib/modal/style/index"; // for ant @vars | ||
|
||
.parameter-mapping-editor { | ||
width: 390px; | ||
|
||
.radio { | ||
display: block; | ||
height: 30px; | ||
line-height: 30px; | ||
} | ||
|
||
.form-item { | ||
margin-bottom: 10px; | ||
} | ||
|
||
header { | ||
padding: 0 16px 10px; | ||
margin: 0 -16px 20px; | ||
border-bottom: @border-width-base @border-style-base @border-color-split; | ||
font-size: @font-size-lg; | ||
font-weight: 500; | ||
color: @heading-color; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
footer { | ||
border-top: @border-width-base @border-style-base @border-color-split; | ||
padding: 10px 16px 0; | ||
margin: 0 -16px; | ||
text-align: right; | ||
|
||
button { | ||
margin-left: 8px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.