Skip to content
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

Adrienne / Changed layout for PM cards list in Ads page #5284

Merged

Conversation

adrienne-deriv
Copy link
Contributor

@adrienne-deriv adrienne-deriv commented Apr 20, 2022

Changes:

Please include a summary of the change and which issue is fixed below:

  • New component for Ads Payment Methods list to refactor repeated components in Create/Edit Ads form component
  • Payment Method cards in desktop layout is now displayed as a grid as per design requirements
  • Payment Method cards in mobile layout is now displayed as scrollable horizontal layout as per design requirements
    Screenshot 2022-04-20 at 12 23 12 PM
    Screenshot 2022-04-20 at 2 21 55 PM

Screenshot 2022-05-10 at 2 39 45 PM

Screenshot 2022-05-10 at 2 05 27 PM

When you need to add unit test

  • If this change disrupt current flow
  • If this change is adding new flow

When you need to add integration test

  • If components from external libraries are being used to define the flow, e.g. @deriv/components
  • If it relies on a very specific set of props with no default behavior for the current component.

Test coverage checklist (for reviewer)

  • Ensure utility / function has a test case
  • Ensure all the tests are passing

Type of change

  • Bug fix
  • New feature
  • Update feature
  • Refactor code
  • Translation to code
  • Translation to crowdin
  • Script configuration
  • Improve performance
  • Style only
  • Dependency update
  • Documentation update
  • Release

@vercel
Copy link

vercel bot commented Apr 20, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
deriv-app ✅ Ready (Inspect) Visit Preview Jun 30, 2022 at 4:43AM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Apr 21, 2022

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/5284](https://github.com/binary-com/deriv-app/pull/5284)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-adrienne-deriv-bug-57367-alignment-issues-pm.binary.sx?qa_server=frontend.binaryws.com&app_id=31229
    - **Original**: https://deriv-app-git-fork-adrienne-deriv-bug-57367-alignment-issues-pm.binary.sx
- **App ID**: `31229`

Unstage eslint formatted file `icons.js`
@@ -42,6 +38,7 @@ const CreateAdFormPaymentMethods = ({ is_sell_advert, onSelectPaymentMethods })
}
};

// eslint-disable-next-line no-unused-vars
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this added here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eslint was commenting on it previously being unused while its being used as a prop in the new component (edit: just ran npm test and now its passed, will remove the comment asap)

carolsachdeva
carolsachdeva previously approved these changes Jun 3, 2022

&--scroll {
overflow: auto;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed margin-bottom: 7.5rem as it is a bug added in previous PR which will be fixed in card Task #64742

@@ -19,6 +19,11 @@ const PaymentMethodsList = () => {

const independent_categories = ['bank_transfer', 'other'];

const sortPaymentMethodsListMethods = payment_methods_list_methods => {
const order = ['bank_transfer', 'e_wallet', 'other'];
return payment_methods_list_methods.sort((i, j) => order.indexOf(i.method) - order.indexOf(j.method));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorted payment method categories as per requirements order (Bank Transfer -> EWallets -> Others):
Screenshot 2022-06-08 at 1 43 38 PM

is_open={my_ads_store.is_quick_add_modal_open}
title={localize('Add payment method')}
title={localize('Add payment methods')}
width='440px'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be using px here? why not use rem instead

})}
);
})
.sort(payment_method_card_node =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added sorting to sort cards that has is_add to true to be rendered at the end of the list

);
return matching_payment_methods.length > 0 ? (
matching_payment_methods.map(payment_method => (
{payment_method_names
Copy link
Contributor Author

@adrienne-deriv adrienne-deriv Jun 13, 2022

Choose a reason for hiding this comment

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

Prettier formatted line 226 to line 260, only added sort() method after map() at the end

ameerul-deriv
ameerul-deriv previously approved these changes Jun 14, 2022
Copy link
Contributor

@ameerul-deriv ameerul-deriv left a comment

Choose a reason for hiding this comment

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

LGTM

nijil-deriv
nijil-deriv previously approved these changes Jun 15, 2022
nijil-deriv
nijil-deriv previously approved these changes Jun 23, 2022
@carolsachdeva carolsachdeva merged commit 3d8078e into binary-com:master Jun 30, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jun 30, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.3% 2.3% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants