Skip to content

Commit

Permalink
Add component for displaying user photos in profile
Browse files Browse the repository at this point in the history
  • Loading branch information
marvac committed Jan 18, 2019
1 parent 476e947 commit e246388
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { MemberListResolver } from './resolvers/member-list.resolver';
import { MemberEditComponent } from './components/members/member-edit/member-edit.component';
import { MemberEditResolver } from './resolvers/member-edit.resolver';
import { UnsavedChangesGuard } from './guards/unsaved-changes.guard';
import { PhotoEditorComponent } from './components/members/photo-editor/photo-editor.component';


export function tokenGetter() {
Expand All @@ -44,7 +45,8 @@ export function tokenGetter() {
MessagesComponent,
MemberCardComponent,
MemberDetailComponent,
MemberEditComponent
MemberEditComponent,
PhotoEditorComponent
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h4>Location Details:</h4>

</tab>
<tab heading="Edit Photos">
<p>Photo edit here</p>
<app-photo-editor [photos]="user.photos"></app-photo-editor>
</tab>
</tabset>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
img.img-thumbnail {
height: 100px;
min-width: 100px !important;
margin-bottom: 2px;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="row">
<div class="col-sm-2" *ngFor="let photo of photos">
<img src="{{photo.url}}" class="img-thumbnail p-1" alt="" />
<div class="text-center">
<button type="button" class="btn btn-xs btn-primary">Main</button>
<button type="button" class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i></button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { PhotoEditorComponent } from './photo-editor.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component, OnInit, Input } from '@angular/core';
import { Photo } from 'src/app/models/photo';

@Component({
selector: 'app-photo-editor',
templateUrl: './photo-editor.component.html',
styleUrls: ['./photo-editor.component.css']
})
export class PhotoEditorComponent implements OnInit {
@Input() photos: Photo[];

constructor() { }

ngOnInit() {
}

}

0 comments on commit e246388

Please sign in to comment.