11import PropTypes from 'prop-types' ;
2- import React , { useState , useEffect , useCallback } from 'react' ;
2+ import React , { useState , useCallback } from 'react' ;
33import { connect } from 'react-redux' ;
44import MediaQuery from 'react-responsive' ;
55import { withTranslation } from 'react-i18next' ;
@@ -103,17 +103,7 @@ const DashboardView = ({ newProject, location, params, user, t }) => {
103103 } ;
104104
105105 const currentTab = selectedTabKey ( ) ;
106- const owner = isOwner ( ) ;
107- const { username } = params ;
108- const actions = renderActionButton ( currentTab , username , t ) ;
109-
110- useEffect ( ( ) => {
111- if ( collectionCreateVisible ) {
112- document . body . style . overflow = 'hidden' ;
113- } else {
114- document . body . style . overflow = 'auto' ;
115- }
116- } , [ collectionCreateVisible ] ) ;
106+ const actions = renderActionButton ( currentTab ) ;
117107
118108 return (
119109 < RootPage fixedHeight = "100%" >
@@ -125,8 +115,8 @@ const DashboardView = ({ newProject, location, params, user, t }) => {
125115 < div className = "dashboard-header__nav" >
126116 < DashboardTabSwitcherPublic
127117 currentTab = { currentTab }
128- isOwner = { owner }
129- username = { username }
118+ isOwner = { isOwner ( ) }
119+ username = { params . username }
130120 />
131121 { actions && (
132122 < div className = "dashboard-header__actions" > { actions } </ div >
@@ -136,7 +126,7 @@ const DashboardView = ({ newProject, location, params, user, t }) => {
136126
137127 < div className = "dashboard-content" >
138128 < MediaQuery maxWidth = { 770 } >
139- { ( mobile ) => renderContent ( currentTab , username , mobile ) }
129+ { ( mobile ) => renderContent ( currentTab , params . username , mobile ) }
140130 </ MediaQuery >
141131 </ div >
142132 </ main >
0 commit comments