diff --git a/src/app/app.component.ts b/src/app/app.component.ts index eda4e24..c145e19 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,7 @@ import { AfterViewInit, Component, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { LayerRef, LayerService } from '@vcl/ng-vcl'; -import { CookiePreferenceComponent } from './components/cookie-preference/cookie-preference.component'; +import { CookiePreferenceComponent } from './core/components/cookie-preference/cookie-preference.component'; @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index acd43e5..22a3fc1 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,20 +3,7 @@ import { ScrollingModule } from '@angular/cdk/scrolling'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import { OverlayModule } from '@angular/cdk/overlay'; -import { - VCLDrawerModule, - VCLFontAwesomeModule, - VCLInputModule, - VCLMaterialDesignModule, - VCLPasswordInputModule, - VCLSelectModule, - VCLSelectListModule, - VCLFormControlGroupModule, - VCLTabNavModule, - VCLRadioButtonModule, - VCLFlipSwitchModule, - IconResolverService, -} from '@vcl/ng-vcl'; +import { VCLDrawerModule, IconResolverService } from '@vcl/ng-vcl'; import { TranslateModule, TranslateLoader, @@ -29,15 +16,6 @@ import { MaterialDesignVCLIconAliasResolverService } from './shared/icon-resolve import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { ServiceTeaserComponent } from './components/service-teaser/service-teaser.component'; -import { PromotionBarComponent } from './components/promotion-bar/promotion-bar.component'; -import { NavigationComponent } from './components/navigation/navigation.component'; -import { TopBarComponent } from './components/top-bar/top-bar.component'; -import { TopPromotionComponent } from './components/top-promotion/top-promotion.component'; -import { NewsletterBarComponent } from './components/newsletter-bar/newsletter-bar.component'; -import { FooterTopComponent } from './components/footer-top/footer-top.component'; -import { HeaderComponent } from './components/header/header.component'; -import { CookiePreferenceComponent } from './components/cookie-preference/cookie-preference.component'; import { LAZYLOAD_IMAGE_HOOKS, @@ -45,53 +23,26 @@ import { ScrollHooks, } from 'ng-lazyload-image'; import { ClickStopPropagation } from './shared/click-stop-propagation.directive'; -import { MenuLayerContentComponent } from './components/top-bar/menu-layer-content/menu-layer-content.component'; -import { MenuLayerTitleComponent } from './components/top-bar/menu-layer-title/menu-layer-title.component'; import { HoverColorPickerDirective } from './directives/hover-color-picker-directive.service'; import { GraphQLModule } from './graphql.module'; import { ProductsModule } from './features/products/products.module'; import { SharedModule } from './shared/shared.module'; import { CheckoutModule } from './features/checkout/checkout.module'; import { CartModule } from './features/cart/cart.module'; +import { CoreModule } from './core/core.module'; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); } -const vclModules = [ - VCLDrawerModule, - VCLFontAwesomeModule, - VCLInputModule, - VCLMaterialDesignModule, - VCLPasswordInputModule, - VCLSelectModule, - VCLSelectListModule, - VCLTabNavModule, - VCLRadioButtonModule, - VCLFormControlGroupModule, - VCLFlipSwitchModule, -]; +const vclModules = []; @NgModule({ - declarations: [ - AppComponent, - ServiceTeaserComponent, - PromotionBarComponent, - NavigationComponent, - TopBarComponent, - TopPromotionComponent, - NewsletterBarComponent, - FooterTopComponent, - HeaderComponent, - ClickStopPropagation, - MenuLayerContentComponent, - MenuLayerTitleComponent, - CookiePreferenceComponent, - HoverColorPickerDirective, - ], + declarations: [AppComponent, ClickStopPropagation, HoverColorPickerDirective], imports: [ BrowserModule.withServerTransition({ appId: 'serverApp' }), BrowserAnimationsModule, + CoreModule, ProductsModule, CheckoutModule, CartModule, diff --git a/src/app/components/top-bar/menu-layer-content/menu-layer-content.component.ts b/src/app/components/top-bar/menu-layer-content/menu-layer-content.component.ts deleted file mode 100644 index 141b5a6..0000000 --- a/src/app/components/top-bar/menu-layer-content/menu-layer-content.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-menu-layer-content', - templateUrl: './menu-layer-content.component.html', - styleUrls: ['./menu-layer-content.component.scss'] -}) -export class MenuLayerContentComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/components/cookie-preference/cookie-preference.component.html b/src/app/core/components/cookie-preference/cookie-preference.component.html similarity index 100% rename from src/app/components/cookie-preference/cookie-preference.component.html rename to src/app/core/components/cookie-preference/cookie-preference.component.html diff --git a/src/app/components/cookie-preference/cookie-preference.component.scss b/src/app/core/components/cookie-preference/cookie-preference.component.scss similarity index 100% rename from src/app/components/cookie-preference/cookie-preference.component.scss rename to src/app/core/components/cookie-preference/cookie-preference.component.scss diff --git a/src/app/components/cookie-preference/cookie-preference.component.ts b/src/app/core/components/cookie-preference/cookie-preference.component.ts similarity index 82% rename from src/app/components/cookie-preference/cookie-preference.component.ts rename to src/app/core/components/cookie-preference/cookie-preference.component.ts index 4a2180b..b51b9b9 100644 --- a/src/app/components/cookie-preference/cookie-preference.component.ts +++ b/src/app/core/components/cookie-preference/cookie-preference.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Optional } from '@angular/core'; +import { Component, Optional } from '@angular/core'; import { Router } from '@angular/router'; import { ComponentLayerRef } from '@vcl/ng-vcl'; @@ -7,7 +7,7 @@ import { ComponentLayerRef } from '@vcl/ng-vcl'; templateUrl: './cookie-preference.component.html', styleUrls: ['./cookie-preference.component.scss'], }) -export class CookiePreferenceComponent implements OnInit { +export class CookiePreferenceComponent { constructor( private router: Router, @Optional() private layer?: ComponentLayerRef @@ -24,8 +24,6 @@ export class CookiePreferenceComponent implements OnInit { analytics: true, }; - ngOnInit(): void {} - close(newPrefernces: {} = {}) { const references = { ...this.allPreferences, ...newPrefernces }; this.layer && this.layer.close(references); diff --git a/src/app/components/footer-top/footer-top.component.html b/src/app/core/components/footer-top/footer-top.component.html similarity index 100% rename from src/app/components/footer-top/footer-top.component.html rename to src/app/core/components/footer-top/footer-top.component.html diff --git a/src/app/components/footer-top/footer-top.component.scss b/src/app/core/components/footer-top/footer-top.component.scss similarity index 100% rename from src/app/components/footer-top/footer-top.component.scss rename to src/app/core/components/footer-top/footer-top.component.scss diff --git a/src/app/components/footer-top/footer-top.component.ts b/src/app/core/components/footer-top/footer-top.component.ts similarity index 100% rename from src/app/components/footer-top/footer-top.component.ts rename to src/app/core/components/footer-top/footer-top.component.ts diff --git a/src/app/components/header/header.component.html b/src/app/core/components/header/header.component.html similarity index 100% rename from src/app/components/header/header.component.html rename to src/app/core/components/header/header.component.html diff --git a/src/app/components/header/header.component.scss b/src/app/core/components/header/header.component.scss similarity index 100% rename from src/app/components/header/header.component.scss rename to src/app/core/components/header/header.component.scss diff --git a/src/app/components/header/header.component.ts b/src/app/core/components/header/header.component.ts similarity index 100% rename from src/app/components/header/header.component.ts rename to src/app/core/components/header/header.component.ts diff --git a/src/app/components/top-bar/menu-layer-content/menu-layer-content.component.html b/src/app/core/components/menu-layer-content/menu-layer-content.component.html similarity index 100% rename from src/app/components/top-bar/menu-layer-content/menu-layer-content.component.html rename to src/app/core/components/menu-layer-content/menu-layer-content.component.html diff --git a/src/app/components/top-bar/menu-layer-content/menu-layer-content.component.scss b/src/app/core/components/menu-layer-content/menu-layer-content.component.scss similarity index 100% rename from src/app/components/top-bar/menu-layer-content/menu-layer-content.component.scss rename to src/app/core/components/menu-layer-content/menu-layer-content.component.scss diff --git a/src/app/core/components/menu-layer-content/menu-layer-content.component.ts b/src/app/core/components/menu-layer-content/menu-layer-content.component.ts new file mode 100644 index 0000000..84b3a7f --- /dev/null +++ b/src/app/core/components/menu-layer-content/menu-layer-content.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-menu-layer-content', + templateUrl: './menu-layer-content.component.html', + styleUrls: ['./menu-layer-content.component.scss'], +}) +export class MenuLayerContentComponent { + constructor() {} +} diff --git a/src/app/components/top-bar/menu-layer-title/menu-layer-title.component.html b/src/app/core/components/menu-layer-title/menu-layer-title.component.html similarity index 100% rename from src/app/components/top-bar/menu-layer-title/menu-layer-title.component.html rename to src/app/core/components/menu-layer-title/menu-layer-title.component.html diff --git a/src/app/components/top-bar/menu-layer-title/menu-layer-title.component.scss b/src/app/core/components/menu-layer-title/menu-layer-title.component.scss similarity index 100% rename from src/app/components/top-bar/menu-layer-title/menu-layer-title.component.scss rename to src/app/core/components/menu-layer-title/menu-layer-title.component.scss diff --git a/src/app/components/top-bar/menu-layer-title/menu-layer-title.component.ts b/src/app/core/components/menu-layer-title/menu-layer-title.component.ts similarity index 100% rename from src/app/components/top-bar/menu-layer-title/menu-layer-title.component.ts rename to src/app/core/components/menu-layer-title/menu-layer-title.component.ts diff --git a/src/app/components/navigation/navigation.component.html b/src/app/core/components/navigation/navigation.component.html similarity index 100% rename from src/app/components/navigation/navigation.component.html rename to src/app/core/components/navigation/navigation.component.html diff --git a/src/app/components/navigation/navigation.component.scss b/src/app/core/components/navigation/navigation.component.scss similarity index 100% rename from src/app/components/navigation/navigation.component.scss rename to src/app/core/components/navigation/navigation.component.scss diff --git a/src/app/components/navigation/navigation.component.ts b/src/app/core/components/navigation/navigation.component.ts similarity index 50% rename from src/app/components/navigation/navigation.component.ts rename to src/app/core/components/navigation/navigation.component.ts index 0483b2a..413e70c 100644 --- a/src/app/components/navigation/navigation.component.ts +++ b/src/app/core/components/navigation/navigation.component.ts @@ -1,19 +1,15 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { Router } from '@angular/router'; @Component({ selector: 'app-navigation', templateUrl: './navigation.component.html', - styleUrls: ['./navigation.component.scss'] + styleUrls: ['./navigation.component.scss'], }) -export class NavigationComponent implements OnInit { - - constructor(private router: Router) { } - - ngOnInit(): void { } +export class NavigationComponent { + constructor(private router: Router) {} public navigate(value: string): void { this.router.navigateByUrl(value); } - } diff --git a/src/app/components/newsletter-bar/newsletter-bar.component.html b/src/app/core/components/newsletter-bar/newsletter-bar.component.html similarity index 100% rename from src/app/components/newsletter-bar/newsletter-bar.component.html rename to src/app/core/components/newsletter-bar/newsletter-bar.component.html diff --git a/src/app/components/newsletter-bar/newsletter-bar.component.scss b/src/app/core/components/newsletter-bar/newsletter-bar.component.scss similarity index 100% rename from src/app/components/newsletter-bar/newsletter-bar.component.scss rename to src/app/core/components/newsletter-bar/newsletter-bar.component.scss diff --git a/src/app/components/newsletter-bar/newsletter-bar.component.ts b/src/app/core/components/newsletter-bar/newsletter-bar.component.ts similarity index 50% rename from src/app/components/newsletter-bar/newsletter-bar.component.ts rename to src/app/core/components/newsletter-bar/newsletter-bar.component.ts index 31b93b4..d494a85 100644 --- a/src/app/components/newsletter-bar/newsletter-bar.component.ts +++ b/src/app/core/components/newsletter-bar/newsletter-bar.component.ts @@ -3,13 +3,8 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-newsletter-bar', templateUrl: './newsletter-bar.component.html', - styleUrls: ['./newsletter-bar.component.scss'] + styleUrls: ['./newsletter-bar.component.scss'], }) -export class NewsletterBarComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - +export class NewsletterBarComponent { + constructor() {} } diff --git a/src/app/components/promotion-bar/promotion-bar.component.html b/src/app/core/components/promotion-bar/promotion-bar.component.html similarity index 100% rename from src/app/components/promotion-bar/promotion-bar.component.html rename to src/app/core/components/promotion-bar/promotion-bar.component.html diff --git a/src/app/components/promotion-bar/promotion-bar.component.scss b/src/app/core/components/promotion-bar/promotion-bar.component.scss similarity index 100% rename from src/app/components/promotion-bar/promotion-bar.component.scss rename to src/app/core/components/promotion-bar/promotion-bar.component.scss diff --git a/src/app/components/promotion-bar/promotion-bar.component.ts b/src/app/core/components/promotion-bar/promotion-bar.component.ts similarity index 50% rename from src/app/components/promotion-bar/promotion-bar.component.ts rename to src/app/core/components/promotion-bar/promotion-bar.component.ts index b43002d..0b37d0a 100644 --- a/src/app/components/promotion-bar/promotion-bar.component.ts +++ b/src/app/core/components/promotion-bar/promotion-bar.component.ts @@ -3,13 +3,8 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-promotion-bar', templateUrl: './promotion-bar.component.html', - styleUrls: ['./promotion-bar.component.scss'] + styleUrls: ['./promotion-bar.component.scss'], }) -export class PromotionBarComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - +export class PromotionBarComponent { + constructor() {} } diff --git a/src/app/components/service-teaser/service-teaser.component.html b/src/app/core/components/service-teaser/service-teaser.component.html similarity index 100% rename from src/app/components/service-teaser/service-teaser.component.html rename to src/app/core/components/service-teaser/service-teaser.component.html diff --git a/src/app/components/service-teaser/service-teaser.component.scss b/src/app/core/components/service-teaser/service-teaser.component.scss similarity index 100% rename from src/app/components/service-teaser/service-teaser.component.scss rename to src/app/core/components/service-teaser/service-teaser.component.scss diff --git a/src/app/components/service-teaser/service-teaser.component.ts b/src/app/core/components/service-teaser/service-teaser.component.ts similarity index 61% rename from src/app/components/service-teaser/service-teaser.component.ts rename to src/app/core/components/service-teaser/service-teaser.component.ts index 34d5cd1..7542688 100644 --- a/src/app/components/service-teaser/service-teaser.component.ts +++ b/src/app/core/components/service-teaser/service-teaser.component.ts @@ -4,17 +4,12 @@ import { Router } from '@angular/router'; @Component({ selector: 'app-service-teaser', templateUrl: './service-teaser.component.html', - styleUrls: ['./service-teaser.component.scss'] + styleUrls: ['./service-teaser.component.scss'], }) -export class ServiceTeaserComponent implements OnInit { - - constructor(private router: Router) { } - - ngOnInit(): void { - } +export class ServiceTeaserComponent { + constructor(private router: Router) {} public navigate(value: string): void { this.router.navigateByUrl(value); } - } diff --git a/src/app/components/top-bar/top-bar.component.html b/src/app/core/components/top-bar/top-bar.component.html similarity index 100% rename from src/app/components/top-bar/top-bar.component.html rename to src/app/core/components/top-bar/top-bar.component.html diff --git a/src/app/components/top-bar/top-bar.component.scss b/src/app/core/components/top-bar/top-bar.component.scss similarity index 100% rename from src/app/components/top-bar/top-bar.component.scss rename to src/app/core/components/top-bar/top-bar.component.scss diff --git a/src/app/components/top-bar/top-bar.component.ts b/src/app/core/components/top-bar/top-bar.component.ts similarity index 100% rename from src/app/components/top-bar/top-bar.component.ts rename to src/app/core/components/top-bar/top-bar.component.ts diff --git a/src/app/components/top-promotion/top-promotion.component.html b/src/app/core/components/top-promotion/top-promotion.component.html similarity index 100% rename from src/app/components/top-promotion/top-promotion.component.html rename to src/app/core/components/top-promotion/top-promotion.component.html diff --git a/src/app/components/top-promotion/top-promotion.component.scss b/src/app/core/components/top-promotion/top-promotion.component.scss similarity index 100% rename from src/app/components/top-promotion/top-promotion.component.scss rename to src/app/core/components/top-promotion/top-promotion.component.scss diff --git a/src/app/components/top-promotion/top-promotion.component.ts b/src/app/core/components/top-promotion/top-promotion.component.ts similarity index 50% rename from src/app/components/top-promotion/top-promotion.component.ts rename to src/app/core/components/top-promotion/top-promotion.component.ts index c054917..ed66f66 100644 --- a/src/app/components/top-promotion/top-promotion.component.ts +++ b/src/app/core/components/top-promotion/top-promotion.component.ts @@ -3,13 +3,8 @@ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-top-promotion', templateUrl: './top-promotion.component.html', - styleUrls: ['./top-promotion.component.scss'] + styleUrls: ['./top-promotion.component.scss'], }) -export class TopPromotionComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - +export class TopPromotionComponent { + constructor() {} } diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts new file mode 100644 index 0000000..b71112f --- /dev/null +++ b/src/app/core/core.module.ts @@ -0,0 +1,50 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ServiceTeaserComponent } from './components/service-teaser/service-teaser.component'; +import { PromotionBarComponent } from './components/promotion-bar/promotion-bar.component'; +import { NavigationComponent } from './components/navigation/navigation.component'; +import { TopBarComponent } from './components/top-bar/top-bar.component'; +import { TopPromotionComponent } from './components/top-promotion/top-promotion.component'; +import { NewsletterBarComponent } from './components/newsletter-bar/newsletter-bar.component'; +import { FooterTopComponent } from './components/footer-top/footer-top.component'; +import { HeaderComponent } from './components/header/header.component'; +import { MenuLayerContentComponent } from './components/menu-layer-content/menu-layer-content.component'; +import { MenuLayerTitleComponent } from './components/menu-layer-title/menu-layer-title.component'; +import { + VCLFlipSwitchModule, + VCLFormControlGroupModule, + VCLSelectListModule, + VCLSelectModule, +} from '@vcl/ng-vcl'; +import { SharedModule } from '../shared/shared.module'; +import { CartModule } from '../features/cart/cart.module'; +import { CookiePreferenceComponent } from './components/cookie-preference/cookie-preference.component'; + +const vclModules = [ + VCLSelectModule, + VCLSelectListModule, + // VCLTabNavModule, + VCLFormControlGroupModule, + VCLFlipSwitchModule, +]; + +const components = [ + ServiceTeaserComponent, + PromotionBarComponent, + NavigationComponent, + TopBarComponent, + TopPromotionComponent, + NewsletterBarComponent, + FooterTopComponent, + HeaderComponent, + MenuLayerContentComponent, + MenuLayerTitleComponent, + CookiePreferenceComponent, +]; + +@NgModule({ + declarations: [...components], + imports: [CommonModule, CartModule, SharedModule, ...vclModules], + exports: [...components], +}) +export class CoreModule {}