Skip to content

Commit

Permalink
fix(csp): add height prop to withMapControl widget (decaporg#2138)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagda1 committed Dec 7, 2021
1 parent 04d1e05 commit a1dba53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/netlify-cms-widget-map/src/withMapControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ export default function withMapControl({ getFormat, getMap } = {}) {
static propTypes = {
onChange: PropTypes.func.isRequired,
field: PropTypes.object.isRequired,
height: PropTypes.string,
value: PropTypes.node,
};

static defaultProps = {
value: '',
height: '400px'
};

constructor(props) {
Expand Down Expand Up @@ -70,6 +72,8 @@ export default function withMapControl({ getFormat, getMap } = {}) {
}

render() {
const { height } = this.props;

return (
<ClassNames>
{({ cx, css }) => (
Expand All @@ -80,6 +84,7 @@ export default function withMapControl({ getFormat, getMap } = {}) {
${olStyles};
padding: 0;
overflow: hidden;
height: ${height};
`,
)}
ref={this.mapContainer}
Expand Down

0 comments on commit a1dba53

Please sign in to comment.