Skip to content

Commit

Permalink
Merge pull request #119 from kenyonj/patch-1
Browse files Browse the repository at this point in the history
Update details_component.rb
  • Loading branch information
joelhawksley authored Oct 23, 2020
2 parents 362733a + 38ba675 commit cdb78f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## main

## 0.0.11

* Renames DetailsComponent::OVERLAY_DEFAULT to DetailsComponent::NO_OVERLAY to more correctly describe its value.

*Justin Kenyon*

## 0.0.10

* Add SpinnerComponent
Expand Down
8 changes: 4 additions & 4 deletions app/components/primer/details_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ module Primer
class DetailsComponent < Primer::Component
include ViewComponent::Slotable

OVERLAY_DEFAULT = :none
NO_OVERLAY = :none
OVERLAY_MAPPINGS = {
OVERLAY_DEFAULT => "",
NO_OVERLAY => "",
:default => "details-overlay",
:dark => "details-overlay details-overlay-dark",
}.freeze

with_slot :body, class_name: "Body"
with_slot :summary, class_name: "Summary"

def initialize(overlay: OVERLAY_DEFAULT, reset: false, **kwargs)
def initialize(overlay: NO_OVERLAY, reset: false, **kwargs)
@kwargs = kwargs
@kwargs[:tag] = :details
@kwargs[:classes] = class_names(
kwargs[:classes],
OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, OVERLAY_DEFAULT)],
OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, NO_OVERLAY)],
"details-reset" => reset
)
end
Expand Down

1 comment on commit cdb78f8

@vercel
Copy link

@vercel vercel bot commented on cdb78f8 Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.