Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a705be5
add awhy us section
aboiyon Sep 25, 2023
fed8479
clean code up
aboiyon Nov 3, 2023
8d1a91d
add clothes page
aboiyon Nov 3, 2023
07c6ab5
add services to retrieve data from db
aboiyon Nov 3, 2023
fde56c8
refactor: fix base url for api
aboiyon Nov 3, 2023
ac9c6bf
add a list of kids clothes
aboiyon Nov 7, 2023
07dfa40
add kid detail component
aboiyon Nov 7, 2023
9372bc0
Fix: display prices correctly
aboiyon Nov 8, 2023
6781e4c
add product detail components for women and men
aboiyon Nov 8, 2023
f4bc401
refactor: nest men and women components to home section
aboiyon Nov 8, 2023
e58a7ec
fix routes to men and women details components
aboiyon Nov 9, 2023
425daa2
clean code up
aboiyon Nov 9, 2023
c149c73
add main page and nest navbar, footer, kids, men and women components…
aboiyon Nov 11, 2023
b7a1a36
add logo
aboiyon Nov 11, 2023
1397b70
add links to various sections of website in the nav bar and correspon…
aboiyon Nov 11, 2023
8a2e229
refactor: add nav links to home section banners pointing to specific …
aboiyon Nov 11, 2023
29fa0be
add banner images
aboiyon Nov 11, 2023
2e6f3c4
refactor: adjust margins to match the design
aboiyon Nov 11, 2023
7e2e7e6
refactor: move borders styles from global css to main page css file
aboiyon Nov 11, 2023
cd61e0e
refactor: adjust margins for banners in small devices
aboiyon Nov 12, 2023
d51d5ad
HotFix
aboiyon Nov 12, 2023
5199054
refactor: adjust margin top for left banner to match project design
aboiyon Nov 12, 2023
0d93e74
add facebook, instagram, and x logos
aboiyon Nov 12, 2023
5f354a4
add shop logo to the footer
aboiyon Nov 12, 2023
487445f
refactor: add margins and borders to product detail page
aboiyon Nov 13, 2023
28c7aa8
add re-useable product detail component
aboiyon Nov 13, 2023
a5b117e
add product datail component to declarations
aboiyon Nov 13, 2023
6eeb998
remove redundant code
aboiyon Nov 13, 2023
ad1e0cd
HotFix
aboiyon Nov 13, 2023
ec6aff3
fix product detail section display for tablets and mobile devices
aboiyon Nov 13, 2023
a44aa7c
fix route to landing page
aboiyon Nov 13, 2023
603a326
handle collapse state of navbar by closing it when a link to a produc…
aboiyon Nov 13, 2023
8004bd0
scroll to the top of the component when it is loaded
aboiyon Nov 15, 2023
955a47c
fix a typo in scrollIntoView method
aboiyon Nov 15, 2023
03cdbd7
remove redundant images since images are now being served from the ba…
aboiyon Nov 15, 2023
a1e98cc
add designer component
aboiyon Nov 15, 2023
115ad2c
add designer service
aboiyon Nov 15, 2023
998bf1c
add designer detail component
aboiyon Nov 15, 2023
96a589b
export designer component and nest it to main page
aboiyon Nov 15, 2023
c98fc97
optimize imports
aboiyon Nov 15, 2023
3b56ade
add scroll function
aboiyon Nov 17, 2023
bb444ca
add cart service
aboiyon Nov 18, 2023
6f76b14
add cart component and service
aboiyon Nov 29, 2023
2da24b0
bugfix: changed type for map to any for name property of product, thi…
aboiyon Nov 29, 2023
106b0af
refactor: move subtotal from h3 to a new line for better ui/ux
aboiyon Nov 29, 2023
b2b78d2
fix: set scroll to the top of the component when it is loaded
aboiyon Dec 5, 2023
4dc9f0f
refactor: remove redundant links
aboiyon Dec 5, 2023
86cbde2
refactor: remove redundant routes to product and product detail and r…
aboiyon Dec 5, 2023
c98f96f
clean code up
aboiyon Dec 5, 2023
08abc9f
remove redundant products component
aboiyon Dec 5, 2023
f76400d
feat: add product size property
aboiyon Dec 5, 2023
f7b700d
refactor: use table to display items in the cart
aboiyon Dec 6, 2023
a020223
add reusable image components
aboiyon Dec 6, 2023
48d0315
remove redundant modules
aboiyon Dec 11, 2023
5e0ee5b
add a banner component
aboiyon Dec 11, 2023
b698343
before adding product to the cart, check if the requested quantity is…
aboiyon Jan 9, 2024
1ce1725
fix:add correct number of items to cart
aboiyon Jan 9, 2024
c1161cb
add product color andquantity
aboiyon Jan 10, 2024
5e69422
Merge pull request #9 from aboiyon/quantity-color
aboiyon Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home-section/home/home.component';
import { NavBarComponent } from './shared/components/nav-bar/nav-bar.component';
import { FooterComponent } from './shared/components/footer/footer.component';
import { MainPageComponent } from './home-section/main-page/main-page.component';

