diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-25 03:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-25 03:09:46 +0300 |
commit | b48f85e16dcdda9fa2f96b7d2fe16e0a6ba28403 (patch) | |
tree | d9384e2775056f42722cbe10648193d2a381217d /app/components | |
parent | e09f6bdfd191f0cf8e54f0bc272e4e0635990ed9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/components')
-rw-r--r-- | app/components/pajamas/card_component.html.haml | 9 | ||||
-rw-r--r-- | app/components/pajamas/card_component.rb | 21 |
2 files changed, 30 insertions, 0 deletions
diff --git a/app/components/pajamas/card_component.html.haml b/app/components/pajamas/card_component.html.haml new file mode 100644 index 00000000000..007229cc69f --- /dev/null +++ b/app/components/pajamas/card_component.html.haml @@ -0,0 +1,9 @@ +.gl-card{ @card_options } + - if header? + .gl-card-header{ @header_options } + = header + .gl-card-body{ @body_options } + = body + - if footer? + .gl-card-footer{ @footer_options } + = footer diff --git a/app/components/pajamas/card_component.rb b/app/components/pajamas/card_component.rb new file mode 100644 index 00000000000..bcc71db1c34 --- /dev/null +++ b/app/components/pajamas/card_component.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Renders a GlCard root element +module Pajamas + class CardComponent < Pajamas::Component + # @param [Hash] card_options + # @param [Hash] header_options + # @param [Hash] body_options + # @param [Hash] footer_options + def initialize(card_options: {}, header_options: {}, body_options: {}, footer_options: {}) + @card_options = card_options + @header_options = header_options + @body_options = body_options + @footer_options = footer_options + end + + renders_one :header + renders_one :body + renders_one :footer + end +end |