Skip to content

Commit

Permalink
refactor: restore panel shadow and overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Oct 23, 2022
1 parent 8acee23 commit a131bc1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/avo/index/resource_table_component.html.erb
@@ -1,4 +1,4 @@
<div class="w-full relative"
<div class="w-full relative overflow-auto mac-styled-scrollbar"
data-controller="item-select-all"
data-resource-name="<%= @resource.model_key %>"
data-item-select-all-selected-all-value="false"
Expand Down
2 changes: 1 addition & 1 deletion app/components/avo/panel_component.html.erb
Expand Up @@ -25,7 +25,7 @@
<% end %>
<% if body? %>
<div class="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:gap-4 w-full">
<div class="relative flex-1 <% if sidebar? %> w-2/3 overflow-auto <% else %> w-full <% end %>">
<div class="relative flex-1 <% if sidebar? %> w-2/3 <% else %> w-full <% end %>">
<% # The body is wrapped inside another div in order to avoid long & tall panels next to sidebars when the sidebar taller. %>
<div class="relative <%= white_panel_classes %> <%= @body_classes %>">
<%= body %>
Expand Down
2 changes: 1 addition & 1 deletion app/components/avo/views/resource_index_component.html.erb
Expand Up @@ -46,7 +46,7 @@
</div>
<% if view_type.to_sym == :table %>
<% if @resources.present? %>
<div class="w-full relative flex-1 flex mac-styled-scrollbar overflow-auto mt-0">
<div class="w-full relative flex-1 flex mt-0">
<%= render(Avo::Index::ResourceTableComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource, pagy: @pagy, query: @query)) %>
</div>
<% else %>
Expand Down
5 changes: 2 additions & 3 deletions app/components/avo/views/resource_show_component.html.erb
@@ -1,6 +1,4 @@
<%= content_tag :div,
# the overflow helps with long values
class: "overflow-auto",
data: {
'model-id': @resource.model.id,
selected_resources_name: @resource.model_key,
Expand Down Expand Up @@ -156,7 +154,8 @@
<% end %>
<% if main_panel.present? %>
<% c.body do %>
<div class="divide-y">
<%# the overflow helps with long values %>
<div class="divide-y overflow-auto">
<% main_panel.items.each_with_index do |field, index| %>
<%= render field
.hydrate(resource: @resource, model: @resource.model, user: @resource.user, view: view)
Expand Down

0 comments on commit a131bc1

Please sign in to comment.