Skip to content

Refactor DashboardView.jsx: Convert legacy class component to functional component and remove unused code #2422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Akshay02022
Copy link
Contributor

@Akshay02022 Akshay02022 commented Sep 12, 2023

Ref #2358

Changes:
Refactor DashboardView.jsx: Convert legacy class component to functional component and remove unused code

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

@Akshay02022 Akshay02022 changed the title Akshay02022/refactoring dashboard view Refactor DashboardView.jsx: Convert legacy class component to functional component and remove unused code Sep 12, 2023
Comment on lines 110 to 116
useEffect(() => {
if (collectionCreateVisible) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = 'auto';
}
}, [collectionCreateVisible]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain why this is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra code was intended solely for testing scrolling behavior, which is already managed within the component.
I have now removed this test code and am ready to commit.
My apologies for any confusion. All changes have been completed, and I'm creating a new Pull Request for these updates.

const currentTab = selectedTabKey();
const owner = isOwner();
const { username } = params;
const actions = renderActionButton(currentTab, username, t);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you eliminated the unnecessary arguments from the function, you no longer need to pass them here.

@Akshay02022 Akshay02022 reopened this Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants