Skip to content

Commit ad837e6

Browse files
authored
Merge pull request #22 from anvilco/pl/21/fix-classname-type-error
Add className prop and type
2 parents adabaff + 03e8323 commit ad837e6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/anvil-embed-frame/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types'
88
* @prop {String} anvilURL
99
* @prop {String} scroll
1010
* @prop {object} style
11+
* @prop {string} className
1112
*/
1213

1314
/**
@@ -47,11 +48,12 @@ class AnvilEmbedFrame extends React.Component {
4748
}
4849

4950
render () {
50-
const { iframeURL, onEvent, anvilURL, scroll, style, ...others } = this.props
51+
const { iframeURL, onEvent, anvilURL, scroll, style, className, ...others } = this.props
5152
return (
5253
<iframe
5354
id="anvil-embed-frame"
5455
name="AnvilEmbedFrame"
56+
className={className}
5557
{...others} // props above may be overriden
5658
src={iframeURL}
5759
ref={this.iframeRef}
@@ -75,6 +77,7 @@ AnvilEmbedFrame.propTypes = {
7577
anvilURL: PropTypes.string,
7678
scroll: PropTypes.oneOf(['auto', 'smooth']),
7779
style: PropTypes.object,
80+
className: PropTypes.string,
7881
}
7982

8083
export default AnvilEmbedFrame

packages/anvil-embed-frame/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export type Props = {
55
anvilURL: string;
66
enableDefaultStyles: boolean;
77
scroll: string;
8+
style: object;
9+
className: string;
810
};
911
/**
1012
* @typedef Props
@@ -14,6 +16,7 @@ export type Props = {
1416
* @prop {boolean} enableDefaultStyles
1517
* @prop {String} scroll
1618
* @prop {object} style
19+
* @prop {string} className
1720
*/
1821
/**
1922
* @extends React.Component<Props>
@@ -50,6 +53,7 @@ declare namespace AnvilEmbedFrame {
5053
export { enableDefaultStyles_1 as enableDefaultStyles };
5154
export const scroll: PropTypes.Requireable<string>;
5255
export const style: PropTypes.Requireable<object>;
56+
export const className: PropTypes.Requireable<string>;
5357
}
5458
}
5559
import Reacat from "react";

0 commit comments

Comments
 (0)