1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

remove react-progress-bar for react-bootstrap progressbar

This commit is contained in:
Tim Daubenschütz 2015-09-09 14:11:52 +02:00
parent 3197fad1b6
commit 801227cfee
8 changed files with 35 additions and 16 deletions

View File

@ -200,7 +200,8 @@ let MediaPlayer = React.createClass({
<br />You can leave this page and check back on the status later.</em> <br />You can leave this page and check back on the status later.</em>
</p> </p>
<ProgressBar now={this.props.encodingStatus} <ProgressBar now={this.props.encodingStatus}
label='%(percent)s%' /> label="%(percent)s%"
className="ascribe-progress-bar" />
</div> </div>
); );
} else { } else {

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import React from 'react'; import React from 'react';
import ProgressBar from 'react-progressbar'; import ProgressBar from 'react-bootstrap/lib/ProgressBar';
import FileDragAndDropDialog from './file_drag_and_drop_dialog'; import FileDragAndDropDialog from './file_drag_and_drop_dialog';
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator'; import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
@ -171,10 +171,12 @@ let FileDragAndDrop = React.createClass({
<div className={className}> <div className={className}>
<p>{getLangText('Computing hash(es)... This may take a few minutes.')}</p> <p>{getLangText('Computing hash(es)... This may take a few minutes.')}</p>
<p> <p>
<span>{Math.ceil(this.props.hashingProgress)}%</span>
<a onClick={this.props.handleCancelHashing}> {getLangText('Cancel hashing')}</a> <a onClick={this.props.handleCancelHashing}> {getLangText('Cancel hashing')}</a>
</p> </p>
<ProgressBar completed={this.props.hashingProgress} color="#48DACB"/> <ProgressBar
now={Math.ceil(this.props.hashingProgress)}
label="%(percent)s%"
className="ascribe-progress-bar"/>
</div> </div>
); );
} else { } else {

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import React from 'react'; import React from 'react';
import ProgressBar from 'react-progressbar'; import ProgressBar from 'react-bootstrap/lib/ProgressBar';
import AppConstants from '../../constants/application_constants'; import AppConstants from '../../constants/application_constants';
import { getLangText } from '../../utils/lang_utils.js'; import { getLangText } from '../../utils/lang_utils.js';
@ -60,7 +60,9 @@ let FileDragAndDropPreviewImage = React.createClass({
<div <div
className="file-drag-and-drop-preview-image" className="file-drag-and-drop-preview-image"
style={imageStyle}> style={imageStyle}>
<ProgressBar completed={this.props.progress} color="black"/> <ProgressBar
now={Math.ceil(this.props.progress)}
className="ascribe-progress-bar ascribe-progress-bar-xs"/>
{actionSymbol} {actionSymbol}
</div> </div>
); );

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import React from 'react'; import React from 'react';
import ProgressBar from 'react-progressbar'; import ProgressBar from 'react-bootstrap/lib/ProgressBar';
import AppConstants from '../../constants/application_constants'; import AppConstants from '../../constants/application_constants';
import { getLangText } from '../../utils/lang_utils.js'; import { getLangText } from '../../utils/lang_utils.js';
@ -55,7 +55,9 @@ let FileDragAndDropPreviewOther = React.createClass({
return ( return (
<div <div
className="file-drag-and-drop-preview"> className="file-drag-and-drop-preview">
<ProgressBar completed={this.props.progress} color="black"/> <ProgressBar
now={Math.ceil(this.props.progress)}
className="ascribe-progress-bar ascribe-progress-bar-xs"/>
<div className="file-drag-and-drop-preview-table-wrapper"> <div className="file-drag-and-drop-preview-table-wrapper">
<div className="file-drag-and-drop-preview-other"> <div className="file-drag-and-drop-preview-other">
{actionSymbol} {actionSymbol}

View File

@ -2,6 +2,8 @@
import React from 'react'; import React from 'react';
import ProgressBar from 'react-bootstrap/lib/ProgressBar';
let FileDragAndDropPreviewProgress = React.createClass({ let FileDragAndDropPreviewProgress = React.createClass({
propTypes: { propTypes: {
files: React.PropTypes.array files: React.PropTypes.array
@ -10,7 +12,7 @@ let FileDragAndDropPreviewProgress = React.createClass({
calcOverallProgress() { calcOverallProgress() {
let overallProgress = 0; let overallProgress = 0;
let sizeOfAllFiles = 0; let sizeOfAllFiles = 0;
let files = this.props.files.filter((file) => file.status !== 'deleted' && file.status !== 'canceled'); let files = this.props.files.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.status !== 'online');
for(let i = 0; i < files.length; i++) { for(let i = 0; i < files.length; i++) {
sizeOfAllFiles += files[i].size; sizeOfAllFiles += files[i].size;
@ -29,10 +31,10 @@ let FileDragAndDropPreviewProgress = React.createClass({
if(overallProgress !== 0) { if(overallProgress !== 0) {
return ( return (
<span <ProgressBar
className="file-drag-and-drop-progress-time"> now={Math.ceil(overallProgress)}
Overall progress: {overallProgress.toFixed(2)}% label="Overall progress: %(percent)s%"
</span> className="ascribe-progress-bar" />
); );
} else { } else {
return null; return null;

View File

@ -161,7 +161,7 @@ var ReactS3FineUploader = React.createClass({
} }
return name; return name;
}, },
multiple: false, multiple: true,
defaultErrorMessage: getLangText('Unexpected error. Please contact us if this happens repeatedly.') defaultErrorMessage: getLangText('Unexpected error. Please contact us if this happens repeatedly.')
}; };
}, },

View File

@ -73,9 +73,8 @@
"q": "^1.4.1", "q": "^1.4.1",
"raven-js": "^1.1.19", "raven-js": "^1.1.19",
"react": "^0.13.2", "react": "^0.13.2",
"react-bootstrap": "^0.24.3", "react-bootstrap": "^0.25.1",
"react-datepicker": "^0.12.0", "react-datepicker": "^0.12.0",
"react-progressbar": "^1.1.0",
"react-router": "^0.13.3", "react-router": "^0.13.3",
"react-router-bootstrap": "~0.16.0", "react-router-bootstrap": "~0.16.0",
"react-star-rating": "~1.3.2", "react-star-rating": "~1.3.2",

View File

@ -422,3 +422,14 @@ hr {
padding-bottom: 30%; padding-bottom: 30%;
text-align: center; text-align: center;
} }
.ascribe-progress-bar {
margin-bottom: 0;
> .progress-bar {
background-color: $ascribe-color-green;
}
}
.ascribe-progress-bar-xs {
height: 12px;
}