const routes: Routes = [

export const routes: Routes = [
{
path: 'nav', component: NavBarComponent
path: '',
// loadChildren: () => import('/home/cheruiyot/clotours/src/app/home-section/home.module').then (m => m.HomeModule)
component: MainPageComponent,
pathMatch: 'full',
},
{
path: 'footer', component: FooterComponent
},
{
path: '', component: HomeComponent
}
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class AppRoutingModule { }
export class AppRoutingModule {}
5 changes: 2 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<app-nav-bar></app-nav-bar>
<!-- <app-nav-bar></app-nav-bar> -->
<router-outlet></router-outlet>
<app-footer></app-footer>
<!-- <app-item-quantity></app-item-quantity> -->
<!-- <app-footer></app-footer> -->
14 changes: 6 additions & 8 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { HomeComponent } from './home-section/home/home.component';
import { HomeModule } from './home-section/home/home.module';
import { HomeModule } from './home-section/home.module';

import { ProductsModule } from './features/products/products.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand All @@ -18,19 +17,18 @@ import { MatSelectModule } from '@angular/material/select';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatListModule } from '@angular/material/list';
import { HomeRoutingModule } from './home-section/home/home-routing.module';
import { HomeRoutingModule } from './home-section/home-routing.module';
import { SharedModule } from './shared/shared.module';
import { CartModule } from './features/cart/cart.module';
import { DataModule } from './data/data.module';
import { CheckoutModule } from './features/checkout/checkout.module';
import { AuthModule } from './features/auth/auth.module';
import { CurrencyPipe } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';


@NgModule({
declarations: [
AppComponent,
HomeComponent
AppComponent
],
imports: [
BrowserModule,
Expand All @@ -52,9 +50,9 @@ import { CurrencyPipe } from '@angular/common';
DataModule,
CheckoutModule,
AuthModule,

HttpClientModule
],
providers: [{ provide: LOCALE_ID, useValue: 'en-US' }, CurrencyPipe],
providers: [{ provide: LOCALE_ID, useValue: 'en-US' }],
bootstrap: [AppComponent]
})
export class AppModule { }
18 changes: 0 additions & 18 deletions src/app/core/components/header/header.component.html

This file was deleted.

68 changes: 0 additions & 68 deletions src/app/core/components/header/header.component.ts

This file was deleted.

26 changes: 2 additions & 24 deletions src/app/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HeaderComponent } from './components/header/header.component';
import { ErrorComponent } from './components/error/error.component';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { RouterModule } from '@angular/router';
import { SharedModule } from '../shared/shared.module';



// @NgModule({
// declarations: [
// HeaderComponent,
// ErrorComponent,
// NotFoundComponent
// ],
// imports: [
// CommonModule,
// RouterModule.forChild([
// { path: '404', component: NotFoundComponent },
// { path: 'error', component: ErrorComponent },
// { path: '**', redirectTo: '/404' }
// ]
// }),

// export class CoreModule { }

@NgModule({
declarations: [HeaderComponent, NotFoundComponent, ErrorComponent],
declarations: [NotFoundComponent, ErrorComponent],
imports: [
RouterModule.forChild([
{ path: '404', component: NotFoundComponent },
{ path: 'error', component: ErrorComponent },
{ path: '**', redirectTo: '/404' }
]),
// MatBadgeModule,
SharedModule
],
exports: [
HeaderComponent,

]
})
export class CoreModule { }
29 changes: 29 additions & 0 deletions src/app/features/cart/cart/cart.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.nav {
margin-bottom: 10%;
}

.cart {
height: auto;
}

.totals {
margin-top: 5%;
margin-bottom: 10%;
}

.item-image {
height: 20%;
width: 20%;
}

@media (max-width: 1024px) {
.nav {
margin-bottom: 20%;
}
}

@media (max-width: 768px) {
.nav {
margin-bottom: 30%;
}
}
71 changes: 71 additions & 0 deletions src/app/features/cart/cart/cart.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<app-nav-bar class="nav"></app-nav-bar>
<div class="container cart">
<h1>Cart</h1>
<div class="row">
<table class="table">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Product</th>
<th scope="col">Price</th>
<th scope="col">Quantity</th>
</tr>
</thead>
<tbody *ngFor="let entry of items | keyvalue">
<tr>
<th scope="row">
<img [src]="entry.value.item.imageUrl" alt="product.name" />
</th>
<td>
<span> {{ entry.value.item.name }}</span>
</td>
<td>
<span> {{ entry.value.item.price | currency }}</span>
</td>
<td>
<span> {{ entry.value.quantity }}</span>
</td>
</tr>
</tbody>
</table>

<h3>Subtotal Cost: {{ calculateSubtotal() | currency }}</h3>

<div>
<form [formGroup]="checkoutForm" (ngSubmit)="onSubmit()">
<div>
<label for="name"> Name </label>
<input id="name" type="text" formControlName="name" />
</div>

<div>
<label for="address"> Address </label>
<input id="address" type="text" formControlName="address" />
</div>

<div>
<label for="shipping"> Shipping options</label>
<select
id="shipping"
formControlName="shipping"
(change)="onShippingChange()"
>
<option
*ngFor="let option of shippingOptions"
[value]="option.type"
>
{{ option.type }}: {{ option.price | currency }}
</option>
</select>
</div>

<h3>Shipping Cost: {{ shippingCost | currency }}</h3>

<h3>Total Cost: {{ totalCost | currency }}</h3>

<button class="button" type="submit">Proceed to checkout</button>
</form>
</div>
</div>
</div>
<app-footer class="footer"></app-footer>
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ToursComponent } from './tours.component';
import { CartComponent } from './cart.component';

describe('ToursComponent', () => {
let component: ToursComponent;
let fixture: ComponentFixture<ToursComponent>;
describe('CartComponent', () => {
let component: CartComponent;
let fixture: ComponentFixture<CartComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ToursComponent]
declarations: [CartComponent]
});
fixture = TestBed.createComponent(ToursComponent);
fixture = TestBed.createComponent(CartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
Loading