@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
22import React from 'react' ;
33import { connect } from 'react-redux' ;
44import { withRouter } from 'react-router' ;
5- import { Link , browserHistory } from 'react-router' ;
5+ import { Link } from 'react-router' ;
66import InlineSVG from 'react-inlinesvg' ;
77import classNames from 'classnames' ;
88import * as IDEActions from '../modules/IDE/actions/ide' ;
@@ -167,8 +167,6 @@ class Nav extends React.PureComponent {
167167
168168 handleLogout ( ) {
169169 this . props . logoutUser ( ) ;
170- // if you're on the settings page, probably.
171- browserHistory . push ( '/' ) ;
172170 this . setDropdown ( 'none' ) ;
173171 }
174172
@@ -184,7 +182,8 @@ class Nav extends React.PureComponent {
184182 }
185183
186184 handleShare ( ) {
187- this . props . showShareModal ( ) ;
185+ const { username } = this . props . params ;
186+ this . props . showShareModal ( this . props . project . id , this . props . project . name , username ) ;
188187 this . setDropdown ( 'none' ) ;
189188 }
190189
@@ -717,6 +716,7 @@ Nav.propTypes = {
717716 } ) . isRequired ,
718717 project : PropTypes . shape ( {
719718 id : PropTypes . string ,
719+ name : PropTypes . string ,
720720 owner : PropTypes . shape ( {
721721 id : PropTypes . string
722722 } )
@@ -742,7 +742,10 @@ Nav.propTypes = {
742742 layout : PropTypes . oneOf ( [ 'dashboard' , 'project' ] ) ,
743743 rootFile : PropTypes . shape ( {
744744 id : PropTypes . string . isRequired
745- } ) . isRequired
745+ } ) . isRequired ,
746+ params : PropTypes . shape ( {
747+ username : PropTypes . string
748+ } )
746749} ;
747750
748751Nav . defaultProps = {
@@ -752,7 +755,10 @@ Nav.defaultProps = {
752755 } ,
753756 cmController : { } ,
754757 layout : 'project' ,
755- warnIfUnsavedChanges : undefined
758+ warnIfUnsavedChanges : undefined ,
759+ params : {
760+ username : undefined
761+ }
756762} ;
757763
758764function mapStateToProps ( state ) {
0 commit comments