Skip to content

Commit 3bd374d

Browse files
committed
Refactor home component layout by adjusting heading margins and introducing icon-text containers for better alignment
1 parent ac2de34 commit 3bd374d

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/app/home/home.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,6 @@ drag-scroll::-webkit-scrollbar {
364364
}
365365

366366
h3 {
367-
margin-top: 0.4em;
368-
margin-bottom: 0.4em;
367+
margin-top: 1em;
368+
margin-bottom: 0.6em;
369369
}

src/app/home/home.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,23 @@
5959
<mat-card-title>Status</mat-card-title>
6060
</mat-card-header>
6161
<mat-card-content>
62-
<h3><mat-icon>dns</mat-icon> Relays</h3>
62+
<h3 class="icon-text-container"><mat-icon>dns</mat-icon> Relays</h3>
6363
<p>
6464
@for(relay of relayService.items; track relay.url) {
65+
<span class="icon-text-container">
6566
<mat-icon class="relay-status-icon" *ngIf="!relay.enabled">cloud_off</mat-icon>
6667
<mat-icon class="relay-status-icon" *ngIf="relay.enabled && relay.status == 1" [ngClass]="['relay-status-' + relay.status]">cloud_done</mat-icon>
6768
<mat-icon class="relay-status-icon" *ngIf="relay.enabled && relay.status !== 1" [ngClass]="['relay-status-' + relay.status]">cloud</mat-icon>
6869
{{ relay.nip11?.name }} ({{ relay.eventcount }})
69-
<br />
70+
</span>
7071
}
7172
</p>
72-
<h3><mat-icon>info</mat-icon> Data</h3>
73+
<h3 class="icon-text-container"><mat-icon>info</mat-icon> Data</h3>
7374
<p>
74-
<mat-icon>people</mat-icon> Following: {{ profileService.following.length }}<br />
75+
<span class="icon-text-container">
76+
<mat-icon>people</mat-icon>
77+
<span>Following: {{ profileService.following.length }}</span>
78+
</span>
7579
</p>
7680
</mat-card-content>
7781
</mat-card>

src/styles.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ a:hover {
5858
));
5959
}
6060

61+
.icon-text-container {
62+
display: flex;
63+
align-items: center;
64+
gap: 4px;
65+
margin-bottom: 4px;
66+
67+
mat-icon {
68+
margin-right: 0px;
69+
}
70+
}
71+
6172
// Include the common styles for Angular Material. We include this here so that you only
6273
// have to load a single css file for Angular Material in your app.
6374
// Be sure that you only ever include this mixin once!

0 commit comments

Comments
 (0)