Skip to content

Commit 854d690

Browse files
fix(blog): sharing en articles (#260)
1 parent d13cd07 commit 854d690

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
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
@@ -75,6 +75,7 @@ <h2 id="article-title" class="flex text-[40px] font-bold">
7575
<al-article-share-icons
7676
[slug]="articleDetails().slug"
7777
[title]="articleDetails().title"
78+
[language]="articleDetails().lang"
7879
/>
7980
</div>
8081
</al-card>

libs/blog/articles/feature-article/src/lib/article-share-icons/article-share-icons.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component, computed, input } from '@angular/core';
22
import { TranslocoDirective } from '@jsverse/transloco';
3+
import { FastSvgComponent } from '@push-based/ngx-fast-svg';
34

45
import { IconComponent, IconType } from '@angular-love/blog/shared/ui-icon';
5-
import { FastSvgComponent } from "@push-based/ngx-fast-svg";
66

77
type ShareItem = {
88
href: string;
@@ -37,9 +37,13 @@ type ShareItem = {
3737
export class ArticleShareIconsComponent {
3838
slug = input.required<string>();
3939
title = input.required<string>();
40+
language = input.required<string>();
4041

4142
readonly items = computed<ShareItem[]>(() => {
42-
const url = `https://angular.love/${this.slug()}`;
43+
const url =
44+
this.language() === 'pl_PL'
45+
? `https://angular.love/${this.slug()}`
46+
: `https://angular.love/en/${this.slug()}`;
4347
const text = encodeURIComponent(this.title());
4448

4549
return [

0 commit comments

Comments
 (0)