Skip to content

Commit 5e482da

Browse files
committed
Adding previews for home page
1 parent 596e408 commit 5e482da

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

app/services/cms/providers/strapi/mocks/dynamic_components/content_blocks/horizontal_link_card.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HorizontalLinkCard < StrapiMock
1010
attribute(:title) { Faker::Lorem.sentence }
1111
attribute(:linkUrl) { Faker::Internet.url }
1212
attribute(:cardContent) { RichBlocks.generate_data }
13-
attribute(:theme) { ColorScheme.generate_data }
13+
attribute(:theme) { {data: ColorScheme.generate_data} }
1414
end
1515
end
1616
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Cms::BannerWithCardsComponentPreview < ViewComponent::Preview
2+
layout "full-width"
3+
4+
def default
5+
@banner_with_cards = Cms::Mocks::DynamicComponents::Blocks::BannerWithCards.as_model
6+
render(Cms::BannerWithCardsComponent.new(
7+
title: @banner_with_cards.title,
8+
text_content: @banner_with_cards.text_content,
9+
cards: @banner_with_cards.cards,
10+
background_color: "purple"
11+
))
12+
end
13+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Cms::HomepageHeroComponentPreview < ViewComponent::Preview
2+
layout "full-width"
3+
4+
def default
5+
render(Cms::HomepageHeroComponent.new(
6+
title: "Helping you teach computing",
7+
house_content: Cms::Mocks::RichBlocks.as_model,
8+
buttons: [
9+
Cms::Mocks::NcceButton.as_model
10+
]
11+
))
12+
end
13+
end

0 commit comments

Comments
 (0)