Skip to content

Commit eb5a18b

Browse files
committed
Fix the styling around new topic dialog
1 parent a20bd75 commit eb5a18b

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
<mat-card-header>
2-
<div class="column-layout">
3-
<mat-card-title>Create Topic</mat-card-title>
4-
<mat-card-subtitle>Topic will be created for: </mat-card-subtitle>
5-
</div>
6-
</mat-card-header>
1+
<mat-dialog-content>
2+
<mat-card-header>
3+
<div class="column-layout">
4+
<mat-card-title>Create Topic</mat-card-title>
5+
<mat-card-subtitle>Topic will be created for: </mat-card-subtitle>
6+
</div>
7+
</mat-card-header>
78

8-
<mat-card-content class="column-layout">
9-
<mat-form-field appearance="outline">
10-
<input matInput type="text" autocomplete="off" autofocus placeholder="New Topic ID" [formControl]="this.topicName">
11-
</mat-form-field>
12-
<button mat-raised-button color="accent" (click)="this.submit()">Create Topic</button>
13-
</mat-card-content>
9+
<mat-card-content class="column-layout">
10+
<mat-form-field appearance="outline">
11+
<input matInput type="text" autocomplete="off" autofocus placeholder="New Topic ID"
12+
[formControl]="this.topicName">
13+
</mat-form-field>
14+
<button mat-raised-button color="accent" (click)="this.submit()">Create Topic</button>
15+
</mat-card-content>
16+
</mat-dialog-content>

webapp/src/app/components/topic-list/new-topic-dialog/new-topic-dialog.component.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { Component, OnInit, inject } from '@angular/core';
22
import { UntypedFormControl, Validators, ReactiveFormsModule } from '@angular/forms';
3-
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
3+
import { MatDialog, MatDialogContent, MatDialogRef } from '@angular/material/dialog';
44
import { MatCardHeader, MatCardTitle, MatCardSubtitle, MatCardContent } from '@angular/material/card';
55
import { MatFormField } from '@angular/material/form-field';
66
import { MatInput } from '@angular/material/input';
77
import { MatButton } from '@angular/material/button';
88

99
@Component({
10-
selector: 'app-new-topic-dialog',
11-
templateUrl: './new-topic-dialog.component.html',
12-
styleUrls: ['./new-topic-dialog.component.scss'],
13-
standalone: true,
14-
imports: [MatCardHeader, MatCardTitle, MatCardSubtitle, MatCardContent, MatFormField, MatInput, ReactiveFormsModule, MatButton]
10+
selector: 'app-new-topic-dialog',
11+
templateUrl: './new-topic-dialog.component.html',
12+
styleUrls: ['./new-topic-dialog.component.scss'],
13+
standalone: true,
14+
imports: [MatCardHeader, MatCardTitle, MatCardSubtitle, MatCardContent, MatFormField, MatInput, ReactiveFormsModule, MatButton, MatDialogContent]
1515
})
1616
export class NewTopicDialogComponent implements OnInit {
1717
private ref = inject<MatDialogRef<NewTopicDialogComponent>>(MatDialogRef);
@@ -22,9 +22,9 @@ export class NewTopicDialogComponent implements OnInit {
2222
ngOnInit(): void {
2323
}
2424

25-
submit(): void{
26-
if(this.topicName.valid){
27-
this.ref.close({newTopic: this.topicName.value})
25+
submit(): void {
26+
if (this.topicName.valid) {
27+
this.ref.close({ newTopic: this.topicName.value })
2828
}
2929
}
3030

0 commit comments

Comments
 (0)