aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kim <andrewdkim@users.noreply.github.com>2019-03-16 23:58:19 -0400
committerAndrew Kim <andrewdkim@users.noreply.github.com>2019-03-16 23:58:19 -0400
commiteeae1bd225080e900d78d41dca3ec62d16d47e6f (patch)
treef7349b6d3217d373733c706bd445e6c375548e8d
parent7d24a1a063b0a087b51a4c521479ffcb63638d98 (diff)
Testing Mobile Image
-rw-r--r--src/mobile/ImageUpload.scss20
-rw-r--r--src/mobile/ImageUpload.tsx23
2 files changed, 35 insertions, 8 deletions
diff --git a/src/mobile/ImageUpload.scss b/src/mobile/ImageUpload.scss
new file mode 100644
index 000000000..0663b977b
--- /dev/null
+++ b/src/mobile/ImageUpload.scss
@@ -0,0 +1,20 @@
+.imgupload_cont{
+ height: 100%;
+ width: 100%;
+ align-content: center;
+
+
+ .button_file{
+ text-align: center;
+ height: 50%;
+ width: 50%;
+ background-color: paleturquoise;
+ color: grey;
+ font-size: 3em;
+ }
+ .input_file{
+ background-color: transparent;
+ display: none;
+ }
+
+} \ No newline at end of file
diff --git a/src/mobile/ImageUpload.tsx b/src/mobile/ImageUpload.tsx
index a43e6e365..6e15b0802 100644
--- a/src/mobile/ImageUpload.tsx
+++ b/src/mobile/ImageUpload.tsx
@@ -1,14 +1,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
- style={{
- position: "absolute",
- width: "100%",
- height: "100%",
- background: "yellow"
- }}
- ></div>),
+ <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')
); \ No newline at end of file