Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reclamador Header Component #6

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions libs/reclamitux/src/lib/header/header.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="header-container left">
<div class="logo-containter">
<a (click)="toggleSidebar()" href="#" class="navigation"><i class="fa fa-bars fa-xs"></i></a>
<div class="logo" (click)="goToHome()">{{appName}}</div>
</div>
</div>

<div class="header-container">
<nb-actions size="medium" class="right">
<nb-action>
<nb-user
[nbContextMenu]="userMenu"
[name]="user?.name"
[picture]="user?.avatar"
nbContextMenuTag="user-context-menu"
></nb-user>
</nb-action>
</nb-actions>
</div>
129 changes: 129 additions & 0 deletions libs/reclamitux/src/lib/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
@import '~bootstrap/scss/mixins/breakpoints';
@import '~@nebular/theme/styles/global/breakpoints';

// @include nb-install-component() {
// display: flex;
// justify-content: space-between;
// width: 100%;

// .left {
// display: flex;
// width: 100%;
// order: 0;
// flex-direction: row;
// }
// .right {
// order: 1;
// flex-direction: row-reverse;
// }

// .logo-containter {
// display: flex;
// align-items: center;
// width: calc(#{nb-theme(sidebar-width)} - #{nb-theme(header-padding)});
// }

// .control-item {
// display: block;
// }

// .header-container {
// display: flex;
// align-items: center;
// width: auto;
// color:#fff;

// .navigation {
// @include nb-ltr(padding-right, nb-theme(padding));
// @include nb-rtl(padding-left, nb-theme(padding));
// font-size: 2.5rem;
// text-decoration: none;
// color:#fff;

// i {
// display: block;
// }

// }

// .logo {
// padding: 0 nb-theme(padding);
// font-size: 1.75rem;
// font-weight: nb-theme(font-weight-bolder);
// @include nb-ltr(border-left, 1px solid nb-theme(separator));
// @include nb-rtl(border-right, 1px solid nb-theme(separator));
// white-space: nowrap;

// img {
// width: 150px;
// height: 38px;
// }

// .version {
// color: #ddd;
// padding-left: 15px;
// font-size: 1rem;
// vertical-align: text-bottom;
// }
// }
// }

// @include nb-for-theme(default) {
// $menu-action-separator-color: #3f4550;

// nb-action {
// @include nb-ltr(border-left-color, $menu-action-separator-color);
// @include nb-rtl(border-right-color, $menu-action-separator-color);
// }

// .header-container .logo {
// @include nb-ltr(border, none);
// @include nb-rtl(border, none);
// }
// }

// @include media-breakpoint-down(md) {

// nb-action:not(.toggle-settings) {
// border: none;
// }

// .control-item {
// display: none;
// }

// .toggle-settings {
// padding: 0;
// }
// }

// @include media-breakpoint-down(sm) {

// nb-user /deep/ .user-name {
// display: none;
// }
// }

// @include media-breakpoint-down(is) {

// .header-container {
// .logo {
// font-size: 1.25rem;
// }
// }

// .toggle-settings {
// display: none;
// }

// nb-action:not(.toggle-settings) {
// padding: 0;
// }
// }

// @include media-breakpoint-down(xs) {
// .right /deep/ {
// display: none;
// }
// }
// }
25 changes: 25 additions & 0 deletions libs/reclamitux/src/lib/header/header.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { HeaderComponent } from './header.component';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HeaderComponent ]
})
.compileComponents();
}));

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
40 changes: 40 additions & 0 deletions libs/reclamitux/src/lib/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Component, Input, OnInit, Output } from '@angular/core';

import { NbMenuService, NbMenuItem } from '@nebular/theme';

export interface IUser {
name:string;
surnames:string;
username: string;
email: string;
avatar: string;
}

@Component({
selector: 'ngx-header',
styleUrls: ['./header.component.scss'],
templateUrl: './header.component.html'
})
export class HeaderComponent implements OnInit {
@Input() position = 'normal';
@Input() appName = 'Default';
@Input() user = {
name: '',
surnames: '',
username: '',
email: '',
avatar: ''
};
@Input() userMenu: NbMenuItem[] = [];
@Output() toggleSidebar() {
this.isMenuToggled = !this.isMenuToggled;
return this.isMenuToggled;
}
@Output() goToHome = () => {};
isMenuToggled = false;

constructor(
) {}

ngOnInit() { }
}
25 changes: 25 additions & 0 deletions libs/reclamitux/src/lib/header/header.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { HeaderComponent } from './header.component';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NbMenuModule, NbActionsModule, NbUserModule, NbContextMenuModule } from '@nebular/theme';

@NgModule({
imports: [
CommonModule,
NbActionsModule,
NbUserModule,
NbContextMenuModule,
NbMenuModule.forRoot()
],
declarations: [
HeaderComponent
],
exports: [
HeaderComponent
],
entryComponents: [
HeaderComponent
],
schemas: [ CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA ]
})
export class HeaderModule { }
2 changes: 2 additions & 0 deletions libs/reclamitux/src/lib/header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './header.component';
export * from './header.module';