Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec authored Mar 30, 2018
2 parents 21cafac + 0b1f3ca commit b3da505
Show file tree
Hide file tree
Showing 10 changed files with 996 additions and 19 deletions.
906 changes: 906 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions src/app/homepage/homepage.component.html

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/app/homepage/homepage.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.logo-wrapper {
svg {
svg, img {
width: 132px;
height: 61px;
}
Expand Down Expand Up @@ -58,7 +58,10 @@
h1, h2, h3, h4, h5, h6 {
color: $black-color;
}
h3 { font-size: 24px; }
h3 {
font-size: 24px;
font-weight: 600;
}
h5 {
color: $grey-color;
margin-top: -20px;
Expand Down
5 changes: 4 additions & 1 deletion src/app/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Router, NavigationEnd } from '@angular/router';
})
export class HomepageComponent implements OnInit, AfterViewInit {
isSidebarOpened = true;
previousWidth: number;

constructor(
private readonly cd: ChangeDetectorRef,
Expand All @@ -26,6 +27,7 @@ export class HomepageComponent implements OnInit, AfterViewInit {

ngOnInit(): void {
this.router.events.filter(e => e instanceof NavigationEnd).subscribe(() => {
this.previousWidth = window.innerWidth;
this.checkWindowWidth(window.innerWidth);
});
}
Expand All @@ -45,7 +47,8 @@ export class HomepageComponent implements OnInit, AfterViewInit {

checkWindowWidth(innerWidth?: number) {
innerWidth = innerWidth ? innerWidth : window.innerWidth;
if (innerWidth <= 768) {
if (this.previousWidth !== innerWidth && innerWidth <= 768) {
this.previousWidth = innerWidth;
this.isSidebarOpened = false;
this.cd.detectChanges();
}
Expand Down
8 changes: 6 additions & 2 deletions src/app/homepage/menu/menu-item/menu-item.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ h3 {
@extend .transition;
position: absolute;
top: 1px;
right: 0;
right: 20px;
font-size: 22px;
cursor: pointer;
}

li {
display: block;
padding: 10px 0;
padding: 8px 0;

a {
color: $black-color;
Expand Down Expand Up @@ -74,4 +74,8 @@ h3 {
color: $red-color;
}
}
}

ul {
padding-left: 25px;
}
1 change: 1 addition & 0 deletions src/app/homepage/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
[externalUrl]="item?.externalUrl"
[path]="item?.path"
[children]="item.children"
class="nav-item"
></app-menu-item>
</nav>
13 changes: 11 additions & 2 deletions src/app/homepage/menu/menu.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@include transform(translateX(-100%));
padding: 55px 30px 40px 45px;
width: 345px;
background: $white-color;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
background: #f9f9f9;
box-shadow: inset -35px -18px 70px rgba(233, 233, 233, 0.65);
position: absolute !important;
bottom: 0;
top: 0;
Expand All @@ -21,3 +21,12 @@
@include media(large) { width: 300px; }
@include media(medium) { padding: 20px 25px 20px 25px; }
}

.nav-item {
margin: 0 -20px;
padding: 0 20px;
border-bottom: 1px solid #efefef;
&:last-of-type {
border: 0;
}
}
4 changes: 2 additions & 2 deletions src/app/homepage/pages/recipes/passport/passport.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class AuthService {
return `
import * as passport from 'passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { Component, Inject } from '@nestjs/common';
import { Component, Inject, UnauthorizedException } from '@nestjs/common';
import { AuthService } from '../auth.service';
@Component()
Expand All @@ -86,7 +86,7 @@ export class JwtStrategy extends Strategy {
public async verify(req, payload, done) {
const isValid = await this.authService.validateUser(payload);
if (!isValid) {
return done('Unauthorized', false);
return done(new UnauthorizedException(), false);
}
done(null, payload);
}
Expand Down
59 changes: 59 additions & 0 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body {
font-size: 15px;
font-weight: 500;
font-family: 'Montserrat', "Helvetica Neue", sans-serif;
background-color: $white-color;
background-color: #fbfbfb;
color: $grey-color;
margin: 0;
}
Expand Down

0 comments on commit b3da505

Please sign in to comment.