Commit b6c5d5a1 authored by Deni Rinaldi's avatar Deni Rinaldi

menegdoc

parent 22dc9811
......@@ -45,6 +45,13 @@ class Upload extends Component {
}
}
componentDidMount() {
if (this.props.docName !== undefined && this.props.docName !== "") {
console.log('masuk');
this.setState({ docName: this.props.docName, docSize: this.props.docSize, inputVisible: false, editVisible: true })
}
}
onDrop = (acceptedFiles) => {
const formData = new FormData()
let length = acceptedFiles[0].name.split(".").length
......@@ -116,6 +123,7 @@ class Upload extends Component {
if (this.props.intent === "management") {
this.setState({
previewVisible: false,
editVisible: false,
inputVisible: true,
uploadProgress: false,
percentage: '0'
......@@ -124,6 +132,7 @@ class Upload extends Component {
} else {
this.setState({
previewVisible: false,
editVisible: false,
inputVisible: true,
uploadProgress: false,
percentage: '0'
......@@ -187,6 +196,29 @@ class Upload extends Component {
</div>
: null}
{/* edit */}
{this.state.editVisible ?
<div className="u-p-file u-p-preview">
<div className="display-flex-normal">
<div className="width width-35px">
<button
onClick={this.onRemove}
className="btn btn-small-circle btn-black"
type="button">
<img src={Images.close} />
</button>
</div>
<div className="width width-full margin-left-10px">
<div className="txt-site txt-12 txt-white txt-bold">
{this.state.docName}
</div>
<div className="txt-site txt-11 txt-white txt-thin">
{this.state.docSize} KB
</div>
</div>
</div>
</div>
: null}
{/* file */}
{this.state.previewVisible
?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment