Skip to content

Commit

Permalink
Modularize the cart layer
Browse files Browse the repository at this point in the history
  • Loading branch information
belsman committed Jan 11, 2024
1 parent b398e75 commit cf29e25
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ import {
ScrollHooks,
} from 'ng-lazyload-image';
import { ClickStopPropagation } from './shared/click-stop-propagation.directive';
import { CartLayerItemComponent } from './components/cart-layer-item/cart-layer-item.component';
import { CartLayerContentsComponent } from './components/cart-layer-contents/cart-layer-contents.component';
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 './cart/cart.module';

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
Expand Down Expand Up @@ -85,8 +84,6 @@ const vclModules = [
FooterTopComponent,
HeaderComponent,
ClickStopPropagation,
CartLayerItemComponent,
CartLayerContentsComponent,
MenuLayerContentComponent,
MenuLayerTitleComponent,
CookiePreferenceComponent,
Expand All @@ -97,6 +94,7 @@ const vclModules = [
BrowserAnimationsModule,
ProductsModule,
CheckoutModule,
CartModule,
AppRoutingModule,
HttpClientModule,
LazyLoadImageModule,
Expand Down
21 changes: 21 additions & 0 deletions src/app/cart/cart.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CartLayerItemComponent } from './components/cart-layer-item/cart-layer-item.component';
import { CartLayerContentsComponent } from './components/cart-layer-contents/cart-layer-contents.component';
import { SharedModule } from '../shared/shared.module';
import {
VCLFormControlGroupModule,
VCLInputModule,
VCLSelectModule,
} from '@vcl/ng-vcl';

const components = [CartLayerContentsComponent, CartLayerItemComponent];

const vclModules = [VCLInputModule, VCLSelectModule, VCLFormControlGroupModule];

@NgModule({
declarations: [...components],
imports: [CommonModule, SharedModule, ...vclModules],
exports: [...components],
})
export class CartModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { CartService } from 'src/app/services/cart.service';
templateUrl: './cart-layer-item.component.html',
styleUrls: ['./cart-layer-item.component.scss'],
})
export class CartLayerItemComponent implements OnInit {
export class CartLayerItemComponent {
constructor(public cartService: CartService) {}

@Input() cartItem: any;

ngOnInit(): void {}
}

0 comments on commit cf29e25

Please sign in to comment.