- {this.state.status >= 2
- ?

+ {this.state.src
+ ?

: null
}
{this.state.status >= 0
diff --git a/src/components/UploadUnit/upload.css b/src/components/UploadUnit/upload.css
index 3a81628..c107e24 100644
--- a/src/components/UploadUnit/upload.css
+++ b/src/components/UploadUnit/upload.css
@@ -1,31 +1,35 @@
.upload-wrap {
width: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
}
.upload-unit {
- width: calc(100%);
- height: 200px;
+ width: 150px;
+ height: 150px;
min-width: 150px;
- border: 2px dashed blue;
- border-radius: 8px;
+ max-width: 100%;
box-sizing: border-box;
- transition: width .3s ease-out, height .3s ease-out, border .3s ease-out;
+ background-image: linear-gradient(45deg, #EEE 25%, transparent 25%), linear-gradient(-45deg, #EEE 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #EEE 75%), linear-gradient(-45deg, transparent 75%, #EEE 75%);
+ background-size: 10px 10px;
+ background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
+ background-color: #EEE;
+ transition: width .3s ease-out, height .3s ease-out, background-color .3s ease-out, filter .3s ease-out;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
+ filter: brightness(1.03);
}
.upload-unit.open {
width: 200px;
+ height: 200px;
border-width: 0;
+ background-color: transparent;
+ filter: none;
}
.upload-unit > img {
margin-bottom: -200px;
height: 200px;
animation: fade-in .3s ease-out;
- border-radius: 8px;
+ transition: filter .3s ease-out;
}
.upload-unit-mask {
diff --git a/src/upload/upload.css b/src/upload/upload.css
index b855635..f565873 100644
--- a/src/upload/upload.css
+++ b/src/upload/upload.css
@@ -34,17 +34,20 @@
}
.message-box {
width: 100%;
- height: 200px;
+ height: 300px;
margin-top: 40px;
}
.message-box-textarea {
width: 100%;
resize: none;
height: 100%;
+ border: none;
+ background-color: #F7F7F7;
box-sizing: border-box;
- border-radius: 8px;
+ border-radius: 0;
font-size: 16px;
- padding: 10px;
+ padding: 20px;
+ line-height: 1.5em;
}
.message-box-textarea:focus {
outline: none;
@@ -52,23 +55,36 @@
}
.upload-box {
- width: 100%;
+ margin-top: 25px;
height: 200px;
- margin-top: 15px;
}
-.upload-area {
- width: 100%;
- height: 100%;
- border: 2px dashed blue;
- border-radius: 8px;
+.upload-image-btn {
+ width: 150px;
+ height: 150px;
+ background-color: #F7F7F7;
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
cursor: pointer;
+ position: relative;
}
-.upload-area-text {
- font-size: 16px;
+.upload-image-btn > input {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ filter: opacity(0);
+ z-index: 1;
+ cursor: pointer;
+}
+.upload-image-btn > svg {
+ width: 40px;
+}
+.upload-image-btn-text {
+ margin-top: 5px;
+ font-size: 14px;
+ color: #666;
}
.btn-upload {
diff --git a/src/upload/upload.js b/src/upload/upload.js
index 23d8f1a..f4e87b5 100644
--- a/src/upload/upload.js
+++ b/src/upload/upload.js
@@ -1,5 +1,4 @@
import { Component } from 'react';
-import Dropzone from 'react-dropzone';
import Spinner from '../components/Spinner/Spinner';
import UploadUnit from '../components/UploadUnit/UploadUnit';
import { post } from '../helper/axios';
@@ -23,7 +22,8 @@ export class UploadContainer extends Component {
this.handleSubmit = this.handleSubmit.bind(this);
}
- handleChange(files) {
+ handleChange(e) {
+ const { files } = e.target;
if (files.length > 0)
this.setState({ file: files[0] });
}
@@ -69,7 +69,7 @@ export class UploadContainer extends Component {