be5f5775ef
- ng update @angular/core@20 @angular/cli@20 @angular/material@20 @angular-eslint@20 @angular/google-maps@20 - Remove ng-chartist (abandoned, incompatible with Angular 20): replace <x-chartist> with <app-bars-chart> in dropzones-bar and jumps-by-month - Migrate all constructor injection to inject() function (ng generate @angular/core:inject, 67 files) - TypeScript 5.5 → 5.9.3 - DOCUMENT import moved from @angular/common to @angular/core (automatic migration) - tsconfig moduleResolution updated to "bundler"
59 lines
2.3 KiB
TypeScript
59 lines
2.3 KiB
TypeScript
import { DatePipe } from '@angular/common';
|
|
import { Title } from '@angular/platform-browser';
|
|
import { trigger, state, style, animate, transition } from '@angular/animations';
|
|
import { Component, DestroyRef, inject, OnInit } from '@angular/core';
|
|
import { MatCardModule } from '@angular/material/card';
|
|
import { MatDividerModule } from '@angular/material/divider';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
|
|
import { ListErrorsComponent } from '@components/shared';
|
|
import { Errors } from '@models';
|
|
//import { UtilitiesService } from '@services';
|
|
//import { UserService } from '@services';
|
|
@Component({
|
|
selector: 'app-home',
|
|
imports: [DatePipe, MatCardModule, MatDividerModule, MatIconModule, ListErrorsComponent],
|
|
templateUrl: './home.component.html',
|
|
styleUrl: './home.component.scss',
|
|
animations: [
|
|
trigger('flyInOut', [
|
|
state('in', style({ transform: 'translateY(0)' })),
|
|
transition('void => *', [style({ transform: 'translateY(-100%)' }), animate(200)]),
|
|
transition('* => void', [style({ transform: 'translateY(100%)' }), animate(200)]),
|
|
]),
|
|
],
|
|
})
|
|
export class HomeComponent implements OnInit {
|
|
private _titleService = inject(Title);
|
|
|
|
public title = 'Shop bientôt disponible!';
|
|
public description = "Encore un peu de patience, notre shop sera mis en ligne d'ici peu.";
|
|
public errors: Errors = { errors: {} };
|
|
public destroyRef = inject(DestroyRef);
|
|
public now = new Date();
|
|
|
|
ngOnInit() {
|
|
this._titleService.setTitle(this.title);
|
|
/*
|
|
type CreateArrayWithLengthX<
|
|
LENGTH extends number,
|
|
ACC extends unknown[] = [],
|
|
> = ACC['length'] extends LENGTH
|
|
? ACC
|
|
: CreateArrayWithLengthX<LENGTH, [...ACC, 1]>;
|
|
|
|
type NumericRange<
|
|
START_ARR extends number[],
|
|
END extends number,
|
|
ACC extends number = never>
|
|
= START_ARR['length'] extends END
|
|
? ACC | END
|
|
: NumericRange<[...START_ARR, 1], END, ACC | START_ARR['length']>;
|
|
|
|
//type TWENTY_TO_FORTY = NumericRange<CreateArrayWithLengthX<7>, 13, 7>;
|
|
//type TWENTY_TO_FORTY = NumericRange<CreateArrayWithLengthX<13>, 19>;
|
|
type TWENTY_TO_FORTY = NumericRange<CreateArrayWithLengthX<1>, 10>;
|
|
*/
|
|
}
|
|
}
|