Skip to content

Commit

Permalink
Add tabs style sample
Browse files Browse the repository at this point in the history
  • Loading branch information
tachojelev committed Sep 20, 2019
1 parent a71045c commit 567ff15
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 1 deletion.
12 changes: 12 additions & 0 deletions live-editing/configs/TabsConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
TabsRoutingView2Component,
TabsRoutingView3Component,
TabsSample6Component } from "../../src/app/layouts/tabs/tabs-sample-6/tabs-sample-6.component";
import { TabsStyleComponent } from "../../src/app/layouts/tabs/tabs-style/tabs-style.component";
import { AppModuleConfig } from "./core/AppModuleConfig";
import { Config } from "./core/Config";
import { IConfigGenerator } from "./core/IConfigGenerator";
Expand Down Expand Up @@ -135,6 +136,17 @@ export class TabsConfigGenerator implements IConfigGenerator {
shortenComponentPathBy: "/layouts/tabs/"
}));

configs.push(new Config({
component: TabsStyleComponent,
appModuleConfig: new AppModuleConfig({
imports: [IgxTabsModule, IgxCardModule, IgxAvatarModule,
IgxButtonModule, IgxRippleModule, TabsStyleComponent],
ngDeclarations: [TabsStyleComponent],
ngImports: [IgxTabsModule, IgxCardModule, IgxAvatarModule, IgxButtonModule, IgxRippleModule]
}),
shortenComponentPathBy: "/layouts/tabs/"
}));

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 @@ -26,6 +26,7 @@ export const layoutsRoutesData = {
"tabs-sample-2": { displayName: "Tabs Types", parentName: "Tabs" },
"tabs-sample-3": { displayName: "Tabs Customizing", parentName: "Tabs" },
"tabs-sample-6": { displayName: "Tabs Routing", parentName: "Tabs" },
"tabs-style": { displayName: "Tabs Styling", parentName: "Tabs" },
"card-sample-0": { displayName: "Elevated Card", parentName: "Card" },
"card-sample-1": { displayName: "Outlined Card", parentName: "Card" },
"card-sample-2": { displayName: "Horizontal Card", parentName: "Card" },
Expand Down
5 changes: 5 additions & 0 deletions src/app/layouts/layouts-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
TabsRoutingView2Component,
TabsRoutingView3Component,
TabsSample6Component} from "./tabs/tabs-sample-6/tabs-sample-6.component";
import { TabsStyleComponent } from "./tabs/tabs-style/tabs-style.component";

export const layoutsRoutes: Routes = [
{
Expand Down Expand Up @@ -217,6 +218,10 @@ export const layoutsRoutes: Routes = [
data: layoutsRoutesData["tabs-sample-6"],
path: "tabs-sample-6"
},
{
component: TabsStyleComponent,
path: "tabs-style"
},
{
component: CardComponent,
data: layoutsRoutesData["card-sample-0"],
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 @@ -73,6 +73,7 @@ import {
TabsRoutingView3Component,
TabsSample6Component
} from "./tabs/tabs-sample-6/tabs-sample-6.component";
import { TabsStyleComponent } from "./tabs/tabs-style/tabs-style.component";

@NgModule({
declarations: [
Expand Down Expand Up @@ -119,7 +120,8 @@ import {
TabsSample3Component,
TabsSample4Component,
TabsSample5Component,
CardStylingSampleComponent
CardStylingSampleComponent,
TabsStyleComponent
],
exports: [
CardSample1Component
Expand Down
40 changes: 40 additions & 0 deletions src/app/layouts/tabs/tabs-style/tabs-style.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<igx-tabs>
<igx-tabs-group label="My Albums" icon="library_music">
<div style="margin: 10px 3px 3px 1px">
<igx-card [horizontal]="true">
<div igxLayout igxLayoutDir="column" igxFlex igxFlexGrow="1">
<igx-card-header>
<igx-avatar [src]="card.avatarUrl"></igx-avatar>
<h5 igxCardHeaderTitle>{{card.title}}</h5>
<h5 igxCardHeaderSubtitle>{{card.subtitle}}</h5>
</igx-card-header>
<igx-card-content>
<p>{{card.content}}</p>
</igx-card-content>
<igx-card-actions [vertical]="false">
<button *ngFor="let button of card.buttons;" igxButton="flat" igxRipple>
{{button}}
</button>
</igx-card-actions>
</div>
<igx-card-media width="96px">
<img [src]="card.imageUrl">
</igx-card-media>
</igx-card>
</div>
</igx-tabs-group>
<igx-tabs-group label="Favourites" icon="favorite">
<div style="margin: 3px">
<h5 igxCardHeaderSubtitle>
Add your favourite songs here.
</h5>
</div>
</igx-tabs-group>
<igx-tabs-group label="Info" icon="info">
<div style="margin: 3px">
<h5 igxCardHeaderSubtitle>
"Here" is the sixth studio album by American singer and songwriter Melow D.
</h5>
</div>
</igx-tabs-group>
</igx-tabs>
80 changes: 80 additions & 0 deletions src/app/layouts/tabs/tabs-style/tabs-style.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@import '~igniteui-angular/lib/core/styles/themes/index';

/*BASIC THEMING*/

$dark-tabs: igx-tabs-theme(
$item-text-color: #F4D45C,
$item-background: #292826,
$item-hover-background: #F4D45C,
$item-hover-color: #292826,
$item-active-color: #F4D45C,
$item-active-icon-color: #F4D45C,
$indicator-color: #F4D45C,
$tab-ripple-color: #F4D45C
);

/*ENHANCED APPROACHES*/

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

// $dark-tabs: igx-tabs-theme(
// $palette: $dark-palette,
// $item-text-color: igx-color($dark-palette, "secondary", 400),
// $item-background: igx-color($dark-palette, "primary", 400),
// $item-hover-background: igx-color($dark-palette, "secondary", 400),
// $item-hover-color: igx-color($dark-palette, "primary", 400),
// $item-active-color: igx-color($dark-palette, "secondary", 400),
// $item-active-icon-color: igx-color($dark-palette, "secondary", 400),
// $indicator-color: igx-color($dark-palette, "secondary", 400),
// $tab-ripple-color: igx-color($dark-palette, "secondary", 400)
// );

/*SCHEMAS*/

// $dark-tabs-schema: extend($_dark-tabs,
// (
// item-text-color: (
// igx-color: ("secondary", 400)
// ),
// item-background: (
// igx-color: ("primary", 400)
// ),
// item-hover-background: (
// igx-color: ("secondary", 400)
// ),
// item-hover-color: (
// igx-color: ("primary", 400)
// ),
// item-active-color: (
// igx-color: ("secondary", 400)
// ),
// item-active-icon-color: (
// igx-color: ("secondary", 400)
// ),
// indicator-color: (
// igx-color: ("secondary", 400)
// ),
// tab-ripple-color: (
// igx-color: ("secondary", 400)
// )
// )
// );

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

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

/*INCLUSION by DEFAULT ViewEncapsulation strategy*/

:host {
::ng-deep {
@include igx-tabs($dark-tabs);
}
}
24 changes: 24 additions & 0 deletions src/app/layouts/tabs/tabs-style/tabs-style.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Component, OnInit } from "@angular/core";

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

public card = {
avatarUrl: "assets/images/card/avatars/mellow_d.jpg",
buttons: ["play album"],
content: `Far far away, behind the word mountains,
far from the countries Vokalia and Consonantia,
there live the blind texts.`,
imageUrl: "assets/images/card/media/here_media.jpg",
subtitle: "by Mellow D",
title: "HERE"
};

constructor() { }

public ngOnInit() { }
}

0 comments on commit 567ff15

Please sign in to comment.