Add 3D-file-viewer component #1558

Merged
btzr-io merged 8 commits from three-viewer into master 2018-07-19 16:17:06 +02:00
4 changed files with 61 additions and 15 deletions
Showing only changes of commit e1c1096458 - Show all commits

View file

@ -1,10 +1,12 @@
// @flow
import React from 'react';
import Spinner from 'component/spinner';
import ProgressBar from 'component/common/progress-bar';
type Props = {
spinner: boolean,
status: string,
spinner: boolean,
progress?: number,
};
class LoadingScreen extends React.PureComponent<Props> {
@ -17,8 +19,8 @@ class LoadingScreen extends React.PureComponent<Props> {
return (
<div className="content__loading">
{spinner && <Spinner light />}
<span className="content__loading-text">{status}</span>
{progress && <ProgressBar progress={progress}/>}
{status && <span className="content__loading-text">{status}</span>}
</div>
);
}

View file

@ -0,0 +1,23 @@
// @flow
import React from 'react';
type Props = {
progress: number,
};
class progressBar extends React.PureComponent<Props> {
static defaultProps = {
progress: 0,
};
render() {
const { progress } = this.props;
return (
<div className="progress-bar">
<div className="progress-bar__progress" style={{width: progress}}/>
</div>
);
}
}
export default LoadingScreen;

View file

@ -19,8 +19,12 @@ type Props = {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
class ThreeViewer extends React.PureComponent<Props> {
constructor(props: Props) {
super(props);
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
const { theme } = this.props;
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
//Main container
this.viewer = React.createRef();
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
// Object colors
this.materialColors = {
red: '#e74c3c',
@ -29,12 +33,7 @@ class ThreeViewer extends React.PureComponent<Props> {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
orange: '#f39c12',
};
this.state = {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
error: null,
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
isReady: false,
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
isLoading: false,
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
};
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
// Viewer themes
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
this.themes = {
dark: {
gridColor: '#414e5c',
@ -51,8 +50,14 @@ class ThreeViewer extends React.PureComponent<Props> {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
};
// Select current theme
const { theme } = this.props;
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
this.theme = this.themes[theme] || this.themes.light;
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
// State
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
this.state = {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
error: null,
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
isReady: false,
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
isLoading: false,
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
};
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
}
createOrbitControls(camera, canvas) {
@ -186,8 +191,8 @@ class ThreeViewer extends React.PureComponent<Props> {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
}
handleProgress(url, currentItem, totalItems) {
// Handle progress
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
// TODO: Show progressbar...
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
const progress = (currentItem / totalItems) * 100;
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
this.setState({progress});
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
}
handleColorChange(color) {
@ -255,15 +260,15 @@ class ThreeViewer extends React.PureComponent<Props> {
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
}
render() {
const { isReady, isLoading, error } = this.state;
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
const { error, progress, isReady, isLoading } = this.state;
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
const loadingMessage = 'Rendering model.';
const showViewer = isReady && !error;
const showLoading = isLoading && !error;
return (
<React.Fragment>
{error && <LoadingScreen status={error} />}
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
{showLoading && <LoadingScreen status={loadingMessage} />}
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
{error && <LoadingScreen status={error} spinner={false} />}
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
{showLoading && <LoadingScreen status={loadingMessage} spinner={false} progress={progress} />}
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
<div style={{ opacity: isReady ? 1 : 0 }} className="three-viewer" ref={this.viewer} />
</React.Fragment>
);

neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
neb-b commented 2018-07-16 16:11:18 +02:00 (Migrated from github.com)
Review

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
neb-b commented 2018-07-16 16:18:25 +02:00 (Migrated from github.com)
Review

I think we will hold off on the progress bar for now, we have a progress percentage below the file.

I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.

View file

@ -0,0 +1,16 @@
.progress-bar {
width: 75%;
height: 5px;
display: block;
background: rgba(255, 255, 255, 0.25);
border-radius: 3px;
overflow: hidden;
}
.progress-bar__progress {
width: 20px;
height: 5px;
background: var(--color-primary);
border-radius: 3px;
transition: width 0.3s ease;
}