Show "Connecting" instead of "0% Complete" before a download starts
Also remove now-unneeded showCaret prop from <DropDown />
This commit is contained in:
parent
b524eec826
commit
94c22961c6
1 changed files with 8 additions and 15 deletions
|
@ -114,12 +114,6 @@ export let ToolTipLink = React.createClass({
|
||||||
export let DropDown = React.createClass({
|
export let DropDown = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
onCaretClick: React.PropTypes.func,
|
onCaretClick: React.PropTypes.func,
|
||||||
showCaret: React.PropTypes.bool,
|
|
||||||
},
|
|
||||||
getDefaultProps: function() {
|
|
||||||
return {
|
|
||||||
showCaret: true,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
handleCaretClicked: function(event) {
|
handleCaretClicked: function(event) {
|
||||||
/**
|
/**
|
||||||
|
@ -148,9 +142,7 @@ export let DropDown = React.createClass({
|
||||||
<div>
|
<div>
|
||||||
<Link {...other}>
|
<Link {...other}>
|
||||||
<span className="link-label">{this.props.label}</span>
|
<span className="link-label">{this.props.label}</span>
|
||||||
{this.props.showCaret
|
<Icon icon="icon-caret-down" fixed={true} onClick={this.handleCaretClicked} />
|
||||||
? <Icon icon="icon-caret-down" fixed={true} onClick={this.handleCaretClicked} />
|
|
||||||
: null}
|
|
||||||
</Link>
|
</Link>
|
||||||
{this.state.menuOpen
|
{this.state.menuOpen
|
||||||
? <Menu onClickOut={this.closeMenu}>
|
? <Menu onClickOut={this.closeMenu}>
|
||||||
|
@ -264,18 +256,19 @@ export let DownloadLink = React.createClass({
|
||||||
];
|
];
|
||||||
|
|
||||||
let linkBlock;
|
let linkBlock;
|
||||||
if (this.state.attemptingDownload || this.props.state == 'downloading') {
|
if (this.state.attemptingDownload) {
|
||||||
const progress = this.state.attemptingDownload ? 0 : this.props.progress;
|
linkBlock = <Link button="text" className="button-download button-download--bg"
|
||||||
const label = `${parseInt(progress * 100)}% complete`;
|
label="Connecting..." icon="icon-download" />
|
||||||
|
} else if (this.props.state == 'downloading') {
|
||||||
|
const label = `${parseInt(this.props.progress * 100)}% complete`;
|
||||||
linkBlock = (
|
linkBlock = (
|
||||||
<span>
|
<span>
|
||||||
<DropDown button="download" className="button-download--bg" label={label} icon="icon-download"
|
<DropDown button="download" className="button-download--bg" label={label} icon="icon-download"
|
||||||
onClick={this.handleClick} showCaret={!this.state.attemptingDownload}>
|
onClick={this.handleClick}>
|
||||||
{dropDownItems}
|
{dropDownItems}
|
||||||
</DropDown>
|
</DropDown>
|
||||||
<DropDown button="download" className="button-download--fg" label={label} icon="icon-download"
|
<DropDown button="download" className="button-download--fg" label={label} icon="icon-download"
|
||||||
onClick={this.handleClick} showCaret={!this.state.attemptingDownload}
|
onClick={this.handleClick} style={{width: `${this.props.progress * 100}%`}}>
|
||||||
style={{width: `${progress * 100}%`}}>
|
|
||||||
{dropDownItems}
|
{dropDownItems}
|
||||||
</DropDown>
|
</DropDown>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue