Skip to content

Commit

Permalink
Add bottomNav style sample
Browse files Browse the repository at this point in the history
  • Loading branch information
tachojelev committed Oct 2, 2019
1 parent 7f7962e commit 770b06d
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 1 deletion.
16 changes: 16 additions & 0 deletions live-editing/configs/TabBarConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
BottomNavRoutingView2Component,
BottomNavRoutingView3Component,
TabbarSample3Component } from "../../src/app/layouts/tabbar/tabbar-sample-3/tabbar-sample-3.component";
import { TabbarStyleComponent } from "../../src/app/layouts/tabbar/tabbar-style/tabbar-style.component";
import { TabbarComponent } from "../../src/app/layouts/tabbar/tabbar.component";
import { AppModuleConfig } from "./core/AppModuleConfig";
import { Config } from "./core/Config";
Expand Down Expand Up @@ -86,6 +87,21 @@ export class TabBarConfigGenerator implements IConfigGenerator {
shortenComponentPathBy: "/layouts/tabbar/"
}));

// tabbar styling sample
configs.push(new Config({
component: TabbarStyleComponent,
appModuleConfig: new AppModuleConfig({
imports: [IgxAvatarModule, IgxButtonModule, IgxIconModule,
IgxRippleModule, IgxListModule, IgxBottomNavModule, "Routes",
Router, RouterModule, TabbarStyleComponent],
ngDeclarations: [TabbarStyleComponent],
ngImports: [ "RouterModule.forRoot(Routes = [\{component: TabbarStyleComponent, path: 'tabbar-style'}])",
IgxAvatarModule, IgxButtonModule, IgxIconModule,
IgxRippleModule, IgxListModule, IgxBottomNavModule]
}),
shortenComponentPathBy: "/layouts/"
}));

return configs;
}
}
1 change: 1 addition & 0 deletions src/app/layouts/layouts-routes-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const layoutsRoutesData = {
"tabbar-sample-1": { displayName: "Bottom Navigation Simple Panels", parentName: "Bottom Navigation" },
"tabbar-sample-2": { displayName: "Bottom Navigation Customizing Panels", parentName: "Bottom Navigation" },
"tabbar-sample-3": { displayName: "Bottom Navigation Routing", parentName: "Bottom Navigation" },
"tabbar-style": { displayName: "Bottom Navigation Styling", parentName: "Bottom Navigation" },
"tabs-sample-1": { displayName: "Tabs Overview", parentName: "Tabs" },
"tabs-sample-2": { displayName: "Tabs Types", parentName: "Tabs" },
"tabs-sample-3": { displayName: "Tabs Customizing", parentName: "Tabs" },
Expand Down
6 changes: 6 additions & 0 deletions src/app/layouts/layouts-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
BottomNavRoutingView2Component,
BottomNavRoutingView3Component,
TabbarSample3Component } from "./tabbar/tabbar-sample-3/tabbar-sample-3.component";
import { TabbarStyleComponent } from "./tabbar/tabbar-style/tabbar-style.component";
import { TabbarComponent } from "./tabbar/tabbar.component";
import { TabsSample1Component } from "./tabs/tabs-sample-1/tabs-sample-1.component";
import { TabsSample2Component } from "./tabs/tabs-sample-2/tabs-sample-2.component";
Expand Down Expand Up @@ -185,6 +186,11 @@ export const layoutsRoutes: Routes = [
data: layoutsRoutesData["tabbar-sample-3"],
path: "tabbar-sample-3"
},
{
component: TabbarStyleComponent,
data: layoutsRoutesData["tabbar-style"],
path: "tabbar-style"
},
{
component: TabsSample1Component,
data: layoutsRoutesData["tabs-sample-1"],
Expand Down
4 changes: 3 additions & 1 deletion src/app/layouts/layouts.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import {
BottomNavRoutingView3Component,
TabbarSample3Component
} from "./tabbar/tabbar-sample-3/tabbar-sample-3.component";
import { TabbarStyleComponent } from "./tabbar/tabbar-style/tabbar-style.component";
import { TabbarComponent } from "./tabbar/tabbar.component";
import { TabsSample1Component } from "./tabs/tabs-sample-1/tabs-sample-1.component";
import { TabsSample2Component } from "./tabs/tabs-sample-2/tabs-sample-2.component";
Expand Down Expand Up @@ -121,7 +122,8 @@ import { TabsStyleComponent } from "./tabs/tabs-style/tabs-style.component";
TabsSample4Component,
TabsSample5Component,
CardStylingSampleComponent,
TabsStyleComponent
TabsStyleComponent,
TabbarStyleComponent
],
exports: [
CardSample1Component
Expand Down
38 changes: 38 additions & 0 deletions src/app/layouts/tabbar/tabbar-style/tabbar-style.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<igx-bottom-nav>
<igx-tab-panel icon="phone">
<igx-list class="tab-content">
<igx-list-item [isHeader]="true">History</igx-list-item>
<igx-list-item igxRipple="pink" igxRippleTarget=".igx-list__item-content" *ngFor="let contact of contactsList">
<div class="item">
<igx-avatar [src]="contact.avatar" roundShape="true"></igx-avatar>
<div class="person">
<p class="name">{{contact.text}}</p>
<span class="phone">{{contact.phone}}</span>
</div>
<igx-icon>phone</igx-icon>
</div>
</igx-list-item>
</igx-list>
</igx-tab-panel>
<igx-tab-panel icon="supervisor_account">
<div class="tab-content">
<h3>Tab 2 Content</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius sapien ligula. Donec
consectetur accumsan suscipit. Praesent rutrum tellus blandit bibendum cursus. Vestibulum
urna arcu, bibendum nec molestie ac, varius congue massa. Mauris porttitor viverra lacus.
</p>
</div>
</igx-tab-panel>
<igx-tab-panel icon="format_list_bulleted">
<div class="tab-content">
<h3>Tab 3 Content</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius sapien ligula. Donec
consectetur accumsan suscipit. Praesent rutrum tellus blandit bibendum cursus. Vestibulum
urna arcu, bibendum nec molestie ac, varius congue massa. Mauris porttitor viverra lacus.
Donec efficitur purus id urna dapibus, vitae pharetra orci pellentesque. Vestibulum id lacus
a magna euismod volutpat id in mi. Etiam a nunc ut tellus dictum porta. Donec in ligula a
arcu sollicitudin finibus. Vivamus id lorem pulvinar, accumsan justo vitae, vehicula diam.
Mauris vel quam at velit venenatis vulputate in quis nisl.</p>
</div>
</igx-tab-panel>
</igx-bottom-nav>
86 changes: 86 additions & 0 deletions src/app/layouts/tabbar/tabbar-style/tabbar-style.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@import '~igniteui-angular/lib/core/styles/themes/index';

/*BASIC THEMING*/

$dark-bottom-nav: igx-bottom-nav-theme(
$background: #292826,
$active-item-color: #F4D45C
);

/*ENHANCED APPROACHES*/

// $yellow-color: #F4D45C;
// $black-color: #292826;
// $dark-palette: igx-palette($primary: $black-color, $secondary: $yellow-color);

// $dark-bottom-nav: igx-bottom-nav-theme(
// $background: igx-color($dark-palette, "primary", 400),
// $active-item-color: igx-color($dark-palette, "secondary", 400)
// );

/*SCHEMAS*/

// $dark-bottom-nav-schema: extend($_dark-bottom-nav,
// (
// background: (
// igx-color: ("primary", 400)
// ),
// active-item-color: (
// igx-color: ("secondary", 400)
// )
// )
// );

// $custom-dark-schema: extend($dark-schema,(
// igx-bottom-nav: $dark-bottom-nav-schema
// ));

// $dark-bottom-nav: igx-bottom-nav-theme(
// $palette: $dark-palette,
// $schema: $custom-dark-schema
// );

/*INCLUSION by DEFAULT ViewEncapsulation strategy*/

:host {
::ng-deep {
@include igx-bottom-nav($dark-bottom-nav);
}
}

.tab-content {
padding: 16px;
min-width: 350px;
}

.item {
display: flex;
align-items: center;
justify-content: space-between;
}

.item > [igxLabel],
.item > .person {
position: absolute;
margin-left: 72px;
top:1px;
left: 16px;
}

.person .name {
padding: 0;
margin: 0;
}

.person .phone {
font-size: 12px;
color: gray;
}

.item igx-icon {
color: lightgray;
}

.item igx-icon.favorite {
color: orange;
}
72 changes: 72 additions & 0 deletions src/app/layouts/tabbar/tabbar-style/tabbar-style.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { Component, OnInit } from "@angular/core";

@Component({
selector: "app-tabbar-style",
styleUrls: ["./tabbar-style.component.scss"],
templateUrl: "./tabbar-style.component.html"
})
export class TabbarStyleComponent {

public contactsList: Contact[] = [{
avatar: "assets/images/avatar/1.jpg",
favorite: true,
key: "1",
link: "#",
phone: "770-504-2217",
text: "Terrance Orta"
}, {
avatar: "assets/images/avatar/2.jpg",
favorite: false,
key: "2",
link: "#",
phone: "423-676-2869",
text: "Richard Mahoney"
}, {
avatar: "assets/images/avatar/3.jpg",
favorite: false,
key: "3",
link: "#",
phone: "859-496-2817",
text: "Donna Price"
}, {
avatar: "assets/images/avatar/4.jpg",
favorite: false,
key: "4",
link: "#",
phone: "901-747-3428",
text: "Lisa Landers"
}, {
avatar: "assets/images/avatar/12.jpg",
favorite: true,
key: "5",
link: "#",
phone: "573-394-9254",
text: "Dorothy H. Spencer"
}, {
avatar: "assets/images/avatar/13.jpg",
favorite: false,
key: "6",
link: "#",
phone: "323-668-1482",
text: "Stephanie May"
}, {
avatar: "assets/images/avatar/14.jpg",
favorite: false,
key: "7",
link: "#",
phone: "401-661-3742",
text: "Marianne Taylor"
}];

public constructor() {
}
}

class Contact {
public avatar: string;
public favorite: boolean;
public key: string;
public link: string;
public phone: string;
public text: string;
}

0 comments on commit 770b06d

Please sign in to comment.