added onInputFileHandler
This commit is contained in:
parent
8fd658ced9
commit
5bf6f7de50
@ -384,6 +384,8 @@ class Body extends Component {
|
|||||||
onContinueHandler = () => {
|
onContinueHandler = () => {
|
||||||
const valid = this.checkingValid();
|
const valid = this.checkingValid();
|
||||||
|
|
||||||
|
console.log(this.state.file)
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const { setPortalOwner, wizardToken } = this.props;
|
const { setPortalOwner, wizardToken } = this.props;
|
||||||
const { password, email,
|
const { password, email,
|
||||||
@ -453,6 +455,12 @@ class Body extends Component {
|
|||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onInputFileHandler = file => {
|
||||||
|
this.setState({
|
||||||
|
file: file
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
renderModalDialog = () => {
|
renderModalDialog = () => {
|
||||||
const { errorLoading, visibleModal, errorMessage } = this.state;
|
const { errorLoading, visibleModal, errorMessage } = this.state;
|
||||||
const { t, isOwner, ownerEmail } = this.props;
|
const { t, isOwner, ownerEmail } = this.props;
|
||||||
@ -547,9 +555,7 @@ class Body extends Component {
|
|||||||
placeholder={t('placeholderLicense')}
|
placeholder={t('placeholderLicense')}
|
||||||
size="large"
|
size="large"
|
||||||
scale={true}
|
scale={true}
|
||||||
onInput={(file) => {
|
onInput={this.onInputFileHandler}
|
||||||
console.log(`name: ${file.name}`, `lastModified: ${file.lastModifiedDate}`, `size: ${file.size}`);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
: null;
|
: null;
|
||||||
|
@ -87,7 +87,8 @@ class FileInput extends Component {
|
|||||||
this.inputRef = React.createRef();
|
this.inputRef = React.createRef();
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
fileName: ''
|
fileName: '',
|
||||||
|
file: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,12 +117,12 @@ class FileInput extends Component {
|
|||||||
|
|
||||||
if ( this.inputRef.current.files.length > 0 ) {
|
if ( this.inputRef.current.files.length > 0 ) {
|
||||||
this.setState({
|
this.setState({
|
||||||
fileName: this.inputRef.current.files[0].name
|
fileName: this.inputRef.current.files[0].name,
|
||||||
|
file: this.inputRef.current.files[0]
|
||||||
|
}, () => {
|
||||||
|
if(onInput) onInput(this.state.file);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(onInput) onInput(this.inputRef.current.files[0]);
|
|
||||||
} else {
|
|
||||||
this.setState({ fileName: '' })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user