Open c-shultz opened 5 years ago
We have 2 approaches for this and we should decide which one to go instead of testing/updating both PR:
We create sub components and add "Show more" button to each package. This involves refactoring the function to React components, and created a new sub component to handle "packages shipping rates" which has local states to handle the show more event. Each component is responsible to do its own thing, more details in comment here: https://github.com/Automattic/woocommerce-services/pull/1781
We create a "shipping rate with show more" component, but pass down the show more event to its child ShippingRates
component. ShippingRates
component will render show more using existing function. This also makes it easier to migrate to hooks if we upgrade to 16.8+. More info here:
https://github.com/Automattic/woocommerce-services/pull/1782
cc @budzanowski
We need to make a judgement call here and get this thing closed out, @harriswong since you're the assignee go ahead and make that call and lets get it closed, we have to ship before the next roundtable
@laurendavissmith, @harriswong I say let's roll with #1781 as it was tested more. After the release, we will do the react bump and quickly revert to the easiest solution that will be available then.
Sounds good. We can merge once https://github.com/Automattic/woocommerce-services/pull/1781 is approved.
Follow-up to #1773 (see comment https://github.com/Automattic/woocommerce-services/pull/1773#issuecomment-548152025)
We should hide rates behind a "view more" link if there are more than 5 in the rates list for a given package. (the above screenshot is only showing 4 rates, but if there were more, they should be hidden)