
@@ -58,9 +59,14 @@ class PostCreator extends React.PureComponent{
if (videofilter) {
return (
-
+
+
this.handleDeleteFile()} icon={} />
+
+
+
+
)
}
@@ -74,10 +80,12 @@ class PostCreator extends React.PureComponent{
ToogleUpload(){
this.setState({ uploader: !this.state.uploader })
}
-
+ handleDeleteFile = () =>{
+ this.setState({ fileURL: null })
+ }
handleFileUpload = info => {
if (info.file.status === 'uploading') {
- this.setState({ loading: true });
+ this.setState({ loading: true, });
return;
}
if (info.file.status === 'done') {
@@ -176,6 +184,15 @@ class PostCreator extends React.PureComponent{
div.removeEventListener('dragleave', this.handleDragOut)
}
+ canPost(){
+ const { fileURL, keys_remaining, } = this.state
+
+ const isTypedSomething = (keys_remaining < ycore.DevOptions.MaxLengthPosts)
+ const isUploadedFile = (fileURL? true : false)
+
+ return isUploadedFile || isTypedSomething
+ }
+
render(){
const { keys_remaining, visible, fileURL, file } = this.state;
const percent = (((keys_remaining/ycore.DevOptions.MaxLengthPosts) * 100).toFixed(2) )
@@ -196,9 +213,7 @@ class PostCreator extends React.PureComponent{
return(
-
-
{this.state.uploader?
- : (this.state.posting?
:
)} />
+ : (this.state.posting?
:
)} />
> }
-
-
-
-
{fileURL? this.renderPostPlayer(this.state.fileURL) : null}
diff --git a/src/components/PostCreator/index.less b/src/components/PostCreator/index.less
index a5aced72..3432c455 100755
--- a/src/components/PostCreator/index.less
+++ b/src/components/PostCreator/index.less
@@ -207,15 +207,22 @@
height: 100%;
// top: -100px;
margin: 0 0 15px 0;
+ background-color: #eeeeee;
.imagePreview{
z-index: 5;
position: relative;
+ width: 50%;
margin: auto;
border-radius: 8px;
+ transition: all 150ms linear;
img{
width: 100%;
border: 0.5px rgba(56, 56, 56, 0.459) solid;
}
+ video{
+ width: 100%;
+ border: 0.5px rgba(56, 56, 56, 0.459) solid;
+ }
transition: all 150ms linear;
}
@@ -224,7 +231,7 @@
position: relative;
opacity: 0;
transition: all 150ms linear;
-
+ margin: auto;
}
}
.imagePreviewWrapper:hover .imagePreview{