Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let BrowserCell = ({ type, value, hidden, width, current, onSelect, onEditChange
content = JSON.stringify(value);
} else if (type === 'File') {
if (value.url()) {
content = <a href={value.url()} target='_blank'><Pill value={getFileName(value)} /></a>;
content = <Pill value={getFileName(value)} />;
} else {
content = <Pill value={'Uploading\u2026'} />;
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/FileEditor/FileEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ export default class FileEditor extends React.Component {
}

render() {
let file = this.props.value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer const

return (
<div ref='input' style={{ minWidth: this.props.width }} className={styles.editor}>
{this.props.value ? <a href='javascript:;' role='button' className={styles.delete} onClick={() => this.props.onCommit(undefined)}>Delete</a> : null}
{file && file.url() ? <a href={file.url()} target='_blank' role='button' className={styles.download}>Download</a> : null}
<a className={styles.upload}>
<input type='file' onChange={this.handleChange.bind(this)} />
<span>{this.props.value ? 'Replace file' : 'Upload file'}</span>
<span>{file ? 'Replace file' : 'Upload file'}</span>
</a>
{file ? <a href='javascript:;' role='button' className={styles.delete} onClick={() => this.props.onCommit(undefined)}>Delete</a> : null}
</div>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/FileEditor/FileEditor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
padding: 6px;
}

.delete, .upload {
.delete, .upload, .download {
@include DosisFont;
display: block;
cursor: pointer;
Expand All @@ -28,13 +28,13 @@

.delete {
background: $red;
margin-bottom: 6px;
}

.upload {
.upload, .download {
position: relative;
overflow: hidden;
background: $blue;
margin-bottom: 6px;

input {
position: absolute;
Expand Down