Skip to content

Commit

Permalink
Merge branch 'feature/jenny-modular' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
breakdancingcat committed Oct 26, 2023
2 parents 0bcfc4f + e8814c9 commit 6796bbf
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 72 deletions.
2 changes: 1 addition & 1 deletion resources/views/modular/components/content-row.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{--
$item => array // ['title', 'description']
--}}
<div class="col-span-2 content">
<div class="col-span-2 content -mb-4">
@if(!empty($component['heading']))<h2 class="mt-0">{{ $component['heading'] }}</h2>@endif
@foreach($data as $content_block)
@if(!empty($component['heading']))
Expand Down
23 changes: 23 additions & 0 deletions resources/views/modular/components/icons-column.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{--
$item => array // ['title', 'link', 'excerpt', 'filename_url', 'filename_alt_text']
--}}
<div class="col-span-2 md:col-span-1">
@if(!empty($component['heading']))<h2 class="mt-0">{{ $component['heading'] }}</h2>@endif
<ul class="grid grid-cols-1 gap-6">
@foreach($data as $step)
<li>
<a class="block group" href="{{ $step['link'] }}">
<div class="flex gap-3">
<div class="w-16 grow-0 shrink-0">
@image($step['filename_url'], $step['filename_alt_text'], 'block mx-auto')
</div>
<div>
<div class="text-lg lg:text-base xl:text-xl mt-0 mb-1 underline group-hover:no-underline">{{ $step['title'] }}</div>
<p class="text-base lg:text-sm xl:text-base text-black mb-0">{{ $step['excerpt'] }}</p>
</div>
</div>
</a>
</li>
@endforeach
</ul>
</div>
2 changes: 1 addition & 1 deletion resources/views/modular/components/image-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@foreach($data as $image)
<div class="col-span-2 md:col-span-1">
@if(!empty($component['heading']))
@if(count($data) === 1 && !empty($component['heading']))
<h2 class="mt-0">{{ $component['heading'] }}</h2>
@endif
<div class="grid gap-4">
Expand Down
142 changes: 72 additions & 70 deletions styleguide/Repositories/ModularPageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,126 +16,128 @@ class ModularPageRepository extends Repository
public function getModularComponents(array $data): array
{
$components = [
'news-column-1' => [
'data' => app(Article::class)->create(3, false),
'component' => [
'heading' => 'News',
'filename' => 'news-column',
],
],
'events-column-1' => [
'data' => app(Event::class)->create(4, false),
'catalog-1' => [
'data' => app(GenericPromo::class)->create(4, false, [
'description' => '',
]),
'component' => [
'heading' => 'Events',
'filename' => 'events-column',
'heading' => 'Catalog - 4 columns',
'filename' => 'catalog',
'columns' => '4',
'showDescription' => false,
],
],

'content-row-1' => [
'data' => app(GenericPromo::class)->create(2, false),
'data' => app(GenericPromo::class)->create(1, false, [
'title' => 'Content from promos'
]),
'component' => [
'heading' => 'Content row - with heading',
'filename' => 'content-row'
'filename' => 'content-row',
],
],
'content-row-2' => [
'data' => app(GenericPromo::class)->create(2, false),

'accordion-1' => [
'data' => app(GenericPromo::class)->create(4, false),
'component' => [
'heading' => 'Promo item title (content row - no heading)',
'filename' => 'content-row',
'filename' => 'accordion',
],
],
'catalog-1' => [
'data' => app(GenericPromo::class)->create(3, false, [
'description' => '',

'image-column-1'=> [
'data' => app(GenericPromo::class)->create(1, false, [
'title' => 'Featured news (image column)',
'filename_url' => '/styleguide/image/770x434',
]),
'component' => [
'heading' => 'Catalog with three columns',
'columns' => 3,
'filename' => 'catalog',
'showExcerpt' => true,
'singlePromoView' => true,
'heading' => '',
'filename' => 'image-column',
],
],
'catalog-2' => [
'data' => app(GenericPromo::class)->create(4, false, [
'description' => '',
]),

'news-column' => [
'data' => app(Article::class)->create(3, false),
'component' => [
'heading' => 'Catalog with four columns',
'columns' => 4,
'filename' => 'catalog',
'showExcerpt' => true,
'singlePromoView' => true,
'heading' => 'Base news',
'filename' => 'news-column',
],
],
'catalog-3' => [
'data' => app(GenericPromo::class)->create(2, false, [
'excerpt' => '',

]),
'events-column' => [
'data' => app(Event::class)->create(4, false),
'component' => [
'heading' => 'Catalog with one column',
'columns' => '1',
'filename' => 'catalog',
'showExcerpt' => false,
'singlePromoView' => true,
'heading' => 'Base events',
'filename' => 'events-column',
],
],
'accordion-1' => [
'data' => app(GenericPromo::class)->create(3, false),

'image-column-2' => [
'data' => app(GenericPromo::class)->create(1, false, [
'title' => 'Featured event (image column)',
'filename_url' => '/styleguide/image/600x600',
]),
'component' => [
'heading' => 'Accordion 1',
'filename' => 'accordion',
'heading' => '',
'filename' => 'image-column',
],
],
'accordion-2' => [
'data' => app(GenericPromo::class)->create(4, false),

'catalog-2' => [
'data' => app(GenericPromo::class)->create(2, false, [
]),
'component' => [
'heading' => 'Accordion 2',
'filename' => 'accordion',
'heading' => 'Catalog - 1 column',
'filename' => 'catalog',
'columns' => '1',
'showDescription' => false,
],
],
'spotlight-1' => [
'data' => app(Spotlight::class)->create(1, false),

'icons-column' => [
'data' => app(GenericPromo::class)->create(4, false),
'component' => [
'heading' => 'Spotlights',
'filename' => 'spotlight',
'singlePromoView' => true,
'heading' => 'Icons column',
'filename' => 'icons-column',
],
],

'button-column' => [
'data' => app(GenericPromo::class)->create(3, false),
'data' => app(GenericPromo::class)->create(4, false),
'component' => [
'heading' => 'Button column',
'filename' => 'button-column'
'filename' => 'button-column',
],
],
'image-column' => [
'data' => app(GenericPromo::class)->create(1, false),

'spotlight' => [
'data' => app(Spotlight::class)->create(1, false),
'component' => [
'heading' => 'Image column',
'filename' => 'image-column'
'heading' => 'Spotlight',
'filename' => 'spotlight',
],
],

'video-row' => [
'data' => app(GenericPromo::class)->create(1, false),
'component' => [
'heading' => 'Video row',
'heading' => 'Video',
'filename' => 'video-row',
],
],
'video-column' => [

'video-column-1' => [
'data' => app(GenericPromo::class)->create(1, false),
'component' => [
'heading' => 'Video column',
'heading' => 'Video column 1',
'filename' => 'video-column',
],
],
'steps-column' => [
'data' => app(GenericPromo::class)->create(4, false),

'video-column-2' => [
'data' => app(GenericPromo::class)->create(1, false),
'component' => [
'heading' => 'Steps column',
'filename' => 'steps-column',
'heading' => 'Video column 2',
'filename' => 'video-column',
],
],
];
Expand Down

0 comments on commit 6796bbf

Please sign in to comment.