Skip to content

Conversation

@stackyism
Copy link
Contributor

What kind of change does this PR introduce?

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

What is the current behavior?

/packages/app/src/app/pages/common/Modals/PreferencesModal/PaymentInfo/index.tsx was a React Component using inject and observer from app/componentConnectors

What is the new behavior?

The above-mentioned class is a functional component now, converted with the help of useEffect & useCallback hooks.

What steps did you take to test this?

  • Successfully ran yarn typecheck, yarn lint & yarn test.

  • Some steps taken only to test if PaymentInfo was rendering fine.

    • removed hasSubscription check from PreferencesModal/index.js
    • hardcoded last4, name & brand to avoid reading null paymentDetails.
    • used jwt token from my codesandbox account to access preferences Menu.
  • Result :

    1. PaymentInfo rendered successfully.
    2. A call was made to payment_details api to fetch details which was rejected.
    3. After showing Loading payment details..., it finally rendered
    4. An error occured: Something went wrong while processing the request.

Checklist

  • Documentation
  • Testing
  • Ready to be merged
  • Added myself to contributors table

@vercel vercel bot temporarily deployed to staging October 5, 2019 22:27 Inactive
@vercel
Copy link

vercel bot commented Oct 5, 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/fbtr0zl67
🌍 Preview: https://codesandbox-clie-git-fork-stackyism-refactor-payment-inf-0589d9.codesandbox1.now.sh

@vercel vercel bot temporarily deployed to staging October 5, 2019 22:35 Inactive
@stackyism stackyism force-pushed the refactor-payment-info-index branch from 0512a8a to c73567f Compare October 5, 2019 22:37
@vercel vercel bot temporarily deployed to staging October 5, 2019 22:46 Inactive
@Saeris Saeris added Hacktoberfest 🔨 Refactor 🧠 Overmind Indicates that this is related to the app's State Management labels Oct 8, 2019
Saagar Takhi added 2 commits October 12, 2019 04:36
@stackyism stackyism force-pushed the refactor-payment-info-index branch from c5e03f1 to ffe6e12 Compare October 11, 2019 23:06
@vercel vercel bot temporarily deployed to staging October 11, 2019 23:06 Inactive
@stackyism
Copy link
Contributor Author

@CompuIves @christianalfoni Closing this as #2763 got merged before this.

@stackyism stackyism closed this Oct 16, 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.

2 participants