Skip to content

Commit

Permalink
feat(datahub): make related-record-card.component having an base clas…
Browse files Browse the repository at this point in the history
…s and extra class
  • Loading branch information
Romuald Caplier committed May 24, 2024
1 parent 56fc15c commit cf6c0c2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a
class="w-72 h-96 overflow-hidden rounded-lg bg-white cursor-pointer block hover:-translate-y-2 duration-[180ms]"
[class]="classList"
[routerLink]="['/dataset', record.uniqueIdentifier]"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, ChangeDetectionStrategy, Input } from '@angular/core'
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'

@Component({
Expand All @@ -8,5 +8,26 @@ import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RelatedRecordCardComponent {
private readonly baseClasses: string

@Input() record: CatalogRecord
@Input() extraClass = ''

constructor() {
this.baseClasses = [
'w-72',
'h-96',
'overflow-hidden',
'rounded-lg',
'bg-white',
'cursor-pointer',
'block',
'hover:-translate-y-2 ',
'duration-[180ms]',
].join(' ')
}

get classList() {
return `${this.baseClasses} ${this.extraClass}`
}
}

0 comments on commit cf6c0c2

Please sign in to comment.