1
1
import PropTypes from 'prop-types' ;
2
- import React , { useState , useEffect , useCallback } from 'react' ;
2
+ import React , { useState , useCallback } from 'react' ;
3
3
import { connect } from 'react-redux' ;
4
4
import MediaQuery from 'react-responsive' ;
5
5
import { withTranslation } from 'react-i18next' ;
@@ -103,17 +103,7 @@ const DashboardView = ({ newProject, location, params, user, t }) => {
103
103
} ;
104
104
105
105
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 ) ;
117
107
118
108
return (
119
109
< RootPage fixedHeight = "100%" >
@@ -125,8 +115,8 @@ const DashboardView = ({ newProject, location, params, user, t }) => {
125
115
< div className = "dashboard-header__nav" >
126
116
< DashboardTabSwitcherPublic
127
117
currentTab = { currentTab }
128
- isOwner = { owner }
129
- username = { username }
118
+ isOwner = { isOwner ( ) }
119
+ username = { params . username }
130
120
/>
131
121
{ actions && (
132
122
< div className = "dashboard-header__actions" > { actions } </ div >
@@ -136,7 +126,7 @@ const DashboardView = ({ newProject, location, params, user, t }) => {
136
126
137
127
< div className = "dashboard-content" >
138
128
< MediaQuery maxWidth = { 770 } >
139
- { ( mobile ) => renderContent ( currentTab , username , mobile ) }
129
+ { ( mobile ) => renderContent ( currentTab , params . username , mobile ) }
140
130
</ MediaQuery >
141
131
</ div >
142
132
</ main >
0 commit comments