diff --git a/webroot/js/components/external-action-modal.js b/webroot/js/components/external-action-modal.js index bf7924919..0ce35b026 100644 --- a/webroot/js/components/external-action-modal.js +++ b/webroot/js/components/external-action-modal.js @@ -5,124 +5,124 @@ import MicroModal from '/js/web_modules/micromodal/dist/micromodal.min.js'; const html = htm.bind(h); export default class ExternalActionModal extends Component { - constructor(props) { - super(props); - this.state = { - iframeLoaded: false, - }; + constructor(props) { + super(props); + this.state = { + iframeLoaded: false, + }; - this.setIframeLoaded = this.setIframeLoaded.bind(this); - } - componentDidMount() { - // initialize and display Micromodal on mount - try { - MicroModal.init({ - awaitCloseAnimation: false, - awaitOpenAnimation: true, // if using css animations to open the modal. This allows it to wait for the animation to finish before focusing on an element inside the modal. - }); - MicroModal.show('external-actions-modal', { - onClose: this.props.onClose, - }); - } catch (e) { - console.error('modal error: ', e); - } - } + this.setIframeLoaded = this.setIframeLoaded.bind(this); + } + componentDidMount() { + // initialize and display Micromodal on mount + try { + MicroModal.init({ + awaitCloseAnimation: false, + awaitOpenAnimation: true, // if using css animations to open the modal. This allows it to wait for the animation to finish before focusing on an element inside the modal. + }); + MicroModal.show('external-actions-modal', { + onClose: this.props.onClose, + }); + } catch (e) { + console.error('modal error: ', e); + } + } - setIframeLoaded() { - this.setState({ - iframeLoaded: true, - }); - } + setIframeLoaded() { + this.setState({ + iframeLoaded: true, + }); + } - render() { - const { action, useIframe = true, customContent = null } = this.props; - const { url, title, description } = action; - const { iframeLoaded } = this.state; - const iframeStyle = iframeLoaded - ? null - : { backgroundImage: 'url(/img/loading.gif)' }; + render() { + const { action, useIframe = true, customContent = null } = this.props; + const { url, title, description } = action; + const { iframeLoaded } = this.state; + const iframeStyle = iframeLoaded + ? null + : { backgroundImage: 'url(/img/loading.gif)' }; - return html` -
- `; - } + return html` + + `; + } } export function ExternalActionButton({ action, onClick, label = '' }) { - const { title, icon, color = undefined, description } = action; - const logo = - icon && - html` - - `; - const bgcolor = color && { backgroundColor: `${color}` }; - const handleClick = () => onClick(action); - return html` - - `; + const { title, icon, color = undefined, description } = action; + const logo = + icon && + html` + + `; + const bgcolor = color && { backgroundColor: `${color}` }; + const handleClick = () => onClick(action); + return html` + + `; }