From 43ecbde31a8aaa9ff05c702de1a9cddcecd966dc Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Mon, 3 Jun 2019 01:33:07 -0400 Subject: [PATCH] added poll component #93 --- src/app/app.module.ts | 4 ++- .../stream/status/poll/poll.component.html | 8 ++++++ .../stream/status/poll/poll.component.scss | 0 .../stream/status/poll/poll.component.spec.ts | 25 +++++++++++++++++++ .../stream/status/poll/poll.component.ts | 22 ++++++++++++++++ .../stream/status/status.component.html | 2 ++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/app/components/stream/status/poll/poll.component.html create mode 100644 src/app/components/stream/status/poll/poll.component.scss create mode 100644 src/app/components/stream/status/poll/poll.component.spec.ts create mode 100644 src/app/components/stream/status/poll/poll.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5384c05b..baf785e2 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -60,6 +60,7 @@ import { AccountEmojiPipe } from './pipes/account-emoji.pipe'; import { CardComponent } from './components/stream/status/card/card.component'; import { ListEditorComponent } from './components/floating-column/manage-account/my-account/list-editor/list-editor.component'; import { ListAccountComponent } from './components/floating-column/manage-account/my-account/list-editor/list-account/list-account.component'; +import { PollComponent } from './components/stream/status/poll/poll.component'; const routes: Routes = [ { path: "", redirectTo: "home", pathMatch: "full" }, @@ -108,7 +109,8 @@ const routes: Routes = [ AccountEmojiPipe, CardComponent, ListEditorComponent, - ListAccountComponent + ListAccountComponent, + PollComponent ], imports: [ FontAwesomeModule, diff --git a/src/app/components/stream/status/poll/poll.component.html b/src/app/components/stream/status/poll/poll.component.html new file mode 100644 index 00000000..e06aa38e --- /dev/null +++ b/src/app/components/stream/status/poll/poll.component.html @@ -0,0 +1,8 @@ +
+
+ + +
+
+ Vote {{poll.votes_count}} votes - X days left +
\ No newline at end of file diff --git a/src/app/components/stream/status/poll/poll.component.scss b/src/app/components/stream/status/poll/poll.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/components/stream/status/poll/poll.component.spec.ts b/src/app/components/stream/status/poll/poll.component.spec.ts new file mode 100644 index 00000000..111d6548 --- /dev/null +++ b/src/app/components/stream/status/poll/poll.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PollComponent } from './poll.component'; + +xdescribe('PollComponent', () => { + let component: PollComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PollComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PollComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/stream/status/poll/poll.component.ts b/src/app/components/stream/status/poll/poll.component.ts new file mode 100644 index 00000000..5a8aae4d --- /dev/null +++ b/src/app/components/stream/status/poll/poll.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit, Input } from '@angular/core'; + +import { Poll } from '../../../../services/models/mastodon.interfaces'; + +@Component({ + selector: 'app-poll', + templateUrl: './poll.component.html', + styleUrls: ['./poll.component.scss'] +}) +export class PollComponent implements OnInit { + // choiceType: string = 'radio'; + choiceType: string = 'checkbox'; + + @Input() poll: Poll; + + constructor() { } + + ngOnInit() { + + } + +} diff --git a/src/app/components/stream/status/status.component.html b/src/app/components/stream/status/status.component.html index 9b091474..bfdaca9d 100644 --- a/src/app/components/stream/status/status.component.html +++ b/src/app/components/stream/status/status.component.html @@ -67,6 +67,8 @@ (accountSelected)="accountSelected($event)" (hashtagSelected)="hashtagSelected($event)" (textSelected)="textSelected()"> + +