import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { Row, Col, Label, Button } from 'reactstrap'; import { gettext } from '../../utils/constants'; const propTypes = { postFile: PropTypes.func.isRequired, displayName: PropTypes.string.isRequired, }; class OrgSamlConfigPostFile extends Component { constructor(props) { super(props); this.fileInput = React.createRef(); } uploadFile = () => { if (!this.fileInput.current.files.length) { return; } const file = this.fileInput.current.files[0]; this.props.postFile(file); }; openFileInput = () => { this.fileInput.current.click(); }; render() { const { displayName } = this.props; return ( ); } } OrgSamlConfigPostFile.propTypes = propTypes; export default OrgSamlConfigPostFile;