app/views/mountain_view/styleguide/show.html.erb in mountain_view-0.4.1 vs app/views/mountain_view/styleguide/show.html.erb in mountain_view-0.4.2
- old
+ new
@@ -1,21 +1,34 @@
<div class="mv-main__header">
<h1><%= @component.title %></h1>
</div>
-<% @component.styleguide_stubs.each_with_index do |component_properties, index| %>
- <div class="mv-component">
- <div class="mv-component__item">
- <%= render_component @component.name, component_properties %>
- </div>
- <div class="mv-component__description">
- <h2><%= @component.title %> <%= index + 1 %></h2>
- <div class="mv-component__description__definition">
- <code class="language-ruby"><%= render_component("<%= @component.name %>", {properties as below}) %></code>
+<% if @component.stubs? %>
+ <% @component.styleguide_stubs.each_with_index do |component_properties, index| %>
+ <div class="mv-component">
+ <div class="mv-component__item">
+ <%= render_component @component.name, component_properties %>
</div>
- <%- formatted = JSON.pretty_generate component_properties %>
- <div class="mv-component__description__properties">
- <code class="language-ruby"><%= formatted.gsub(/\"(\S+)?\":/, '\1:') %></code>
+ <div class="mv-component__description">
+ <h2><%= @component.title %> <%= index + 1 %></h2>
+ <div class="mv-component__description__definition">
+ <code class="language-ruby"><%= render_component("<%= @component.name %>", {properties as below}) %></code>
+ </div>
+ <%- formatted = JSON.pretty_generate component_properties %>
+ <div class="mv-component__description__properties">
+ <code class="language-ruby"><%= formatted.gsub(/\"(\S+)?\":/, '\1:') %></code>
+ </div>
</div>
</div>
+ <% end %>
+<% else %>
+ <div class="mv-hint">
+ <h2><span>Hint:</span>To see your component make sure you've created stubs:</h2>
+ <ul>
+ <li>
+ You should write stub examples here:
+ <br>
+ <strong><%= @component.stubs_file %></strong>
+ </li>
+ </ul>
</div>
<% end %>