Fix Reading Session Timeline bars (#1978)
* Fix Reading Session Timeline bars * Remove header --------- Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+5
-2
@@ -1,8 +1,11 @@
|
||||
<div class="reading-session-heatmap-container">
|
||||
<div class="chart-header">
|
||||
<div class="chart-title">
|
||||
<h3>Reading Session Activity</h3>
|
||||
<p class="chart-description">Daily reading session activity throughout the year</p>
|
||||
<h3>
|
||||
<i class="pi pi-calendar heatmap-title-icon"></i>
|
||||
{{ getTitle() }}
|
||||
</h3>
|
||||
<p class="chart-description">Daily overview of your reading sessions across the year</p>
|
||||
</div>
|
||||
<div class="year-selector">
|
||||
<button type="button"
|
||||
|
||||
+7
@@ -82,6 +82,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
.heatmap-title-icon {
|
||||
font-size: 1.5rem;
|
||||
color: var(--primary-color);
|
||||
vertical-align: middle;
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chart-header {
|
||||
flex-direction: column;
|
||||
|
||||
+7
@@ -28,6 +28,7 @@ type SessionHeatmapChartData = ChartData<'matrix', MatrixDataPoint[], string>;
|
||||
})
|
||||
export class ReadingSessionHeatmapComponent implements OnInit, OnDestroy {
|
||||
@Input() initialYear: number = new Date().getFullYear();
|
||||
@Input() userName: string = '';
|
||||
|
||||
public currentYear: number = new Date().getFullYear();
|
||||
public readonly chartType = 'matrix' as const;
|
||||
@@ -225,4 +226,10 @@ export class ReadingSessionHeatmapComponent implements OnInit, OnDestroy {
|
||||
date.setDate(date.getDate() + (week * 7) - date.getDay());
|
||||
return date;
|
||||
}
|
||||
|
||||
public getTitle(): string {
|
||||
return this.userName
|
||||
? `${this.userName}'s Reading Session Activity`
|
||||
: 'Reading Session Activity';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user