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

feat: allow to set a empty state for index table #456

Merged

Conversation

sifthedog
Copy link
Contributor

@sifthedog sifthedog commented Oct 23, 2024

  • Adds possibility to pass an empty state to index table

@sifthedog sifthedog force-pushed the index-table-with-empty-state branch 4 times, most recently from a3505a3 to b9cbedb Compare October 23, 2024 19:09
@sifthedog sifthedog marked this pull request as ready for review October 23, 2024 19:10
<tbody>
<% @data.each do |row| %>
<%= render Polaris::BaseComponent.new(**row_arguments(row)) do %>
<% if @data.empty? %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am too lazy to do this everytime on my app's side

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perfect motivation to improve it 🙂

@sifthedog
Copy link
Contributor Author

I plan on making more additions down the road to building my Shopify app. Let me know if contributions are welcome and what needs addressing, @kirillplatonov

@@ -0,0 +1,19 @@
<% data = [] %>
<%= polaris_index_table(data) do |table| %>
<% table.with_column("Name") do |row| %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left on purpose as a placeholder. To indicate that this is not rendered whenever data is empty

Copy link
Collaborator

@kirillplatonov kirillplatonov left a comment

Choose a reason for hiding this comment

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

Looks good to me! 👍

Thank you for your contribution. More PRs are welcome!

@kirillplatonov kirillplatonov merged commit 31b6ee1 into baoagency:main Oct 23, 2024
4 checks passed
@sifthedog sifthedog deleted the index-table-with-empty-state branch October 23, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants