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:
parent
c2c81de9d0
commit
21496baab5
|
|
@ -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 {
|
|
||||||
}
|
|
||||||
|
|
@ -64,7 +64,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<ul id="nav_list">
|
||||||
<li class="nav_li"><a [id]="getCurrentPageId(['home'])" class="nav_link" href="/" [ngClass]="active">Home</a>
|
<li class="nav_li"><a [id]="getCurrentPageId(['home'])" class="nav_link" href="/" [ngClass]="active">Home</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
alt="akastijn's Minecraft skin" height="160" width="160" style="width: 160px;">
|
alt="akastijn's Minecraft skin" height="160" width="160" style="width: 160px;">
|
||||||
<h2>akastijn</h2>
|
<h2>akastijn</h2>
|
||||||
<p>Owner</p>
|
<p>Owner</p>
|
||||||
|
<p>{{ members }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="member">
|
<div class="member">
|
||||||
<img ngSrc="https://crafatar.com/avatars/0b06c1b9ae5845d5af60731e4c788dc8?overlay"
|
<img ngSrc="https://crafatar.com/avatars/0b06c1b9ae5845d5af60731e4c788dc8?overlay"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {ScrollService} from '../scroll/scroll.service';
|
import {ScrollService} from '../scroll/scroll.service';
|
||||||
import {TeamService} from '../../api';
|
import {BASE_PATH, TeamMember, TeamService} from '../../api';
|
||||||
import {CommonModule, NgOptimizedImage} from '@angular/common';
|
import {CommonModule, NgOptimizedImage} from '@angular/common';
|
||||||
import {HeaderComponent} from '../header/header.component';
|
import {HeaderComponent} from '../header/header.component';
|
||||||
|
import {CookieService} from 'ngx-cookie-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-team',
|
selector: 'app-team',
|
||||||
|
|
@ -12,13 +13,23 @@ import {HeaderComponent} from '../header/header.component';
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
NgOptimizedImage
|
NgOptimizedImage
|
||||||
],
|
],
|
||||||
|
providers: [
|
||||||
|
CookieService,
|
||||||
|
{provide: BASE_PATH, useValue: 'http://localhost:8080/'}
|
||||||
|
],
|
||||||
|
|
||||||
templateUrl: './team.component.html',
|
templateUrl: './team.component.html',
|
||||||
styleUrl: './team.component.scss'
|
styleUrl: './team.component.scss'
|
||||||
})
|
})
|
||||||
export class TeamComponent {
|
export class TeamComponent {
|
||||||
|
public members: TeamMember[] = [];
|
||||||
|
|
||||||
constructor(public scrollService: ScrollService, public teamApi: TeamService) {
|
constructor(public scrollService: ScrollService, public teamApi: TeamService) {
|
||||||
|
console.log("TeamComponent")
|
||||||
teamApi.getTeamMembers("test").subscribe(res => {
|
teamApi.getTeamMembers("test").subscribe(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
console.log("AHH")
|
||||||
|
this.members = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@ import {AppComponent} from './app/app.component';
|
||||||
import {provideRouter} from '@angular/router';
|
import {provideRouter} from '@angular/router';
|
||||||
import {routes} from './app/app.routes';
|
import {routes} from './app/app.routes';
|
||||||
import {provideHttpClient} from '@angular/common/http';
|
import {provideHttpClient} from '@angular/common/http';
|
||||||
|
import {BASE_PATH} from './api';
|
||||||
|
|
||||||
|
|
||||||
bootstrapApplication(AppComponent, {
|
bootstrapApplication(AppComponent, {
|
||||||
providers: [
|
providers: [
|
||||||
provideRouter(routes),
|
provideRouter(routes),
|
||||||
provideHttpClient()
|
provideHttpClient(),
|
||||||
|
{provide: BASE_PATH, useValue: 'http://localhost:8080'}
|
||||||
]
|
]
|
||||||
}).catch(err => console.error(err));
|
}).catch(err => console.error(err));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user