Skip to content

Commit e957263

Browse files
fix(client): fixed issue with author card in article
1 parent 5fccbda commit e957263

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

libs/blog/articles/feature-article/src/lib/article-details/article-details.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ <h1 id="article-title" class="flex text-[40px] font-bold">
5353
</section>
5454
<aside class="order-3 col-span-12 lg:col-span-4">
5555
<al-author-card
56+
[articleCard]="true"
5657
[author]="articleDetails().author"
5758
[clampText]="true"
5859
[linkable]="true"

libs/blog/authors/ui-author-card/src/lib/author-card/author-card-template.component.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, input } from '@angular/core';
1+
import { Component, computed, input } from '@angular/core';
22

33
import {
44
CardComponent,
@@ -16,10 +16,12 @@ import {
1616
<al-card alGradientCard [hideGradient]="hideGradient()">
1717
<div alCardContent>
1818
<div
19-
class="flex w-full flex-col items-center rounded-lg border md:flex-row md:border-none"
19+
class="flex w-full flex-col items-center rounded-lg border"
20+
[class]="cardWrapper()"
2021
>
2122
<div
22-
class="dark:!bg-al-radial-gradient dark:bg-al-background md:light:bg-[#f2f2f2] min-w-fit rounded-lg pb-4 pt-6 md:min-w-[260px] md:border"
23+
class="min-w-fit rounded-lg pt-6 md:min-w-[260px]"
24+
[class]="authorInfoCardClass()"
2325
>
2426
<div
2527
class="flex w-full flex-col items-center gap-4 md:max-w-[360px]"
@@ -38,5 +40,16 @@ import {
3840
`,
3941
})
4042
export class AuthorCardTemplateComponent {
41-
hideGradient = input<boolean>(true);
43+
readonly hideGradient = input<boolean>(true);
44+
readonly articleCard = input<boolean>(false);
45+
46+
protected readonly cardWrapper = computed(() =>
47+
!this.articleCard() ? 'md:flex-row md:border-none' : '',
48+
);
49+
50+
protected readonly authorInfoCardClass = computed(() =>
51+
!this.articleCard()
52+
? 'md:border dark:!bg-al-radial-gradient dark:bg-al-background md:light:bg-[#f2f2f2] pb-6'
53+
: '',
54+
);
4255
}

libs/blog/authors/ui-author-card/src/lib/author-card/author-card.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<article [attr.aria-labelledby]="'author-title-' + author().slug">
2-
<al-author-card-template [hideGradient]="hideGradient()">
2+
<al-author-card-template
3+
[articleCard]="articleCard()"
4+
[hideGradient]="hideGradient()"
5+
>
36
<ng-container author-info-card>
47
@if (linkable()) {
58
<a [routerLink]="['/', 'author', author().slug] | alLocalize">

libs/blog/authors/ui-author-card/src/lib/author-card/author-card.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class AuthorCardComponent {
4646
clampText = input<boolean>();
4747
linkable = input<boolean>(false);
4848
hideGradient = input<boolean>(false);
49+
articleCard = input<boolean>(false);
4950

5051
descriptionClass = computed(
5152
() => 'text-sm' + (this.clampText() ? ' line-clamp-3' : ''),

0 commit comments

Comments
 (0)