Skip to content

Commit

Permalink
add count slot to the chips components
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 23, 2023
1 parent 30fbf0c commit 7ad74f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 4 additions & 7 deletions app/assets/stylesheets/components/chips.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.chips-container div{
margin-right: 10px;
}

.chips-container svg path{
fill: var(--primary-color);
}
Expand All @@ -19,13 +15,14 @@
}
.chips-container div label span{
position: relative;
display: inline-block;
display: flex;
align-items: center;
background:white;
border: 0.5px solid #BDBDBD;
color: #a7a7a7;
padding: 8px;
padding: 3px;
border-radius: 5px;
font-size: 13px;
font-size: 12px;
user-select: none;

}
Expand Down
1 change: 1 addition & 0 deletions app/components/chips_component.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ChipsComponent < ViewComponent::Base
renders_one :count
def initialize(name:, value:, checked: false)
@name = name
@value = value
Expand Down
4 changes: 3 additions & 1 deletion app/components/chips_component/chips_component.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
%span
%svg.chips-check-icon{:fill => "none", :height => "8", :viewbox => "0 0 10 8", :width => "10", :xmlns => "http://www.w3.org/2000/svg"}
%path{:d => "M9.76764 0.232287C9.45824 -0.0775267 8.95582 -0.0773313 8.646 0.232287L3.59787 5.28062L1.35419 3.03696C1.04438 2.72714 0.542174 2.72714 0.23236 3.03696C-0.0774534 3.34677 -0.0774534 3.84897 0.23236 4.15879L3.03684 6.96326C3.19165 7.11807 3.39464 7.19567 3.59765 7.19567C3.80067 7.19567 4.00386 7.11827 4.15867 6.96326L9.76764 1.3541C10.0775 1.0445 10.0775 0.542081 9.76764 0.232287Z"}
= @value
%div.ml-1
= @value
= count

0 comments on commit 7ad74f1

Please sign in to comment.