Skip to content

Commit c98aff0

Browse files
committed
feat: save
1 parent cbe3967 commit c98aff0

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

apps/angular/view-transition/src/app/blog/blog.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import { ThumbnailComponent } from './thumbnail.component';
88
imports: [ThumbnailComponent],
99
template: `
1010
<div
11-
class="flex h-20 items-center justify-center border-b-2 text-4xl shadow-md">
11+
class="fixed left-0 right-0 top-0 z-50 flex h-20 items-center justify-center border-b-2 bg-white text-4xl shadow-md">
1212
Blog List
1313
</div>
14-
<div class="flex h-screen flex-col items-center gap-10 border p-10">
14+
<div class="my-20 flex h-screen flex-col items-center gap-10 border p-10">
1515
@for (post of posts; track post.id) {
1616
<blog-thumbnail [post]="post" />
1717
}

apps/angular/view-transition/src/app/post/post.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@ import {
55
computed,
66
input,
77
} from '@angular/core';
8+
import { RouterLink } from '@angular/router';
89
import { ThumbnailHeaderComponent } from '../blog/thumbnail-header.component';
910
import { fakeTextChapters, posts } from '../data';
1011
import { PostHeaderComponent } from './post-header.component';
1112

1213
@Component({
1314
selector: 'post',
1415
standalone: true,
15-
imports: [ThumbnailHeaderComponent, NgOptimizedImage, PostHeaderComponent],
16+
imports: [
17+
ThumbnailHeaderComponent,
18+
NgOptimizedImage,
19+
PostHeaderComponent,
20+
RouterLink,
21+
],
1622
template: `
17-
<div class="w-full max-w-[800px]">
23+
<div class="relative w-full max-w-[800px]">
24+
<button
25+
routerLink="/"
26+
class="absolute left-2 top-2 z-20 rounded-md border bg-white p-2">
27+
Back
28+
</button>
1829
<img [ngSrc]="post().image" alt="" width="960" height="540" />
1930
<h2 class="p-7 text-center text-5xl">{{ post().title }}</h2>
2031
<post-header [date]="post().date" class="mb-20" />

0 commit comments

Comments
 (0)