Skip to content

Commit

Permalink
Merge pull request #22 from anvilco/pl/21/fix-classname-type-error
Browse files Browse the repository at this point in the history
Add className prop and type
  • Loading branch information
patapat authored May 2, 2024
2 parents adabaff + 03e8323 commit ad837e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/anvil-embed-frame/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PropTypes from 'prop-types'
* @prop {String} anvilURL
* @prop {String} scroll
* @prop {object} style
* @prop {string} className
*/

/**
Expand Down Expand Up @@ -47,11 +48,12 @@ class AnvilEmbedFrame extends React.Component {
}

render () {
const { iframeURL, onEvent, anvilURL, scroll, style, ...others } = this.props
const { iframeURL, onEvent, anvilURL, scroll, style, className, ...others } = this.props
return (
<iframe
id="anvil-embed-frame"
name="AnvilEmbedFrame"
className={className}
{...others} // props above may be overriden
src={iframeURL}
ref={this.iframeRef}
Expand All @@ -75,6 +77,7 @@ AnvilEmbedFrame.propTypes = {
anvilURL: PropTypes.string,
scroll: PropTypes.oneOf(['auto', 'smooth']),
style: PropTypes.object,
className: PropTypes.string,
}

export default AnvilEmbedFrame
4 changes: 4 additions & 0 deletions packages/anvil-embed-frame/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export type Props = {
anvilURL: string;
enableDefaultStyles: boolean;
scroll: string;
style: object;
className: string;
};
/**
* @typedef Props
Expand All @@ -14,6 +16,7 @@ export type Props = {
* @prop {boolean} enableDefaultStyles
* @prop {String} scroll
* @prop {object} style
* @prop {string} className
*/
/**
* @extends React.Component<Props>
Expand Down Expand Up @@ -50,6 +53,7 @@ declare namespace AnvilEmbedFrame {
export { enableDefaultStyles_1 as enableDefaultStyles };
export const scroll: PropTypes.Requireable<string>;
export const style: PropTypes.Requireable<object>;
export const className: PropTypes.Requireable<string>;
}
}
import Reacat from "react";
Expand Down

0 comments on commit ad837e6

Please sign in to comment.