@@ -9,25 +9,23 @@ const { createContainer } = require('sovereign');
99
1010const Progress = require ( './progress' ) ;
1111const deviceStore = require ( '../../src/stores/device' ) ;
12- const { download , reloadDevices, updateSelected } = require ( '../../src/actions/device' ) ;
12+ const { disableAuto , reloadDevices, updateSelected } = require ( '../../src/actions/device' ) ;
1313
1414const styles = require ( './styles' ) ;
1515
1616class DownloadOverlay extends React . Component {
1717
1818 constructor ( ) {
1919
20- this . _onAccept = this . _onAccept . bind ( this ) ;
2120 this . _onCancel = this . _onCancel . bind ( this ) ;
2221 this . _onReloadDevices = this . _onReloadDevices . bind ( this ) ;
23- this . _onUpdateSelected = this . _onUpdateSelected . bind ( this ) ;
2422
2523 }
2624
2725 componentizeDevice ( device , selectedPath ) {
2826 const highlight = device . path === selectedPath ? 'active' : 'inactive' ;
2927 return (
30- < tr style = { styles [ highlight ] } onClick = { this . _onUpdateSelected . bind ( this , device ) } >
28+ < tr style = { styles [ highlight ] } onClick = { updateSelected . bind ( this , device ) } >
3129 < td style = { styles . deviceTd } > { device . name } </ td >
3230 < td style = { styles . deviceTd } > { device . version } </ td >
3331 < td style = { styles . deviceTd } > { device . path } </ td >
@@ -36,14 +34,25 @@ class DownloadOverlay extends React.Component {
3634 }
3735
3836 render ( ) {
39- const { devices, devicePath, progress, searching } = this . props ;
37+ const { devices, devicePath, message , progress, searching } = this . props ;
4038
4139 const deviceRows = _ . map ( devices , ( device ) => this . componentizeDevice ( device , devicePath ) ) ;
4240
41+ let bottomBar ;
42+ if ( message ) {
43+ bottomBar = (
44+ < div style = { styles . overlayUserMessage } > { message } </ div >
45+ ) ;
46+ } else {
47+ bottomBar = (
48+ < Progress percent = { progress } />
49+ ) ;
50+ }
51+
4352 return (
44- < Card styles = { [ styles . overlay , styles . overlayLarge ] } >
45- < h3 style = { styles . overlayTitle } > Please choose your connected device.</ h3 >
46- < div >
53+ < Card styles = { [ styles . overlay , styles . overlayLarge , styles . overlayUnpad ] } >
54+ < h3 styles = { [ styles . overlayTitle , styles . overlayPad ] } > Please choose your connected device.</ h3 >
55+ < div style = { styles . overlayPad } >
4756 < Loader loaded = { ! searching } >
4857 < div style = { styles . deviceTableWrapper } >
4958 < div style = { styles . deviceTableScroll } >
@@ -63,28 +72,21 @@ class DownloadOverlay extends React.Component {
6372 </ div >
6473 </ Loader >
6574 </ div >
66- < div >
67- </ div >
68- < div style = { styles . overlayDevicesBottom } >
75+ < div styles = { [ styles . overlayDevicesBottom , styles . overlayPad ] } >
6976 < div style = { styles . overlayLoadingContainer } >
7077 < Button onClick = { this . _onReloadDevices } > Refresh</ Button >
7178 </ div >
7279 < div style = { styles . overlayButtonContainer } >
73- < Button onClick = { this . _onAccept } > Download</ Button >
7480 < Button onClick = { this . _onCancel } > Cancel</ Button >
7581 </ div >
7682 </ div >
77- < Progress percent = { progress } />
83+ < div style = { styles . bottomBar } >
84+ { bottomBar }
85+ </ div >
7886 </ Card >
7987 ) ;
8088 }
8189
82- _onAccept ( ) {
83- const { handleSuccess, handleError, handleComplete } = this . props ;
84-
85- download ( handleSuccess , handleError , handleComplete ) ;
86- }
87-
8890 _onCancel ( evt ) {
8991 const { onCancel } = this . props ;
9092
@@ -97,9 +99,6 @@ class DownloadOverlay extends React.Component {
9799 reloadDevices ( this . props ) ;
98100 }
99101
100- _onUpdateSelected ( device ) {
101- updateSelected ( device ) ;
102- }
103102}
104103
105104module . exports = createContainer ( DownloadOverlay , {
0 commit comments