Skip to content

Commit

Permalink
Move repo image links
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Oct 13, 2024
1 parent 703c36f commit 34decdc
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions webapp/src/app/home/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ import advancedFormat from 'dayjs/plugin/advancedFormat';

dayjs.extend(advancedFormat);

const repoImages: { [key: string]: string } = {
Hephaestus: 'https://github.com/ls1intum/Hephaestus/raw/refs/heads/develop/docs/images/hammer.svg',
Artemis: 'https://artemis.in.tum.de/public/images/logo.png',
Athena: 'https://raw.githubusercontent.com/ls1intum/Athena/develop/playground/public/logo.png'
};

@Component({
selector: 'app-profile',
standalone: true,
Expand Down Expand Up @@ -75,19 +81,7 @@ export class ProfileComponent {
this.userLogin = this.route.snapshot.paramMap.get('id');
}

getRepositoryImage = (name: string) => {
const shortName = name.split('/')[1];
switch (shortName) {
case 'Hephaestus':
return 'https://github.com/ls1intum/Hephaestus/raw/refs/heads/develop/docs/images/hammer.svg';
case 'Artemis':
return 'https://artemis.in.tum.de/public/images/logo.png';
case 'Athena':
return 'https://raw.githubusercontent.com/ls1intum/Athena/develop/playground/public/logo.png';
default:
return 'https://avatars.githubusercontent.com/u/11064260?v=4';
}
};
getRepositoryImage = (name: string) => repoImages[name.split('/')[1]] || 'https://avatars.githubusercontent.com/u/11064260?v=4';

query = injectQuery(() => ({
queryKey: ['user', { id: this.userLogin }],
Expand Down

0 comments on commit 34decdc

Please sign in to comment.