Skip to content

Commit 5f638c5

Browse files
committed
yas pretty styles
1 parent d570f0b commit 5f638c5

8 files changed

+72
-8
lines changed

server/data.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = {
66
'hotel': [4, 9, 10, 11],
77
'mexican': [6, 17, 21, 22, 23, 24, 25],
88
'cow': [12, 26, 27, 28, 29, 30, 31],
9-
'egg': [18, 19, 20, 32, 33]
9+
'egg': [18, 19, 20, 32, 33],
10+
'food': [0, 13, 14, 15, 16, 3, 4, 5, 6, 7, 8, 12, 23, 18, 19, 20, 32, 33]
1011
},
1112

1213
puns: {

src/app/app.module.ts

+3
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@ import 'rxjs/add/operator/share';
1818
import 'rxjs/add/operator/catch';
1919
import 'rxjs/add/observable/merge';
2020
import 'rxjs/add/observable/empty';
21+
import { DialogSuggestionComponent } from './dialog-suggestion/dialog-suggestion.component';
2122

2223
@NgModule({
2324
declarations: [
2425
AppComponent,
2526
PunLookupComponent,
2627
SnapshotCameraComponent,
28+
DialogSuggestionComponent,
2729
],
2830
imports: [
2931
BrowserModule,
3032
FormsModule,
3133
HttpModule,
3234
MaterialModule.forRoot()
3335
],
36+
entryComponents: [DialogSuggestionComponent],
3437
providers: [
3538
],
3639
bootstrap: [AppComponent]

src/app/dialog-suggestion/dialog-suggestion.component.css

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<h3 md-dialog-title>
2+
Suggested Inputs
3+
</h3>
4+
<md-dialog-content>
5+
Some ideas for search! Try banana, cheese, bird, hotel, mexican, cow, egg, or food!
6+
</md-dialog-content>
7+
<md-dialog-actions>
8+
<button md-raised-button md-dialog-close color="accent">Close</button>
9+
</md-dialog-actions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { DialogSuggestionComponent } from './dialog-suggestion.component';
4+
5+
describe('DialogSuggestionComponent', () => {
6+
let component: DialogSuggestionComponent;
7+
let fixture: ComponentFixture<DialogSuggestionComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ DialogSuggestionComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(DialogSuggestionComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-dialog-suggestion',
5+
templateUrl: './dialog-suggestion.component.html',
6+
styleUrls: ['./dialog-suggestion.component.css']
7+
})
8+
export class DialogSuggestionComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/pun-lookup/pun-lookup.component.html

+10-6
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,27 @@ <h3 class="primary-color">Search for Puns</h3>
88
(input)="keywordsInputChange$.next(keywords.value)"/>
99
</md-input-container>
1010

11-
<button (click)="listenClick$.next()">Listen</button>
11+
<button md-raised-button color="primary" (click)="openDialog()">Need Ideas?</button>
1212

13-
<button (click)="showCamera = !showCamera">Snapshot</button>
13+
<button md-raised-button color="accent" (click)="listenClick$.next()">Listen</button>
14+
15+
<button md-raised-button color="accent" (click)="showCamera = !showCamera">Snapshot</button>
1416

1517
<div *ngIf="showCamera">
1618
<app-snapshot-camera [width]="400" [height]="400" (snapshot)="snapshot$.next($event)"></app-snapshot-camera>
1719
</div>
1820

1921
<h3 class="primary-color">Suggested Keywords</h3>
20-
<ul>
21-
<li *ngFor="let keyword of (keyword$ | async)">{{keyword}}</li>
22-
</ul>
22+
<md-card *ngFor="let keyword of (keyword$ | async)">
23+
<md-card-content>
24+
{{keyword}}
25+
</md-card-content>
26+
</md-card>
2327

2428
<h3 class="primary-color">Puns Found</h3>
2529
<md-card *ngFor="let pun of (punsFound$ | async)">
2630
<md-card-content>
2731
{{pun.pun}}
2832
{{pun.answer}}
2933
</md-card-content>
30-
</md-card>
34+
</md-card>

src/app/pun-lookup/pun-lookup.component.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { Observable } from 'rxjs/Observable';
44
import { PunService } from '../pun-service.service';
55
import { SpeechService } from '../speech.service';
66
import { GoogleVisionService } from '../google-vision.service';
7+
import { MdDialog } from '@angular/material';
8+
import { DialogSuggestionComponent } from '../dialog-suggestion/dialog-suggestion.component';
79

810
@Component({
911
selector: 'app-pun-lookup',
@@ -17,6 +19,10 @@ import { GoogleVisionService } from '../google-vision.service';
1719
})
1820
export class PunLookupComponent {
1921

22+
openDialog(){
23+
this.dialog.open(DialogSuggestionComponent)
24+
}
25+
2026
keywordsInputChange$ = new Subject<string>();
2127

2228
listenClick$ = new Subject<void>();
@@ -49,6 +55,7 @@ export class PunLookupComponent {
4955
constructor(
5056
private puns: PunService,
5157
private speech: SpeechService,
52-
private googleVision: GoogleVisionService
58+
private googleVision: GoogleVisionService,
59+
public dialog : MdDialog
5360
) {}
5461
}

0 commit comments

Comments
 (0)