Skip to content

Commit 786052e

Browse files
committed
removed useEffect and unused arguments
1 parent 347aa43 commit 786052e

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

client/modules/User/pages/DashboardView.jsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import PropTypes from 'prop-types';
2-
import React, { useState, useEffect, useCallback } from 'react';
2+
import React, { useState, useCallback } from 'react';
33
import { connect } from 'react-redux';
44
import MediaQuery from 'react-responsive';
55
import { 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

Comments
 (0)