Skip to content

Commit 61c3b76

Browse files
committed
Fix navigation in the lists
1 parent c2741fe commit 61c3b76

File tree

12 files changed

+39
-15
lines changed

12 files changed

+39
-15
lines changed

apps/codelab/src/app/admin/admin.module.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import { UsersModule } from './users/users.module';
99
import { ContentModule } from './content/presentation-editor/content.module';
1010
import { PreviewModule } from './content/presentation-editor/preview/preview.module';
1111
import { PresentationListModule } from './content/presentation-list/presentation-list.module';
12-
import { initializeApp, provideFirebaseApp } from "@angular/fire/app";
13-
import { environment } from "../../environments/environment";
14-
import { getFirestore, provideFirestore } from "@angular/fire/firestore";
1512

1613
@NgModule({
1714
imports: [

apps/codelab/src/app/admin/content/presentation-editor/preview/slide-preview/small-slide-preview/small-slide-preview/small-slide-preview.component.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
:host-context(.small) slides-slide-preview {
1414
width: 500px;
1515
height: 410px;
16+
transform: scale(0.2);
1617
}
1718

1819
:host-context(.medium) {
@@ -24,11 +25,12 @@
2425
:host-context(.medium) slides-slide-preview {
2526
width: 1050px;
2627
height: 780px;
28+
transform: scale(0.25);
2729
}
2830

2931
slides-slide-preview {
3032
display: block;
31-
transform: scale(0.2);
33+
3234
position: absolute;
3335
transform-origin: 0 0;
3436
width: 500px;

apps/codelab/src/app/admin/content/presentation-editor/services/content.service.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ export class ContentService implements OnDestroy {
4949
return reducer(state, action);
5050
}, {}),
5151
shareReplay(1),
52-
tap(() => {
53-
console.log('kmon');
54-
}),
5552
);
5653

5754
constructor(
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
@import url('https://cdn.jsdelivr.net/npm/medium-editor@latest/dist/css/medium-editor.min.css');
22
@import url('https://cdn.jsdelivr.net/npm/medium-editor@latest/dist/css/themes/default.css');
3+
4+
:host {
5+
font-size: 20px;
6+
display: block;
7+
}

apps/codelab/src/app/admin/content/presentation-list/presentation-list.component.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@
3131
}
3232

3333

34+
button {
35+
background: transparent;
36+
border: 0 solid;
37+
text-align: start;
38+
}

apps/codelab/src/app/admin/content/presentation-list/presentation-list.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
</button>
2020
</div>
2121

22-
<a class="first-slide"
22+
<button class="first-slide"
2323
mat-list-item
24-
[routerLink]="'./' + presentation.id + '/0'">
24+
(click)="goToPresentation(presentation.id)">
2525
<ng-container *ngIf="presentation.slides[0] as slide else empty">
2626
<slides-small-slide-preview
2727
class="medium"
@@ -32,7 +32,7 @@
3232
<ng-template #empty>
3333
No value
3434
</ng-template>
35-
</a>
35+
</button>
3636
</div>
3737
</mat-nav-list>
3838

apps/codelab/src/app/admin/content/presentation-list/presentation-list.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export class PresentationListComponent {
2727
this.contentService.addPresentation(presentation);
2828
}
2929

30+
goToPresentation(presentationId: string){
31+
return this.navigationService.goToPresentation(presentationId)
32+
}
3033
deletePresentation(presentationId: string) {
3134
this.contentService.deletePresentation(presentationId);
3235
}

apps/codelab/src/app/v2/presentation-list/presentation-list.component.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@
2727
border: 1px #ddd solid;
2828
}
2929

30+
31+
button {
32+
background: transparent;
33+
border: 0 solid;
34+
text-align: start;
35+
}

apps/codelab/src/app/v2/presentation-list/presentation-list.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<mat-nav-list class="wrapper">
2-
<a
2+
<button
33
*ngFor="let presentation of presentations$ | async"
44
mat-list-item
5-
[routerLink]="'./' + presentation.id + '/0'"
5+
(click)="goToPresentation(presentation.id)"
66
class="presentation"
77
>
88
<div class="header">
@@ -17,5 +17,5 @@
1717
></slides-small-slide-preview>
1818
</div>
1919
</div>
20-
</a>
20+
</button>
2121
</mat-nav-list>

apps/codelab/src/app/v2/presentation-list/presentation-list.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ export class PresentationListComponent {
1313
constructor(
1414
private readonly contentService: ContentService,
1515
readonly navigationService: NavigationService
16-
) {}
16+
) {
17+
}
18+
19+
goToPresentation(presentationId: string) {
20+
return this.navigationService.goToPresentation(presentationId);
21+
}
1722
}

0 commit comments

Comments
 (0)