Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleGlitch() {
- this.setState({ glitchLoading: true }, () => {
- this.glitcher()
- });
- }
- render() {
- let previewImage = null;
- let loader = null;
- if (this.state.originalFiles.length !== 0) {
- previewImage = <img className="folder-icon" src={placeholder} alt="" />;
- }
- if(this.state.glitchLoading) {
- console.log("loading");
- loader = <Spinner color="primary" />;
- }
- return (
- <Container className="previewComponent">
- <Row>
- <Col>
- <legend>
- <b>Upload Images:</b>
- </legend>
- <input
- className="fileInput"
- id="myfileinput"
- type="file"
- onChange={this.handleShow}
- multiple
- />
- </Col>
- </Row>
- <Row>
- <Col className="uploadField">
- <Container className="imgPreview">{previewImage}</Container>
- </Col>
- <Col className="optionField">
- <OptionsForm
- value={this.state.distortion}
- valueChange={value => {
- this.setState({ distortion: value });
- }}
- />
- <Button
- color="danger"
- onClick={this.handleGlitch}
- className="glitch-button"
- >
- Glitch Images
- </Button>
- {loader}
- </Col>
- </Row>
- </Container>
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement