diff --git a/angular-cli.json b/angular-cli.json index 358c46c..e7dc5be 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -23,8 +23,7 @@ "scripts": [ "../node_modules/jquery/dist/jquery.js", "../node_modules/bootstrap/js/dist/util.js", - "../node_modules/bootstrap/js/dist/dropdown.js", - "../node_modules/bootstrap/js/dist/modal.js" + "../node_modules/bootstrap/js/dist/dropdown.js" ], "environments": { "source": "environments/environment.ts", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 28c7988..6ea88ee 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -15,7 +15,6 @@ import { NavbarContainerComponent } from './navbar/navbar.container'; import { PostComponent } from './post/post.component'; import { TimelineComponent } from './timeline/timeline.component'; import { TimelineContainerComponent } from './timeline/timeline.container'; -import { PostModalComponent } from './post-modal/post-modal.component'; import { NewPostNotificationComponent } from './new-post-notification/new-post-notification.component'; import { NewPostFormComponent } from './new-post-form/new-post-form.component'; import { HomeComponent } from './home/home.component'; @@ -31,7 +30,6 @@ import { rootReducer } from './app.reducers'; PostComponent, TimelineComponent, TimelineContainerComponent, - PostModalComponent, NewPostNotificationComponent, NewPostFormComponent, HomeComponent, diff --git a/src/app/post-modal/post-modal.component.css b/src/app/post-modal/post-modal.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/post-modal/post-modal.component.html b/src/app/post-modal/post-modal.component.html deleted file mode 100644 index 2a45ba5..0000000 --- a/src/app/post-modal/post-modal.component.html +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/src/app/post-modal/post-modal.component.spec.ts b/src/app/post-modal/post-modal.component.spec.ts deleted file mode 100644 index 8508b1b..0000000 --- a/src/app/post-modal/post-modal.component.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* tslint:disable:no-unused-variable */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; - -import { PostModalComponent } from './post-modal.component'; - -describe('PostModalComponent', () => { - let component: PostModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PostModalComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PostModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/post-modal/post-modal.component.ts b/src/app/post-modal/post-modal.component.ts deleted file mode 100644 index 302c85c..0000000 --- a/src/app/post-modal/post-modal.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { ElementRef, ViewChild } from '@angular/core'; -declare var $; - -@Component({ - selector: 'app-post-modal', - templateUrl: './post-modal.component.html', - styleUrls: ['./post-modal.component.css'] -}) -export class PostModalComponent { - @Input() post: IPost; - @Output() private toggleLikePost: EventEmitter = new EventEmitter(); - @Output() private toggleRepost: EventEmitter = new EventEmitter(); - @ViewChild('modal') private modal: ElementRef; - - open(): void { - $(this.modal.nativeElement).modal(); - } - - // tslint:disable-next-line:no-unused-variable - private handleToggleLikePost() { - this.toggleLikePost.emit(null); - } - - // tslint:disable-next-line:no-unused-variable - private handleToggleRepost() { - this.toggleRepost.emit(null); - } -} diff --git a/src/app/post/post.component.html b/src/app/post/post.component.html index f16c393..99f9394 100644 --- a/src/app/post/post.component.html +++ b/src/app/post/post.component.html @@ -19,14 +19,14 @@ class="repost-button mr-3" [class.reposted]="post.reposted" [name]="'retweet'" - (click)="handleRepostButtonClick($event)" + (click)="handleRepostButtonClick()" > diff --git a/src/app/post/post.component.ts b/src/app/post/post.component.ts index 19df081..4f4d198 100644 --- a/src/app/post/post.component.ts +++ b/src/app/post/post.component.ts @@ -11,18 +11,12 @@ export class PostComponent { @Output() private toggleRepost: EventEmitter = new EventEmitter(); // tslint:disable-next-line:no-unused-variable - private handleLikeButtonClick(event) { + private handleLikeButtonClick() { this.toggleLikePost.emit(null); - - // Prevent the post modal from opening. - event.stopPropagation(); } // tslint:disable-next-line:no-unused-variable - private handleRepostButtonClick(event) { + private handleRepostButtonClick() { this.toggleRepost.emit(null); - - // Prevent the post modal from opening. - event.stopPropagation(); } } diff --git a/src/app/timeline/timeline.component.html b/src/app/timeline/timeline.component.html index a3854b4..aab13b5 100644 --- a/src/app/timeline/timeline.component.html +++ b/src/app/timeline/timeline.component.html @@ -21,16 +21,9 @@ > -