Skip to content

Commit

Permalink
cleaned up color pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaswright committed Nov 9, 2023
1 parent a4fe45b commit 6e33e8f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/color-list/color-list.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<input class="form-control form-control-lg" type="text" placeholder="Filter causes" aria-label=".form-control-lg example" [(ngModel)]="filterBy">
<input *ngIf="isHome" class="form-control form-control-lg" type="text" placeholder="Filter causes" aria-label=".form-control-lg example" [(ngModel)]="filterBy">

<div class="row">
<div class="col-4 swatches" [title]="item.causeFull" *ngFor ="let item of list | filter: filterBy: 'cause'">
Expand Down
5 changes: 4 additions & 1 deletion src/app/color-list/color-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { DataService } from './../services/data.service';
import { ColorData } from '../color-data.model';

@Component({
selector: 'app-color-list',
Expand All @@ -9,13 +10,15 @@ import { DataService } from './../services/data.service';

export class ColorListComponent implements OnInit {
@Input() colorList: any
@Input() isHome: any
list: any[] = [];
filterBy: any;

constructor(private data: DataService) { }
constructor() { }

ngOnInit() {
this.list = this.colorList;
console.log(this.isHome)
this.AddToolTips();
this.truncateLongNames();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/color-page/color-page.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h2 [style.color]= "color">{{title}}</h2>

<app-color-list [colorList]="list"></app-color-list>
<app-color-list [colorList]="list" [isHome] = false></app-color-list>
2 changes: 1 addition & 1 deletion src/app/home-page/home-page.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-color-list [colorList] = "list"></app-color-list>
<app-color-list [colorList] = "list" [isHome]=true></app-color-list>

0 comments on commit 6e33e8f

Please sign in to comment.