Skip to content

Commit cb60d63

Browse files
committed
empty state display for quotes
1 parent b9b32a6 commit cb60d63

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

app/assets/stylesheets/application.sass.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@import "components/turbo_progress_bar";
1717
@import "components/navbar";
1818
@import "components/flash";
19+
@import "components/empty_state";
1920

2021
// Layouts
2122
@import "layouts/container";
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.empty-state {
2+
padding: var(--space-m);
3+
border: var(--border);
4+
border-style: dashed;
5+
text-align: center;
6+
7+
&__text {
8+
font-size: var(--font-size-l);
9+
color: var(--color-text-header);
10+
margin-bottom: var(--space-l);
11+
font-weight: bold;
12+
}
13+
14+
&--only-child {
15+
display: none;
16+
17+
&:only-child {
18+
display: revert;
19+
}
20+
}
21+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="empty-state empty-state--only-child">
2+
<p class="empty-state__text">
3+
You don't have any quotes yet!
4+
</p>
5+
6+
<%= link_to "Add quote",
7+
new_quote_path,
8+
class: "btn btn--primary",
9+
data: { turbo_frame: dom_id(Quote.new) } %>
10+
</div>

app/views/quotes/index.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ COMMENT
3131
<%= turbo_stream_from current_company, "quotes" %>
3232
<%= turbo_frame_tag Quote.new %>
3333
<%= turbo_frame_tag "quotes" do %>
34+
<%= render "quotes/empty_state" %>
3435
<%= render @quotes %>
3536
<% end %>
3637
</main>

0 commit comments

Comments
 (0)