Skip to content

Commit

Permalink
feat(teams page): init wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrik-lundin committed Oct 16, 2017
1 parent 6e83bb6 commit 5234038
Show file tree
Hide file tree
Showing 13 changed files with 280 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<mat-sidenav-container>
<mat-sidenav #sidenav role="navigation">
<mat-nav-list (click)="sidenav.toggle()">
<a *ngFor="let menu of menus" mat-list-item routerLinkActive="active"
[routerLinkActiveOptions]="menu.options"
<a *ngFor="let menu of menus" mat-list-item routerLinkActive="active"
[routerLinkActiveOptions]="menu.options"
[routerLink]="menu.link">
{{menu.title}}
</a>
</mat-nav-list>
</mat-sidenav>
<main class="body-margin">
<main class="body">
<router-outlet></router-outlet>
</main>
</mat-sidenav-container>
Expand Down
19 changes: 19 additions & 0 deletions src/app/team/member.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<mat-card>
<mat-card-header>
<div mat-card-avatar [ngStyle]="{'background-image': 'url(' + member.avatar + ')'}" class="header-image">
</div>
<mat-card-title>{{member.name}}</mat-card-title>
<mat-card-subtitle>{{member.role}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<p>
{{member.bio}}
</p>
</mat-card-content>
<mat-card-actions>
<a *ngIf="!!member.githubUrl" mat-button [href]="member.githubUrl">GITHUB</a>
<a *ngIf="!!member.twitterUrl" mat-button [href]="member.twitterUrl">TWITTER</a>
<a *ngIf="!!member.linkedin" mat-button [href]="member.linkedin">LINKEDIN</a>
<a *ngIf="!!member.email" mat-button [href]="member.email">EMAIL</a>
</mat-card-actions>
</mat-card>
8 changes: 8 additions & 0 deletions src/app/team/member.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.mat-card {
width: 300px;
margin: 15px;
}

.header-image {
background-size: cover;
}
25 changes: 25 additions & 0 deletions src/app/team/member.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 { MemberComponent } from './member.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions src/app/team/member.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component, Input } from '@angular/core';

import { IMember } from './team.models';

@Component({
selector: 'app-member',
templateUrl: './member.component.html',
styleUrls: ['./member.component.scss']
})
export class MemberComponent{
@Input() member: IMember;
}
18 changes: 15 additions & 3 deletions src/app/team/team.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<p>
team works!
</p>
<div style="background-color: white;" class="team-section">
<h2>Core team</h2>
<section class="wrapper">
<app-member *ngFor="let member of (team$ | async).coreTeam" [member]="member">
</app-member>
</section>
</div>

<div style="background-color: #efefef" class="team-section">
<h2>Learning team</h2>
<section class="wrapper">
<app-member *ngFor="let member of (team$ | async).learningTeam" [member]="member">
</app-member>
</section>
</div>
16 changes: 16 additions & 0 deletions src/app/team/team.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
h2 {
text-align: center;
margin: 0;
padding: 20px;
}

section.wrapper {
display: flex;
flex-flow: row wrap;
justify-content: center;
}

div.team-section {
box-shadow: -1px 3px 5px 0px #d6d6d6;
margin-bottom: 3px;
}
11 changes: 9 additions & 2 deletions src/app/team/team.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';

import { TeamService } from './team.service';
import { ITeam } from './team.models';

@Component({
selector: 'app-team',
templateUrl: './team.component.html',
styleUrls: ['./team.component.scss']
})
export class TeamComponent implements OnInit {
team$: Observable<ITeam>;

constructor() { }
constructor(
private service: TeamService
) {}

ngOnInit() {
this.team$ = this.service.getTeam();
}

}
15 changes: 15 additions & 0 deletions src/app/team/team.models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface ITeam {
coreTeam: IMember[];
learningTeam: IMember[];
}

export interface IMember {
name: string;
role: string;
githubUrl: string;
avatar: string;
twitterUrl: string;
linkedin: string;
email: string;
bio: string;
}
17 changes: 14 additions & 3 deletions src/app/team/team.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { MatCardModule, MatButtonModule } from '@angular/material';

import { TeamComponent } from './team.component';
import { routing } from './team.routing';
import { TeamComponent } from './team.component';
import { TeamService } from './team.service';
import { MemberComponent } from './member.component';

@NgModule({
imports: [routing],
declarations: [TeamComponent]
imports: [
routing,
CommonModule,
MatCardModule,
MatButtonModule
],
providers: [TeamService],
declarations: [TeamComponent, MemberComponent]
})
export class TeamModule { }
15 changes: 15 additions & 0 deletions src/app/team/team.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { TestBed, inject } from '@angular/core/testing';

import { TeamService } from './team.service';

describe('TeamService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [TeamService]
});
});

it('should be created', inject([TeamService], (service: TeamService) => {
expect(service).toBeTruthy();
}));
});
125 changes: 125 additions & 0 deletions src/app/team/team.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/from';

import { ITeam, IMember } from './team.models';

@Injectable()
export class TeamService {
getTeam(): Observable<ITeam> {
return Observable.from([{
coreTeam: [{
name: 'Fredrik Lundin',
role: 'Developer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Fredrik is a fullstack developer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stockholm, Sweden'
}, {
name: 'Fredrik Lundin',
role: 'Developer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Fredrik is a fullstack developer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stockholm, Sweden'
},{
name: 'Fredrik Lundin',
role: 'Developer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Fredrik is a fullstack developer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stockholm, Sweden'
},{
name: 'Fredrik Lundin',
role: 'Developer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Fredrik is a fullstack developer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stockholm, Sweden'
},{
name: 'Fredrik Lundin',
role: 'Developer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Fredrik is a fullstack developer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stockholm, Sweden'
}],
learningTeam: [{
name: 'Sunniva Grande',
role: 'Designer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Sunniva is a UX designer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stavanger, Norway'
}, {
name: 'Sunniva Grande',
role: 'Designer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Sunniva is a UX designer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stavanger, Norway'
},{
name: 'Sunniva Grande',
role: 'Designer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Sunniva is a UX designer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stavanger, Norway'
},{
name: 'Sunniva Grande',
role: 'Designer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Sunniva is a UX designer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stavanger, Norway'
},{
name: 'Sunniva Grande',
role: 'Designer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Sunniva is a UX designer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stavanger, Norway'
},{
name: 'Sunniva Grande',
role: 'Designer',
githubUrl: 'https://github.com/fredrik-lundin',
avatar: 'https://github.com/fredrik-lundin.png',
twitterUrl: 'https://twitter.com/kirderflundin',
linkedin: 'https://www.linkedin.com/in/lundin-fredrik',
email: 'mailto:flu.lund@gmail.com',
bio: 'Sunniva is a UX designer, during most of his daily work in the '
+ '.Net space. He is born and raised in Stavanger, Norway'
}]
}]);
}
}
6 changes: 4 additions & 2 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ mat-sidenav a.active .mat-list-item-content {
color: mat-color($accent);
}

.body-margin {
margin: 50px;
.body {
max-width: 1000px;
margin: auto;
background-color: white;
}

0 comments on commit 5234038

Please sign in to comment.