Created
September 7, 2017 17:41
-
-
Save pnispel/d99fef051d42d5452423e1a9b8b98b27 to your computer and use it in GitHub Desktop.
react without es6 or jsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UploadFileToken(props) { | |
var ce = React.createElement; | |
var file = props.file; | |
return ce('div', | |
{ | |
className: 'procore-upload-file-token', | |
key: file.uuid, | |
}, | |
ce('span', { | |
className: 'procore-upload-file-token-name' | |
}, file.name), | |
!file.s3UploadFinished && ce('progress', { | |
min: 0, | |
max: 100, | |
value: file.progress | |
}), | |
ce('span', { | |
className: 'procore-upload-file-token-delete', | |
onClick: function () { props.onRemove(file.uuid) }, | |
}, 'x'), | |
ce('input', { | |
type: 'hidden', | |
name: 'attachments[][uuid]', | |
value: file.uuid | |
}), | |
ce('input', { | |
type: 'hidden', | |
name: 'attachments[][store_as_version]', | |
value: file.storeAsVersion | |
}), | |
ce('input', { | |
type: 'hidden', | |
name: 'attachments[][store_as_unique]', | |
value: file.storeAsUnique | |
}), | |
ce('input', { | |
type: 'hidden', | |
name: 'attachments[][filename]', | |
value: file.name | |
}) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment