CTA.js
5 years ago
CheckboxControl.js
5 years ago
CodeMirror.js
5 years ago
ColorPicker.js
5 years ago
ComboboxControl.js
5 years ago
Disabled.js
5 years ago
Fields.js
5 years ago
Group.js
5 years ago
Groups.js
5 years ago
Integration.js
5 years ago
Loading.js
5 years ago
Media.js
5 years ago
NullView.js
5 years ago
Page.js
5 years ago
SaveButton.js
5 years ago
SelectControl.js
5 years ago
TextControl.js
5 years ago
ToggleControl.js
5 years ago
Group.js
42 lines
| 1 | const { __ } = wp.i18n; |
| 2 | const { Card, CardBody, CardFooter } = wp.components; |
| 3 | import SaveButton from "./SaveButton"; |
| 4 | import Disabled from "./Disabled"; |
| 5 | |
| 6 | export default ({ title, description, children, disabled, hideSaveButton }) => { |
| 7 | return ( |
| 8 | <Disabled disabled={disabled}> |
| 9 | <Card size="large" className="presto-options__card"> |
| 10 | <CardBody className={`presto-options__card-body`}> |
| 11 | <div className="presto-flow" style={{ "--presto-flow-space": "2em" }}> |
| 12 | <div |
| 13 | className="presto-flow" |
| 14 | style={{ "--presto-flow-space": "1em" }} |
| 15 | > |
| 16 | {title && ( |
| 17 | <h2 style={{ marginBottom: 0 }}> |
| 18 | {title}{" "} |
| 19 | {!!disabled && ( |
| 20 | <div className="presto-options__pro-badge">Pro</div> |
| 21 | )} |
| 22 | </h2> |
| 23 | )} |
| 24 | {description && <p>{description}</p>} |
| 25 | </div> |
| 26 | <div>{children}</div> |
| 27 | </div> |
| 28 | </CardBody> |
| 29 | {!hideSaveButton ? ( |
| 30 | <CardFooter isShady> |
| 31 | <div> |
| 32 | <SaveButton form="presto-settings-form" /> |
| 33 | </div> |
| 34 | </CardFooter> |
| 35 | ) : ( |
| 36 | <br /> |
| 37 | )} |
| 38 | </Card> |
| 39 | </Disabled> |
| 40 | ); |
| 41 | }; |
| 42 |