Skip to content

Instantly share code, notes, and snippets.

@pnispel
Created September 7, 2017 17:41
Show Gist options
  • Save pnispel/d99fef051d42d5452423e1a9b8b98b27 to your computer and use it in GitHub Desktop.
Save pnispel/d99fef051d42d5452423e1a9b8b98b27 to your computer and use it in GitHub Desktop.
react without es6 or jsx
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