@@ -15,7 +15,6 @@ import { closeAnnotationPanel } from '../actions/annotation';
1515import {
1616 resetState ,
1717 setSnippetTitle ,
18- downloadZip ,
1918 } from '../actions/app' ;
2019import {
2120 fetchGist ,
@@ -35,7 +34,6 @@ import AppMenu from '../components/menus/AppMenu';
3534import CustomPropTypes from '../util/custom-prop-types' ;
3635import SnippetMenu from '../components/menus/SnippetMenu' ;
3736import SearchMenu from '../components/menus/SearchMenu' ;
38- import DownloadDialog from '../components/DownloadDialog' ;
3937
4038const CLIENT_ID = process . env . REACT_APP_CLIENT_ID ;
4139const GITHUB_URL = `https://github.com/login/oauth/authorize?client_id=${ CLIENT_ID } &scope=read:org` ;
@@ -110,7 +108,6 @@ export class CodesplainAppBar extends Component {
110108 isLoggedIn : false ,
111109 isDialogOpen : false ,
112110 isSearchMenuOpen : false ,
113- isDownloadDialogOpen : false ,
114111 } ;
115112 this . fetchUserAccountInfo = this . fetchUserAccountInfo . bind ( this ) ;
116113 this . handleConfirmNavigation = this . handleConfirmNavigation . bind ( this ) ;
@@ -124,9 +121,6 @@ export class CodesplainAppBar extends Component {
124121 this . onLoginClick = this . onLoginClick . bind ( this ) ;
125122 this . redirectToHomePage = this . redirectToHomePage . bind ( this ) ;
126123 this . resetApplication = this . resetApplication . bind ( this ) ;
127- this . showDownloadDialog = this . showDownloadDialog . bind ( this ) ;
128- this . hideDownloadDialog = this . hideDownloadDialog . bind ( this ) ;
129- this . handleDownload = this . handleDownload . bind ( this ) ;
130124 }
131125
132126 componentDidMount ( ) {
@@ -261,20 +255,6 @@ export class CodesplainAppBar extends Component {
261255 }
262256 }
263257
264- showDownloadDialog ( ) {
265- this . setState ( { isDownloadDialogOpen : true } ) ;
266- }
267-
268- hideDownloadDialog ( ) {
269- this . setState ( { isDownloadDialogOpen : false } ) ;
270- }
271-
272- handleDownload ( selectedOrg ) {
273- const { dispatch } = this . props ;
274- dispatch ( downloadZip ( selectedOrg ) ) ;
275- this . hideDownloadDialog ( ) ;
276- }
277-
278258 render ( ) {
279259 const actions = [
280260 < FlatButton
@@ -296,22 +276,14 @@ export class CodesplainAppBar extends Component {
296276 userSnippets,
297277 gists,
298278 orderedSnippets,
299- orgs,
300279 } = this . props ;
301- const {
302- isDialogOpen,
303- isLoggedIn,
304- isSearchMenuOpen,
305- isDownloadDialogOpen,
306- } = this . state ;
307-
280+ const { isDialogOpen, isLoggedIn, isSearchMenuOpen } = this . state ;
308281 const appMenu = isLoggedIn ?
309282 ( < AppMenu
310283 avatarUrl = { avatarUrl }
311284 gists = { gists }
312285 onImportGist = { this . handleImportGist }
313286 onSignOut = { this . handleSignOut }
314- onDownloadClick = { this . showDownloadDialog }
315287 onSnippetSelected = { this . handleSnippetSelected }
316288 orgSnippets = { orgSnippets }
317289 username = { username }
@@ -373,13 +345,6 @@ export class CodesplainAppBar extends Component {
373345 orderedSnippets = { orderedSnippets }
374346 onClick = { this . handleSnippetSelected }
375347 />
376- < DownloadDialog
377- open = { isDownloadDialogOpen }
378- onDownloadClick = { this . handleDownload }
379- onCanceled = { this . hideDownloadDialog }
380- orgs = { orgs }
381- username = { username }
382- />
383348 </ div >
384349 ) ;
385350 }
@@ -395,7 +360,6 @@ CodesplainAppBar.propTypes = {
395360 userSnippets : CustomPropTypes . snippets ,
396361 orderedSnippets : CustomPropTypes . orderedSnippets ,
397362 snippetKey : PropTypes . string ,
398- orgs : CustomPropTypes . orgs ,
399363} ;
400364
401365CodesplainAppBar . defaultProps = {
@@ -407,7 +371,6 @@ CodesplainAppBar.defaultProps = {
407371 userSnippets : { } ,
408372 orderedSnippets : [ ] ,
409373 snippetKey : '' ,
410- orgs : [ ] ,
411374} ;
412375
413376const mapStateToProps = ( state ) => {
@@ -423,7 +386,6 @@ const mapStateToProps = (state) => {
423386 token,
424387 username,
425388 userSnippets,
426- orgs,
427389 } ,
428390 gists,
429391 } = state ;
@@ -439,7 +401,6 @@ const mapStateToProps = (state) => {
439401 userSnippets,
440402 orderedSnippets,
441403 snippetKey,
442- orgs,
443404 } ;
444405} ;
445406
0 commit comments