woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
299 stars 110 forks source link

[Woo POS] Improvement: Use shared layout object #13711

Closed iamgabrielma closed 2 weeks ago

iamgabrielma commented 3 weeks ago

From review: https://github.com/woocommerce/woocommerce-ios/pull/13707#discussion_r1727460634

This is an specific example of different places through POS where we could aggregate some of the layout constraints into a shared object:

Since this needs to be the same for CartView and ItemListView, perhaps it should be defined on a shared layout object? At the moment, POSHeaderTitleView uses top padding 24, while the Cart title has verticalPadding = 8, applied on the DynamicHStack, and an additional top padding 16 on the individual views within the header. You could neaten it up by having a shared posSectionTopPadding: CGFloat = 24, and applying that as the top padding for both the DynamicHStack here, and the POSHeaderTitleView or better yet, its container. the more careful we are now to have semantic meaning in this stuff, the more likely we are to keep it consistent as the POS grows.

dangermattic commented 3 weeks ago

Thanks for reporting! 👍