@@ -6,6 +6,7 @@ import styles from './restore-point-modal.css';
66import { formatBytes } from '../../lib/tw-bytes-utils' ;
77import RestorePointAPI from '../../lib/tw-restore-point-api' ;
88import log from '../../lib/log' ;
9+ import exportIcon from './export.svg' ;
910import deleteIcon from './delete.svg' ;
1011
1112// Browser support is not perfect yet
@@ -16,6 +17,7 @@ class RestorePoint extends React.Component {
1617 super ( props ) ;
1718 bindAll ( this , [
1819 'handleClickDelete' ,
20+ 'handleClickExport' ,
1921 'handleClickLoad'
2022 ] ) ;
2123 this . state = {
@@ -69,6 +71,11 @@ class RestorePoint extends React.Component {
6971 this . props . onClickDelete ( this . props . id ) ;
7072 }
7173
74+ handleClickExport ( e ) {
75+ e . stopPropagation ( ) ;
76+ this . props . onClickExport ( this . props . id ) ;
77+ }
78+
7279 handleClickLoad ( ) {
7380 this . props . onClickLoad ( this . props . id ) ;
7481 }
@@ -129,16 +136,31 @@ class RestorePoint extends React.Component {
129136 </ div >
130137 </ div >
131138
132- < button
133- className = { styles . deleteButton }
134- onClick = { this . handleClickDelete }
135- >
136- < img
137- src = { deleteIcon }
138- alt = "Delete"
139- draggable = { false }
140- />
141- </ button >
139+ < div className = { styles . restorePointButtons } >
140+ < button
141+ className = { styles . restorePointButton }
142+ onClick = { this . handleClickExport }
143+ disabled = { this . props . isExporting }
144+ >
145+ < img
146+ src = { exportIcon }
147+ alt = "Export"
148+ draggable = { false }
149+ />
150+ </ button >
151+
152+ < button
153+ className = { styles . restorePointButton }
154+ onClick = { this . handleClickDelete }
155+ disabled = { this . props . isExporting }
156+ >
157+ < img
158+ src = { deleteIcon }
159+ alt = "Delete"
160+ draggable = { false }
161+ />
162+ </ button >
163+ </ div >
142164 </ div >
143165 ) ;
144166 }
@@ -151,7 +173,9 @@ RestorePoint.propTypes = {
151173 projectSize : PropTypes . number . isRequired ,
152174 thumbnailSize : PropTypes . number . isRequired ,
153175 assets : PropTypes . shape ( { } ) . isRequired , // Record<string, number>
176+ isExporting : PropTypes . bool . isRequired ,
154177 onClickDelete : PropTypes . func . isRequired ,
178+ onClickExport : PropTypes . func . isRequired ,
155179 onClickLoad : PropTypes . func . isRequired
156180} ;
157181
0 commit comments