Skip to content

Commit

Permalink
Change the view toggle to use icons
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreb committed Nov 7, 2024
1 parent b7aaa1a commit a619c80
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions app/src/app/communities/communities.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@
<input matInput placeholder="Filter communities..." />
<mat-icon matSuffix>search</mat-icon>
</mat-form-field> -->

<mat-button-toggle-group hideSingleSelectionIndicator="true" [(ngModel)]="viewStyle">
<mat-button-toggle value="thumbnail">
<mat-icon>grid_view</mat-icon>
</mat-button-toggle>
<mat-button-toggle value="list">
<mat-icon>view_list</mat-icon>
</mat-button-toggle>
</mat-button-toggle-group>

<!-- <mat-button-toggle-group hideSingleSelectionIndicator="true" [(ngModel)]="viewStyle">
<mat-button-toggle value="card">Cards</mat-button-toggle>
<mat-button-toggle value="table">Table</mat-button-toggle>
</mat-button-toggle-group>
</mat-button-toggle-group> -->
</mat-card-content>
</mat-card>

Expand All @@ -39,7 +49,7 @@
</div>
</mat-card-content>
</mat-card>
} @if (viewStyle() == 'card') {
} @if (viewStyle() == 'thumbnail') {
<!-- <mat-card appearance="outlined">
<mat-card-header>
<mat-card-title>Dog Lovers</mat-card-title>
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/communities/communities.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class CommunitiesComponent {
// }

//viewStyle = signal('card');
viewStyle = model<string>('card');
viewStyle = model<string>('thumbnail');

checked = model<boolean>(false);

Expand Down

0 comments on commit a619c80

Please sign in to comment.