diff --git a/src/app/app.component.css b/src/app/app.component.css index e69de29..1370564 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -0,0 +1,21 @@ +.sidenav-container { + height: 100%; +} + +.sidenav { + width: 200px; +} + +.sidenav .mat-toolbar { + background: inherit; +} + +.mat-toolbar.mat-primary { + position: sticky; + top: 0; + z-index: 1; +} + +.toolbar-spacer { + flex: 1 1 auto; +} diff --git a/src/app/app.component.html b/src/app/app.component.html index 6d22242..3e40aa2 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1 +1,36 @@ - + + + Menü + + Főoldal + Link 2 + Link 3 + + + + + + Szakdolgozat + + Regisztráció + + Bejelentkezés + login + + +
+ + +
+
+
diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index fe80583..62b7b87 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,31 +1,40 @@ -import { TestBed } from '@angular/core/testing'; +import { LayoutModule } from '@angular/cdk/layout'; +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatToolbarModule } from '@angular/material/toolbar'; + import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], + let component: AppComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [AppComponent], + imports: [ + NoopAnimationsModule, + LayoutModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSidenavModule, + MatToolbarModule, + ] }).compileComponents(); - }); + })); - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have as title 'Szakdolgozat'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('Szakdolgozat'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); + beforeEach(() => { + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; fixture.detectChanges(); - const compiled = fixture.nativeElement; - expect(compiled.querySelector('.content span').textContent).toContain('Szakdolgozat app is running!'); + }); + + it('should compile', () => { + expect(component).toBeTruthy(); }); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b358928..34675d7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,4 +1,7 @@ import { Component } from '@angular/core'; +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; +import { Observable } from 'rxjs'; +import { map, shareReplay } from 'rxjs/operators'; import firebase from 'firebase'; @Component({ @@ -7,7 +10,20 @@ import firebase from 'firebase'; styleUrls: ['./app.component.css'] }) export class AppComponent { - title = 'Szakdolgozat'; + + isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) + .pipe( + map(result => result.matches), + shareReplay() + ); + + constructor(private breakpointObserver: BreakpointObserver) {} + } firebase.initializeApp((window as any).firebaseCredentials); +firebase.auth().onAuthStateChanged(user => { + if (user) { + + } +}); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d8ac513..f08823c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -6,7 +6,6 @@ import {LoginComponent} from './login/login.component'; import {AppRoutingModule} from './app-routing.module'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {MatSliderModule} from '@angular/material/slider'; -import {NavComponent} from './nav/nav.component'; import {LayoutModule} from '@angular/cdk/layout'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatButtonModule} from '@angular/material/button'; @@ -18,24 +17,15 @@ import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; import {RegisterComponent} from './register/register.component'; import {LoginService} from './shared/login.service'; -/*import {FirebaseUIModule} from 'firebaseui-angular'; -import {AngularFireAuth, AngularFireAuthModule} from '@angular/fire/auth'; -import firebase from 'firebase/app'; -import 'firebase/auth'; -import {AngularFirestoreModule} from '@angular/fire/firestore'; -import {AngularFireDatabaseModule} from '@angular/fire/database';*/ import {AngularFireModule, FirebaseApp} from '@angular/fire'; import {AngularFireAuthModule} from '@angular/fire/auth'; import {AngularFirestoreModule} from '@angular/fire/firestore'; import {AngularFireDatabaseModule} from '@angular/fire/database'; -import firebase from 'firebase'; -import initializeApp = firebase.initializeApp; @NgModule({ declarations: [ AppComponent, LoginComponent, - NavComponent, RegisterComponent ], imports: [ diff --git a/src/app/nav/nav.component.css b/src/app/nav/nav.component.css deleted file mode 100644 index 1370564..0000000 --- a/src/app/nav/nav.component.css +++ /dev/null @@ -1,21 +0,0 @@ -.sidenav-container { - height: 100%; -} - -.sidenav { - width: 200px; -} - -.sidenav .mat-toolbar { - background: inherit; -} - -.mat-toolbar.mat-primary { - position: sticky; - top: 0; - z-index: 1; -} - -.toolbar-spacer { - flex: 1 1 auto; -} diff --git a/src/app/nav/nav.component.html b/src/app/nav/nav.component.html deleted file mode 100644 index 3e40aa2..0000000 --- a/src/app/nav/nav.component.html +++ /dev/null @@ -1,36 +0,0 @@ - - - Menü - - Főoldal - Link 2 - Link 3 - - - - - - Szakdolgozat - - Regisztráció - - Bejelentkezés - login - - -
- - -
-
-
diff --git a/src/app/nav/nav.component.spec.ts b/src/app/nav/nav.component.spec.ts deleted file mode 100644 index ef41e2c..0000000 --- a/src/app/nav/nav.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { LayoutModule } from '@angular/cdk/layout'; -import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatToolbarModule } from '@angular/material/toolbar'; - -import { NavComponent } from './nav.component'; - -describe('NavComponent', () => { - let component: NavComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [NavComponent], - imports: [ - NoopAnimationsModule, - LayoutModule, - MatButtonModule, - MatIconModule, - MatListModule, - MatSidenavModule, - MatToolbarModule, - ] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(NavComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should compile', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/nav/nav.component.ts b/src/app/nav/nav.component.ts deleted file mode 100644 index 5725e09..0000000 --- a/src/app/nav/nav.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component } from '@angular/core'; -import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; -import { Observable } from 'rxjs'; -import { map, shareReplay } from 'rxjs/operators'; - -@Component({ - selector: 'app-nav', - templateUrl: './nav.component.html', - styleUrls: ['./nav.component.css'] -}) -export class NavComponent { - - isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) - .pipe( - map(result => result.matches), - shareReplay() - ); - - constructor(private breakpointObserver: BreakpointObserver) {} - -}