aboutsummaryrefslogtreecommitdiff
path: root/src/mobile/ImageUpload.tsx
blob: 6e15b0802fa50fa6b6e1f6665030edd176967403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as ReactDOM from 'react-dom'; 
import React = require('react');
import "./ImageUpload.scss"



const onPointerDown = (e: React.TouchEvent) => {
    let imgInput = document.getElementById("input_image_file"); 
    if (imgInput){
        imgInput.click(); 
    }
}

ReactDOM.render((
    <div className = "imgupload_cont">
        <button className = "button_file" onTouchStart = {onPointerDown}> Open Image </button>
        <input type= "file" accept = "image/*" capture="camera" className = "input_file" id = "input_image_file"></input>
        
    </div>),
    document.getElementById('root')
);