Migrated depreciated imports

This commit is contained in:
itzMiney committed 2025-12-24 00:52:47 +01:00
1 parent 47428ee891
commit 381b76de9c
26 files changed
+2132 -1621

No files matched your search

@@ -1,37 +1,43 @@
<div id="vanta-article-bg"></div>
<div class="height-container">
<div class="article-container" *ngIf="!loading && article; else error">
<div>
<!-- Article Title -->
<h1>{{ article.title }}</h1>
<div class="content-container">
<!-- Article Content -->
<div #articleContent class="article-content" [innerHTML]="article.content"></div>
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
<!-- Article Metadata -->
<div class="article-meta">
<p><strong>Author:</strong> {{ article.authorName}}</p>
<p><strong>Views:</strong> {{ article.views }}</p><br><button (click)="copyLink()" [ngStyle]="{'background-color':copied ? '#22b34b' : ''}">{{ copied ? 'Copied' : 'Share' }}</button>
<p><strong>{{ 'CREATED_AT' | translate }}</strong> {{ article.createdAt | date:'MMM dd, yyyy, HH:mm' }}</p>
@if (!loading && article) {
<div class="article-container">
<div>
<!-- Article Title -->
<h1>{{ article.title }}</h1>
<div class="content-container">
<!-- Article Content -->
<div #articleContent class="article-content" [innerHTML]="article.content"></div>
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
<!-- Article Metadata -->
<div class="article-meta">
<p><strong>Author:</strong> {{ article.authorName}}</p>
<p><strong>Views:</strong> {{ article.views }}</p><br><button (click)="copyLink()" [ngStyle]="{'background-color':copied ? '#22b34b' : ''}">{{ copied ? 'Copied' : 'Share' }}</button>
<p><strong>{{ 'CREATED_AT' | translate }}</strong> {{ article.createdAt | date:'MMM dd, yyyy, HH:mm' }}</p>
</div>
</div>
</div>
<!-- Modal -->
@if (selectedImage) {
<div class="modal" (click)="closePreview()">
<img [src]="selectedImage" alt="Full Preview" />
</div>
}
</div>
<!-- Modal -->
<div class="modal" *ngIf="selectedImage" (click)="closePreview()">
<img [src]="selectedImage" alt="Full Preview" />
</div>
</div>
} @else {
@if (!loading && error) {
<div class="error-message">
<h1>404</h1>
<p>{{ 'ARTICLE_NOTFOUND' | translate }}</p>
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
</div>
}
}
<!-- Loading State-->
<div *ngIf="loading" class="loading-container">
<div class="spinner"></div>
</div>
<!-- Error Message -->
<ng-template #error>
<div class="error-message" *ngIf="!loading && error">
<h1>404</h1>
<p>{{ 'ARTICLE_NOTFOUND' | translate }}</p>
<a href="/blog"><button>{{ 'ARTICLE_BACK' | translate }}</button></a>
@if (loading) {
<div class="loading-container">
<div class="spinner"></div>
</div>
</ng-template>
}
<!-- Error Message -->
</div>
@@ -1,6 +1,6 @@
import {AfterViewInit, Component, ElementRef, Inject, OnDestroy, OnInit, PLATFORM_ID, ViewChild} from '@angular/core';
import {DeviceDetectorService} from '../../shared/services/device-detector.service'
import {DatePipe, isPlatformBrowser, NgIf, NgStyle} from '@angular/common';
import { DatePipe, isPlatformBrowser, NgStyle } from '@angular/common';
import {VantaBackgroundService} from '../../shared/services/vanta-background.service';
import {ArticleService} from '../../shared/services/article.service';
import {ActivatedRoute} from '@angular/router';
@@ -22,11 +22,10 @@ interface Article {
@Component({
selector: 'app-article-page',
imports: [
NgIf,
DatePipe,
NgStyle,
TranslatePipe
],
],
templateUrl: './article-page.component.html',
styleUrl: './article-page.component.css'
})
+12 -9
View File
@@ -6,15 +6,18 @@
</div>
<hr class="rounded">
<div class="blog-container">
<div *ngIf="articles$ | async as articles; else noArticles">
<div *ngFor="let article of articles.slice().reverse()" (click)="navigateToArticle(article.slug)" class="article-card">
<h2>{{ (article.title | slice:0:45) + (article.title.length > 40 ? '...' : '')}}</h2>
<p>{{ truncateContent(article.content, 80) }}</p>
<p><small>By {{ article.authorName }} | {{ article.createdAt | date: 'dd/MM/yy, HH:mm' }}</small></p>
@if (articles$ | async; as articles) {
<div>
@for (article of articles.slice().reverse(); track article) {
<div (click)="navigateToArticle(article.slug)" class="article-card">
<h2>{{ (article.title | slice:0:45) + (article.title.length > 40 ? '...' : '')}}</h2>
<p>{{ truncateContent(article.content, 80) }}</p>
<p><small>By {{ article.authorName }} | {{ article.createdAt | date: 'dd/MM/yy, HH:mm' }}</small></p>
</div>
}
</div>
</div>
} @else {
<h2>{{ 'ARTICLES_NONE' | translate }}</h2>
}
</div>
<ng-template #noArticles>
<h2>{{ 'ARTICLES_NONE' | translate }}</h2>
</ng-template>
</div>
+2 -4
View File
@@ -1,6 +1,6 @@
import {AfterViewInit, Component, Inject, OnDestroy, OnInit, PLATFORM_ID} from '@angular/core';
import {DeviceDetectorService} from '../shared/services/device-detector.service'
import {DatePipe, isPlatformBrowser, NgIf, NgFor, AsyncPipe, SlicePipe, NgStyle} from '@angular/common';
import { DatePipe, isPlatformBrowser, AsyncPipe, SlicePipe, NgStyle } from '@angular/common';
import {VantaBackgroundService} from '../shared/services/vanta-background.service';
import { ArticleService } from '../shared/services/article.service';
import { Router } from '@angular/router';
@@ -11,14 +11,12 @@ import {TranslatePipe} from '@ngx-translate/core';
@Component({
selector: 'app-blog',
imports: [
NgIf,
NgFor,
DatePipe,
AsyncPipe,
SlicePipe,
NgStyle,
TranslatePipe
],
],
templateUrl: './blog.component.html',
styleUrl: './blog.component.css'
})