Skip to content

Commit

Permalink
Merge pull request #2 from Sybit-Education/feat/bilder
Browse files Browse the repository at this point in the history
Bilder hinzugefügt
  • Loading branch information
AlexanderKugler committed Jul 30, 2024
2 parents 85d8f96 + 2356f76 commit 7529843
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<app-footer></app-footer>

<div class="sytivities">
<router-outlet></router-outlet>
<app-footer></app-footer>
</div>
4 changes: 4 additions & 0 deletions src/app/components/detail/detail.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{activity?.name}}
@if (activity?.media) {
<img [src]="activity?.media.file?.[0].url" alt="{{activity?.name}} Bild">
}
27 changes: 22 additions & 5 deletions src/app/components/detail/detail.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
import {Component} from '@angular/core';
import {AsyncPipe} from "@angular/common";
import {RouterLink} from "@angular/router";
import {Component, OnInit} from '@angular/core';
import {AirtableService} from "../../services/airtable.service";
import {AsyncPipe, NgStyle} from "@angular/common";
import {Activity} from "../../types/activity.interface";
import {ActivatedRoute, RouterLink} from "@angular/router";

@Component({
selector: 'app-detail',
standalone: true,
imports: [
AsyncPipe,
RouterLink
RouterLink,
NgStyle
],
templateUrl: './detail.component.html',
styleUrl: './detail.component.scss'
})
export class DetailComponent {
export class DetailComponent implements OnInit {
activity: Activity | null = null;

constructor(
private route: ActivatedRoute,
private activityService: AirtableService
) {}

ngOnInit(): void {
const osmId = this.route.snapshot.paramMap.get('osm_id');
if (osmId) {
this.activityService.getActivitiesByOsmId(osmId).subscribe((activities) => {
this.activity = activities[0];
});
}
}
}
7 changes: 5 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<title></title>

<meta charset="utf-8">
<title>Sytivities</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/favicon.ico">
</head>
<body>
<app-root></app-root>
Expand Down

0 comments on commit 7529843

Please sign in to comment.