Skip to content

Conversation

@MihirGH
Copy link
Contributor

@MihirGH MihirGH commented Oct 12, 2019

🔨 Refactored, 🧠 Overmind, Hacktober | Refactor StorageManagementModal to use overmind

What kind of change does this PR introduce?

Refactors code as a part of hacktoberfest mentioned in #2621.
@Saeris @christianalfoni @SaraVieira

What is the current behavior?

/app/pages/common/Modals/StorageManagementModal/index.js was implemented using a class component without having any state and life cycle methods and also used inject and hookObserver from app/componentConnectors

What is the new behavior?

Refactored StorageManagementModal to FC and replaced inject, hookObserver with useOvermind

What steps did you take to test this? This is required before we can merge.

  1. Checked whether refactored component was working correctly or not by opening StorageManagementModal from UserMenu
  2. Ran yarn lint
  3. Ran yarn test

Checklist

  • Documentation N/A
  • Testing
  • Ready to be merged
  • Added myself to contributors table

@vercel
Copy link

vercel bot commented Oct 12, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/codesandbox/codesandbox-client/iieszkqhi
🌍 Preview: https://codesandbox-clie-git-fork-mihirgh-refactor-storemanageme-d0378d.codesandbox1.now.sh

Copy link
Contributor

@Saeris Saeris left a comment

Choose a reason for hiding this comment

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

Looks great! Just update the imports as requested and we can merge this!

} from './elements';
import FilesList from './FilesList';

const StorageManagementModal = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const StorageManagementModal = () => {
export const StorageManagementModal: React.FC = () => {

We'd like to move everything to named exports instead, so let's change this line.

);
};

export default StorageManagementModal;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export default StorageManagementModal;

And we can remove this one.

Last thing I'd need you to do for me is to search the project for imports of StorageManagementModal and update those lines to used named imports instead. Should only be a single line for a modal like this.

@MichaelDeBoey
Copy link
Contributor

Duplicate of #2808

@MichaelDeBoey MichaelDeBoey marked this as a duplicate of #2808 Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧠 Overmind Indicates that this is related to the app's State Management 🔨 Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants