Skip to content

Commit

Permalink
(feature/allow-user-select-multiple-addresses): Add sidenav links and…
Browse files Browse the repository at this point in the history
… select address containers
  • Loading branch information
zessu committed Jun 18, 2019
1 parent 6da4efb commit bd5862d
Show file tree
Hide file tree
Showing 13 changed files with 1,074 additions and 964 deletions.
2 changes: 1 addition & 1 deletion shop/mobile-ionic/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const routes: Routes = [
path: '**',
pathMatch: 'full',
redirectTo: ''
}
},
];

@NgModule({
Expand Down
59 changes: 20 additions & 39 deletions shop/mobile-ionic/src/app/components/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@
<ion-list>
<ion-item-group>
<ion-menu-toggle [autoHide]="true">
<ion-item
routerLink="/products"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/user-addresses" routerDirection="root" routerLinkActive="activated">
<ion-icon ios="md-pin" md="md-pin"></ion-icon>
<ion-label>
{{'sidemenu.settings.location.title' | translate }}
</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-item-group>

<ion-item-group>
<ion-menu-toggle [autoHide]="true">
<ion-item routerLink="/products" routerDirection="root" routerLinkActive="activated">
<ion-icon ios="md-basket" md="md-basket"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.NO_TITLE.ITEMS.PRODUCTS'
| translate
}}</ion-label>
</ion-item>
<ion-item
routerLink="/orders-history"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/orders-history" routerDirection="root" routerLinkActive="activated">
<ion-icon name="cart"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.NO_TITLE.ITEMS.ORDER_HISTORY'
Expand Down Expand Up @@ -53,12 +56,10 @@
<ion-menu-toggle [autoHide]="true">
<ion-item>
<ion-icon name="information-circle"></ion-icon>
<ion-label
>{{
<ion-label>{{
'SIDE_MENU.GROUPS.STORE.ITEMS.ABOUT' | translate
}}
{{ merchant.name }}</ion-label
>
{{ merchant.name }}</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-item-group>
Expand All @@ -72,11 +73,7 @@
</ion-item-divider>

<ion-menu-toggle [autoHide]="true">
<ion-item
routerLink="/language"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/language" routerDirection="root" routerLinkActive="activated">
<ion-icon name="globe"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.SETTINGS.ITEMS.LANGUAGE'
Expand All @@ -93,11 +90,7 @@
</ion-item-divider>

<ion-menu-toggle [autoHide]="true">
<ion-item
routerLink="/info/help"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/info/help" routerDirection="root" routerLinkActive="activated">
<ion-icon name="help-circle"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.INFO.ITEMS.FAQ' | translate
Expand All @@ -110,11 +103,7 @@
| translate
}}</ion-label>
</ion-item>
<ion-item
routerLink="/info/about"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/info/about" routerDirection="root" routerLinkActive="activated">
<ion-icon name="information-circle"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.INFO.ITEMS.ABOUT_US' | translate
Expand All @@ -131,21 +120,13 @@
</ion-item-divider>

<ion-menu-toggle [autoHide]="true">
<ion-item
routerLink="/info/privacy"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/info/privacy" routerDirection="root" routerLinkActive="activated">
<ion-icon name="lock"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.LEGALS.ITEMS.PRIVACY' | translate
}}</ion-label>
</ion-item>
<ion-item
routerLink="/info/terms-of-use"
routerDirection="root"
routerLinkActive="activated"
>
<ion-item routerLink="/info/terms-of-use" routerDirection="root" routerLinkActive="activated">
<ion-icon name="list-box"></ion-icon>
<ion-label>{{
'SIDE_MENU.GROUPS.LEGALS.ITEMS.TERMS_OF_USE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ export class OrderInfoPage implements OnInit, OnDestroy {
return result.replace(
'%s',
`${
this.order
? (<Order>this.order).totalPrice.toFixed(2)
: '00.00'
this.order
? (<Order>this.order).totalPrice.toFixed(2)
: '00.00'
}$`
);
};
Expand Down
9 changes: 7 additions & 2 deletions shop/mobile-ionic/src/app/pages/pages.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const routes: Routes = [
loadChildren: './+products/products.module#ProductsPageModule',
canLoad: [ProductsModuleGuard]
},
{
path: 'user-addresses',
loadChildren: './user-locations/user-locations.module#UserLocationsPageModule',
canLoad: [ProductsModuleGuard]
},
{
path: 'products/product-details/:id',
loadChildren:
Expand All @@ -28,7 +33,7 @@ const routes: Routes = [
canLoad: [OrdersHistoryModuleGuard]
},
{
path: 'invite',
path: ' ',
loadChildren: './+invite/invite.module#InvitePageModule',
canLoad: [InviteModuleGuard]
},
Expand Down Expand Up @@ -83,4 +88,4 @@ const routes: Routes = [
],
exports: [RouterModule]
})
export class PagesModule {}
export class PagesModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';

import { IonicModule } from '@ionic/angular';

import { UserLocationsPage } from './user-locations.page';

const routes: Routes = [
{
path: '',
component: UserLocationsPage
}
];

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [UserLocationsPage]
})
export class UserLocationsPageModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ion-item-group#address-info {
margin-bottom: 20px;
}

ion-button#save {
margin-bottom: 10px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="start">
<ion-menu-button autoHide="false"></ion-menu-button>
</ion-buttons>
<ion-title>Location Settings</ion-title>
</ion-toolbar>
</ion-header>

<ion-content>
<ion-card>
<ion-card-header>
<ion-card-title>Add new address</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-item-group id="address-info">
<ion-row>
<ion-col size="12">
<ion-item>
<ion-input placeholder="City"></ion-input>
</ion-item>
</ion-col>
<ion-col size="12">
<ion-item>
<ion-input placeholder="Street"></ion-input>
</ion-item>
</ion-col>
<ion-col size="6">
<ion-item>
<ion-input placeholder="House"></ion-input>
</ion-item>
</ion-col>
<ion-col size="6">
<ion-item>
<ion-input placeholder="Apartment"></ion-input>
</ion-item>
</ion-col>
</ion-row>
</ion-item-group>
<ion-button id="save" color="secondary" expand="full">
<ion-ripple-effect type="unbounded"></ion-ripple-effect>
SAVE
</ion-button>
<ion-item lines="none">
<ion-icon name="compass"></ion-icon>Use Current Location
</ion-item>
</ion-card-content>
</ion-card>
</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { UserLocationsPage } from './user-locations.page';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UserLocationsPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(UserLocationsPage);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'e-cu-user-locations',
templateUrl: './user-locations.page.html',
styleUrls: ['./user-locations.page.css'],
})
export class UserLocationsPage implements OnInit {

constructor() { }

ngOnInit() {
}

}
Loading

0 comments on commit bd5862d

Please sign in to comment.