Remove AppModule and enhance Team and Header components

Deleted unused `AppModule` to streamline the project structure. Enhanced the `TeamComponent` by integrating team member data from the API and updating its template. Improved the `HeaderComponent` by adding `priority` to the logo image for better performance.
This commit is contained in:
Teriuihi 2025-04-08 22:23:37 +02:00
parent c2c81de9d0
commit 21496baab5
5 changed files with 18 additions and 50 deletions

View File

@ -1,47 +0,0 @@
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './home/home.component';
import {NgOptimizedImage} from '@angular/common';
import {CookieService} from 'ngx-cookie-service';
import {MapComponent} from './map/map.component';
import {RulesComponent} from './rules/rules.component';
import {CopyIpComponent} from './copy-ip/copy-ip.component';
import {TermsComponent} from './terms/terms.component';
import {PrivacyComponent} from './privacy/privacy.component';
import {TeamComponent} from './team/team.component';
import {AboutComponent} from './about/about.component';
import {SocialsComponent} from './socials/socials.component';
import {VoteComponent} from './vote/vote.component';
import {BirthdaysComponent} from './birthdays/birthdays.component';
import {HttpClientModule} from '@angular/common/http';
const routes: Routes = [
{path: '', component: HomeComponent},
{path: 'map', component: MapComponent},
{path: 'rules', component: RulesComponent},
{path: 'vote', component: VoteComponent},
{path: 'about', component: AboutComponent},
{path: 'socials', component: SocialsComponent},
{path: 'team', component: TeamComponent},
{path: 'birthdays', component: BirthdaysComponent},
{path: 'terms', component: TermsComponent},
{path: 'privacy', component: PrivacyComponent},
];
@NgModule({
declarations: [],
imports: [
BrowserModule,
HttpClientModule,
RouterModule.forRoot(routes, {
scrollPositionRestoration: 'enabled',
}),
NgOptimizedImage,
CopyIpComponent,
],
providers: [CookieService]
})
export class AppModule {
}

View File

@ -64,7 +64,8 @@
</ul>
</div>
</div>
<a href="/"><img ngSrc="/public/img/logos/logo.png" alt="Altitude Server Logo" height="319" width="550"></a>
<a href="/"><img ngSrc="/public/img/logos/logo.png" priority alt="Altitude Server Logo" height="319"
width="550"></a>
<ul id="nav_list">
<li class="nav_li"><a [id]="getCurrentPageId(['home'])" class="nav_link" href="/" [ngClass]="active">Home</a>
</li>

View File

@ -17,6 +17,7 @@
alt="akastijn's Minecraft skin" height="160" width="160" style="width: 160px;">
<h2>akastijn</h2>
<p>Owner</p>
<p>{{ members }}</p>
</div>
<div class="member">
<img ngSrc="https://crafatar.com/avatars/0b06c1b9ae5845d5af60731e4c788dc8?overlay"

View File

@ -1,8 +1,9 @@
import {Component} from '@angular/core';
import {ScrollService} from '../scroll/scroll.service';
import {TeamService} from '../../api';
import {BASE_PATH, TeamMember, TeamService} from '../../api';
import {CommonModule, NgOptimizedImage} from '@angular/common';
import {HeaderComponent} from '../header/header.component';
import {CookieService} from 'ngx-cookie-service';
@Component({
selector: 'app-team',
@ -12,13 +13,23 @@ import {HeaderComponent} from '../header/header.component';
HeaderComponent,
NgOptimizedImage
],
providers: [
CookieService,
{provide: BASE_PATH, useValue: 'http://localhost:8080/'}
],
templateUrl: './team.component.html',
styleUrl: './team.component.scss'
})
export class TeamComponent {
public members: TeamMember[] = [];
constructor(public scrollService: ScrollService, public teamApi: TeamService) {
console.log("TeamComponent")
teamApi.getTeamMembers("test").subscribe(res => {
console.log(res)
console.log("AHH")
this.members = res;
});
}
}

View File

@ -3,12 +3,14 @@ import {AppComponent} from './app/app.component';
import {provideRouter} from '@angular/router';
import {routes} from './app/app.routes';
import {provideHttpClient} from '@angular/common/http';
import {BASE_PATH} from './api';
bootstrapApplication(AppComponent, {
providers: [
provideRouter(routes),
provideHttpClient()
provideHttpClient(),
{provide: BASE_PATH, useValue: 'http://localhost:8080'}
]
}).catch(err => console.error(err));