-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GB3-1685: Make discover maps generic as well
- Loading branch information
Showing
6 changed files
with
83 additions
and
107 deletions.
There are no files selected for viewing
47 changes: 30 additions & 17 deletions
47
...ed/components/lists/link-grid-list/link-grid-list-item/link-grid-list-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
<li class="link-grid-list-item"> | ||
<a [href]="this.url" [title]="this.title" rel="noopener noreferrer" target="_blank" class="link-grid-list-item__wrapper"> | ||
<div class="link-grid-list-item__wrapper__content"> | ||
<p class="mat-subtitle-2 link-grid-list-item__wrapper__content__header"> | ||
@if (this.entryType) { | ||
<strong>{{ this.entryType }}</strong> | ||
} | ||
@if (this.entryDate) { | ||
{{ this.entryDate }} | ||
} | ||
</p> | ||
<li class="link-grid-list-item" [class.link-grid-list-item--large]="size === 'large'"> | ||
@if (this.internalLink) { | ||
<a [routerLink]="this.internalLink" [queryParams]="this.internalQueryParams" [title]="this.title" class="link-grid-list-item__wrapper"> | ||
<ng-container [ngTemplateOutlet]="content"></ng-container> | ||
</a> | ||
} @else { | ||
<a [href]="this.url" [title]="this.title" rel="noopener noreferrer" target="_blank" class="link-grid-list-item__wrapper"> | ||
<ng-container [ngTemplateOutlet]="content"></ng-container> | ||
</a> | ||
} | ||
</li> | ||
|
||
<p class="mat-headline-6 link-grid-list-item__wrapper__content__title">{{ this.title }}</p> | ||
<p class="link-grid-list-item__wrapper__content__text"> | ||
<ng-content></ng-content> | ||
</p> | ||
<ng-template #content> | ||
@if (this.imageUrl && this.size === 'large') { | ||
<img [src]="this.imageUrl" alt="" class="link-grid-list-item__wrapper__image" /> | ||
} | ||
<div class="link-grid-list-item__wrapper__content"> | ||
<div class="mat-subtitle-2 link-grid-list-item__wrapper__content__header"> | ||
@if (this.entryType) { | ||
<strong>{{ this.entryType }}</strong> | ||
} | ||
@if (this.entryDate) { | ||
{{ this.entryDate }} | ||
} | ||
</div> | ||
</a> | ||
</li> | ||
|
||
<div class="mat-headline-6 link-grid-list-item__wrapper__content__title">{{ this.title }}</div> | ||
<div class="link-grid-list-item__wrapper__content__text"> | ||
<ng-content></ng-content> | ||
</div> | ||
</div> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ared/components/lists/link-grid-list/link-grid-list-item/link-grid-list-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
import {Component, Input} from '@angular/core'; | ||
import {MainPage} from '../../../../enums/main-page.enum'; | ||
import {RouterLink} from '@angular/router'; | ||
import {NgTemplateOutlet} from '@angular/common'; | ||
|
||
/** | ||
* Can be used for internal and external links; if "internalLink" is set, "url" is ignored and a RouterLink is used. | ||
* | ||
* "imageUrl" is used as a hero image; it is only applicable if size is "large". | ||
* | ||
* If size is "small", a row contains up to 3 elements; if size is "large", a row contains up to 2 elements. | ||
* | ||
* EntryType and EntryDate are optional and displayed as smaller introductory text above the title; entryType is displayed in bold. | ||
* | ||
*/ | ||
@Component({ | ||
selector: 'link-grid-list-item', | ||
templateUrl: './link-grid-list-item.component.html', | ||
styleUrls: ['./link-grid-list-item.component.scss'], | ||
imports: [RouterLink, NgTemplateOutlet], | ||
}) | ||
export class LinkGridListItemComponent { | ||
@Input() public title!: string; | ||
@Input() public url!: string; | ||
@Input() public internalLink?: MainPage; | ||
@Input() public internalQueryParams?: Record<string, string>; | ||
@Input() public entryType?: string; | ||
@Input() public entryDate?: string; | ||
@Input() public size: 'small' | 'large' = 'small'; | ||
@Input() public imageUrl?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
src/app/start-page/components/discover-maps/discover-maps.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +0,0 @@ | ||
@use 'functions/helper.function' as functions; | ||
@use 'mixins/helpers.mixin' as mixins; | ||
@use 'variables/ktzh-design-variables' as ktzh-variables; | ||
@use 'mixins/collapsing-flexbox-list.mixin' as collapsing-flexbox-list; | ||
|
||
/// The border width around the link elements | ||
$border-width: 8px; | ||
|
||
/// Number of entries to be displayed | ||
$number-of-entries: 2; | ||
|
||
.discover-maps { | ||
width: 100%; | ||
|
||
.discover-maps__list { | ||
@include collapsing-flexbox-list.list($border-width); | ||
|
||
.discover-maps__list__item { | ||
@include collapsing-flexbox-list.list__item( | ||
$border-width: $border-width, | ||
$max-content-width: ktzh-variables.$zh-layout-max-content-width, | ||
$number-of-entries: $number-of-entries, | ||
$height: 649px | ||
); | ||
|
||
.discover-maps__list__item__wrapper { | ||
@include collapsing-flexbox-list.list__item__wrapper(ktzh-variables.$zh-white); | ||
|
||
&:hover { | ||
& .discover-maps__list__item__wrapper__content__container__title { | ||
color: ktzh-variables.$zh-black100 !important; // override title color on hover | ||
} | ||
} | ||
|
||
.discover-maps__list__item__wrapper__content { | ||
.discover-maps__list__item__wrapper__content__image { | ||
display: block; | ||
width: 100%; | ||
height: 327px; | ||
object-fit: cover; | ||
object-position: center; | ||
} | ||
|
||
.discover-maps__list__item__wrapper__content__container { | ||
padding: 40px; | ||
|
||
.discover-maps__list__item__wrapper__content__container__title { | ||
@include mixins.multiline-ellipsis(2); | ||
color: ktzh-variables.$zh-blue; | ||
} | ||
|
||
.discover-maps__list__item__wrapper__content__container__text { | ||
@include mixins.multiline-ellipsis(6); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters