@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2
2
import React from 'react' ;
3
3
import { connect } from 'react-redux' ;
4
4
import { withRouter } from 'react-router' ;
5
- import { Link , browserHistory } from 'react-router' ;
5
+ import { Link } from 'react-router' ;
6
6
import InlineSVG from 'react-inlinesvg' ;
7
7
import classNames from 'classnames' ;
8
8
import * as IDEActions from '../modules/IDE/actions/ide' ;
@@ -167,8 +167,6 @@ class Nav extends React.PureComponent {
167
167
168
168
handleLogout ( ) {
169
169
this . props . logoutUser ( ) ;
170
- // if you're on the settings page, probably.
171
- browserHistory . push ( '/' ) ;
172
170
this . setDropdown ( 'none' ) ;
173
171
}
174
172
@@ -184,7 +182,8 @@ class Nav extends React.PureComponent {
184
182
}
185
183
186
184
handleShare ( ) {
187
- this . props . showShareModal ( ) ;
185
+ const { username } = this . props . params ;
186
+ this . props . showShareModal ( this . props . project . id , this . props . project . name , username ) ;
188
187
this . setDropdown ( 'none' ) ;
189
188
}
190
189
@@ -717,6 +716,7 @@ Nav.propTypes = {
717
716
} ) . isRequired ,
718
717
project : PropTypes . shape ( {
719
718
id : PropTypes . string ,
719
+ name : PropTypes . string ,
720
720
owner : PropTypes . shape ( {
721
721
id : PropTypes . string
722
722
} )
@@ -742,7 +742,10 @@ Nav.propTypes = {
742
742
layout : PropTypes . oneOf ( [ 'dashboard' , 'project' ] ) ,
743
743
rootFile : PropTypes . shape ( {
744
744
id : PropTypes . string . isRequired
745
- } ) . isRequired
745
+ } ) . isRequired ,
746
+ params : PropTypes . shape ( {
747
+ username : PropTypes . string
748
+ } )
746
749
} ;
747
750
748
751
Nav . defaultProps = {
@@ -752,7 +755,10 @@ Nav.defaultProps = {
752
755
} ,
753
756
cmController : { } ,
754
757
layout : 'project' ,
755
- warnIfUnsavedChanges : undefined
758
+ warnIfUnsavedChanges : undefined ,
759
+ params : {
760
+ username : undefined
761
+ }
756
762
} ;
757
763
758
764
function mapStateToProps ( state ) {
0 commit comments