-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: allow to set a empty state for index table #456
Conversation
sifthedog
commented
Oct 23, 2024
•
edited
Loading
edited
- Adds possibility to pass an empty state to index table
a3505a3
to
b9cbedb
Compare
<tbody> | ||
<% @data.each do |row| %> | ||
<%= render Polaris::BaseComponent.new(**row_arguments(row)) do %> | ||
<% if @data.empty? %> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 🙂
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 |
b9cbedb
to
e11d742
Compare
@@ -0,0 +1,19 @@ | |||
<% data = [] %> | |||
<%= polaris_index_table(data) do |table| %> | |||
<% table.with_column("Name") do |row| %> |
There was a problem hiding this comment.
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
e11d742
to
4198f4a
Compare
4198f4a
to
812e09e
Compare
There was a problem hiding this 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!