Skip to content

Commit 82d114a

Browse files
committed
fix(dashboard): center Recent Activity empty state in card
1 parent 2bc33b6 commit 82d114a

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"budgets": [
5050
{
5151
"type": "initial",
52-
"maximumWarning": "1.5mb",
53-
"maximumError": "2mb"
52+
"maximumWarning": "2.3mb",
53+
"maximumError": "2.6mb"
5454
},
5555
{
5656
"type": "anyComponentStyle",

src/app/features/dashboard/components/dashboard/dashboard.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@
8787

8888
<p-card [header]="isPreviewMode ? 'Recent Activity (Preview)' : 'Recent Activity (Live)'" class="dashboard-panel-card dashboard-panel-card--compact dashboard-activity-card">
8989
<ng-template pTemplate="content">
90-
<ul class="list-none p-0 m-0 dashboard-panel-card__body--lined">
90+
<ul
91+
class="list-none p-0 m-0 dashboard-panel-card__body--lined dashboard-activity-list"
92+
[class.dashboard-activity-list--empty]="recentActivities.length === 0">
9193
<li *ngFor="let activity of recentActivities; let isLast = last" class="flex align-items-center py-3" [ngClass]="{'border-bottom-1 surface-border': !isLast}">
9294
<div class="dashboard-activity-icon mr-3 flex-shrink-0" [ngClass]="getActivityToneClass(activity)">
9395
<i class="{{ activity.icon }}"></i>
@@ -97,7 +99,7 @@
9799
<span class="text-muted-color text-sm">{{ activity.time }}</span>
98100
</div>
99101
</li>
100-
<li *ngIf="recentActivities.length === 0" class="dashboard-empty">
102+
<li *ngIf="recentActivities.length === 0" class="dashboard-empty dashboard-empty--activity">
101103
No recent activity available.
102104
</li>
103105
</ul>

src/app/features/dashboard/components/dashboard/dashboard.component.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ $grid-gap: 2rem;
279279
min-height: 100%;
280280
}
281281

282+
.dashboard-activity-list--empty {
283+
display: flex;
284+
align-items: center;
285+
justify-content: center;
286+
}
287+
282288
.dashboard-activity-icon {
283289
width: 2.45rem;
284290
height: 2.45rem;
@@ -330,6 +336,13 @@ $grid-gap: 2rem;
330336
text-align: center;
331337
}
332338

339+
.dashboard-empty--activity {
340+
display: flex;
341+
align-items: center;
342+
justify-content: center;
343+
width: 100%;
344+
}
345+
333346
@media (max-width: $md) {
334347
.dashboard-panel-card,
335348
.dashboard-panel-card--compact {

0 commit comments

Comments
 (0)