Skip to content

Commit

Permalink
move pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ksw2000 committed Oct 31, 2024
1 parent a2268eb commit 2fdb257
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/schedule/schedule-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '@angular/router';
import { CommonModule } from '@angular/common';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { LinkTypeToIconPipe } from '../pipes/to-social-link-icon.pipe';
import { ToSocialLinkIconPipe } from '../to-social-link-icon.pipe';
import { MatIconModule } from '@angular/material/icon';
import { MatChipsModule } from '@angular/material/chips';
import { LoadDataServices, Speaker, Session } from '../load-data.service';
Expand Down Expand Up @@ -81,7 +81,7 @@ export class ScheduleDialogEntryComponent implements OnInit {
CommonModule,
RouterModule,
FontAwesomeModule,
LinkTypeToIconPipe,
ToSocialLinkIconPipe,
MatIconModule,
MatChipsModule,
],
Expand Down
4 changes: 2 additions & 2 deletions src/app/speakers/speaker-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
OnInit,
} from '@angular/core';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { LinkTypeToIconPipe } from '../pipes/to-social-link-icon.pipe';
import { ToSocialLinkIconPipe } from '../to-social-link-icon.pipe';
import { LoadDataServices, Speaker } from '../load-data.service';
import {
ActivatedRoute,
Expand Down Expand Up @@ -78,7 +78,7 @@ export class SpeakerDialogEntryComponent implements OnInit {
CommonModule,
RouterModule,
FontAwesomeModule,
LinkTypeToIconPipe,
ToSocialLinkIconPipe,
MatIconModule,
],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
4 changes: 2 additions & 2 deletions src/app/speakers/speakers.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { MatCardModule } from '@angular/material/card';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { LinkTypeToIconPipe } from '../pipes/to-social-link-icon.pipe';
import { ToSocialLinkIconPipe } from '../to-social-link-icon.pipe';
import { LoadDataServices, Speaker } from '../load-data.service';
import { RouterModule } from '@angular/router';
import { MatButtonModule } from '@angular/material/button';
Expand All @@ -14,7 +14,7 @@ import { MatButtonModule } from '@angular/material/button';
MatCardModule,
FontAwesomeModule,
CommonModule,
LinkTypeToIconPipe,
ToSocialLinkIconPipe,
RouterModule,
MatButtonModule,
],
Expand Down
8 changes: 8 additions & 0 deletions src/app/to-social-link-icon.pipe.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ToSocialLinkIconPipe } from './to-social-link-icon.pipe';

describe('ToSocialLinkIconPipe', () => {
it('create an instance', () => {
const pipe = new ToSocialLinkIconPipe();
expect(pipe).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import {
faXTwitter,
} from '@fortawesome/free-brands-svg-icons';
import { faBlog, faLink } from '@fortawesome/free-solid-svg-icons';

@Pipe({
standalone: true,
name: 'toSocialLinkIcon',
standalone: true,
})
export class LinkTypeToIconPipe implements PipeTransform {
export class ToSocialLinkIconPipe implements PipeTransform {
transform(value: string): IconDefinition {
switch (value) {
case 'Twitter':
Expand Down

0 comments on commit 2fdb257

Please sign in to comment.