Skip to content

Commit b5168bb

Browse files
committed
Fix margin issue with dialog box
1 parent 6fc2041 commit b5168bb

File tree

2 files changed

+69
-44
lines changed

2 files changed

+69
-44
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.container {
2+
padding: 2rem;
3+
background-color: var(--surface-section);
4+
border-radius: 0.75rem;
5+
display: flex;
6+
flex-direction: column;
7+
align-items: center;
8+
}
9+
10+
.form-container {
11+
display: flex;
12+
flex-direction: column;
13+
gap: 1rem;
14+
width: 100%;
15+
}
16+
17+
.form-field {
18+
display: flex;
19+
flex-direction: column;
20+
gap: 0.5rem;
21+
width: 100%;
22+
}

frontend/src/app/questions/question-dialog.component.html

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ng-template>
1313

1414
<form [formGroup]="questionFormGroup">
15-
<div class="field grid col-12">
15+
<div class="form-field mb-4">
1616
<label for="title">Title</label>
1717
<input
1818
formControlName="title"
@@ -25,51 +25,54 @@
2525
<small class="text-red-300">Title is required.</small>
2626
}
2727
</div>
28-
<div class="formgrid grid field">
29-
<div class="field col-12 md:col-6">
30-
<label for="questionTopics">Topics</label>
31-
<p-multiSelect
32-
required="true"
33-
[style]="{ width: '100%' }"
34-
[options]="topics"
35-
(onFilter)="onFilterTopics($event)"
36-
formControlName="topics"
37-
optionLabel="label"
38-
optionValue="value"
39-
placeholder="Select Topics">
40-
<ng-template let-option pTemplate="item">
41-
<span>{{ option.label }}</span>
42-
</ng-template>
28+
<div class="form-field mb-4">
29+
<label for="questionTopics">Topics</label>
4330

44-
<ng-template pTemplate="footer">
45-
<p-button
46-
*ngIf="isNoResultsFound"
47-
type="button"
48-
label="Add as New Topic"
49-
icon="pi pi-plus"
50-
(click)="addNewTopic()" />
51-
</ng-template>
52-
</p-multiSelect>
53-
@if (isTopicsInvalid) {
54-
<small class="text-red-300">Topic(s) is required.</small>
55-
}
56-
</div>
57-
<div class="field col-12 md:col-6">
58-
<label for="questionTopics">Difficulty</label>
59-
<p-dropdown
60-
[required]="true"
61-
[style]="{ width: '100%' }"
62-
[options]="difficulties"
63-
formControlName="difficulty"
64-
optionLabel="label"
65-
optionValue="value"
66-
placeholder="Select Difficulty" />
67-
@if (isDifficultyInvalid) {
68-
<small class="text-red-300">Difficulty is required.</small>
69-
}
70-
</div>
31+
<p-multiSelect
32+
required="true"
33+
class="w-12"
34+
[style]="{ width: '100%' }"
35+
[options]="topics"
36+
(onFilter)="onFilterTopics($event)"
37+
formControlName="topics"
38+
optionLabel="label"
39+
optionValue="value"
40+
placeholder="Select Topics">
41+
<ng-template let-option pTemplate="item">
42+
<span>{{ option.label }}</span>
43+
</ng-template>
44+
45+
<ng-template pTemplate="footer">
46+
<p-button
47+
*ngIf="isNoResultsFound"
48+
type="button"
49+
label="Add as New Topic"
50+
icon="pi pi-plus"
51+
(click)="addNewTopic()" />
52+
</ng-template>
53+
</p-multiSelect>
54+
@if (isTopicsInvalid) {
55+
<small class="text-red-300">Topic(s) is required.</small>
56+
}
57+
</div>
58+
<div class="form-field mb-4">
59+
<label for="questionTopics">Difficulty</label>
60+
61+
<p-dropdown
62+
class="w-12 flex align-items-center justify-content-center"
63+
autoWidth="false"
64+
[required]="true"
65+
[style]="{ width: '100%' }"
66+
[options]="difficulties"
67+
formControlName="difficulty"
68+
optionLabel="label"
69+
optionValue="value"
70+
placeholder="Select Difficulty" />
71+
@if (isDifficultyInvalid) {
72+
<small class="text-red-300">Difficulty is required.</small>
73+
}
7174
</div>
72-
<div class="field grid col-12" field>
75+
<div class="form-field">
7376
<label for="questionDescription">Description</label>
7477
<textarea
7578
formControlName="description"

0 commit comments

Comments
 (0)