GetJobber / atlantis

🔱 Atlantis
https://atlantis.getjobber.com
MIT License
27 stars 30 forks source link

Avoid rendering title and total count elements in DataList when not provided #2167

Open kingscott opened 4 days ago

kingscott commented 4 days ago

Description

Hey Atlantis! Over on Quotemeal, we've noticed that when the DataList component can render with an margin on an empty element, causing an unexpected space on above the rows of that component. See the screenshot below:

image

This gap is due to the totalCount element (DataListTotalCount component) is rendering with container styles that have a margin-bottom set.

Either, the container can be rendered with margin: 0, or we can avoid rendering the component all together. To me, the latter feels like the more natural choice to not render the component at all to avoid empty markup on the page.

kingscott commented 4 days ago

I'll be adding a PR here to get this change in as my first Atlantis contribution 🫶