Skip to content

Commit dac4c4c

Browse files
committed
fixing sonar cloud issues
1 parent 46fc844 commit dac4c4c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

frontend/src/components/ContributionHeatmap.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ const generateHeatmapSeries = (
6161
}
6262

6363
// Reverse the series so Monday is at the top and Sunday at the bottom
64-
return { heatmapSeries: series.reverse() }
64+
const reversedSeries = series.reverse()
65+
return { heatmapSeries: reversedSeries }
6566
}
6667

6768
// Helper function to generate chart options
@@ -235,6 +236,7 @@ const ContributionHeatmap: React.FC<ContributionHeatmapProps> = ({
235236
contributionData,
236237
startDate,
237238
endDate,
239+
title,
238240
unit = 'contribution',
239241
variant = 'default',
240242
}) => {
@@ -252,6 +254,11 @@ const ContributionHeatmap: React.FC<ContributionHeatmapProps> = ({
252254

253255
return (
254256
<div className="">
257+
{title && (
258+
<h3 className="mb-4 text-sm font-semibold text-gray-800 dark:text-gray-200">
259+
{title}
260+
</h3>
261+
)}
255262
<div className="max-w-5xl">
256263
<style>
257264
{`
@@ -271,7 +278,7 @@ const ContributionHeatmap: React.FC<ContributionHeatmapProps> = ({
271278
rx: 2;
272279
ry: 2;
273280
}
274-
${!isCompact ? '.heatmap-container-default .apexcharts-canvas { transform: scale(0.85); transform-origin: left top; }' : ''}
281+
${isCompact ? '' : '.heatmap-container-default .apexcharts-canvas { transform: scale(0.85); transform-origin: left top; }'}
275282
@media (max-width: 768px) {
276283
.heatmap-container-${isCompact ? 'compact' : 'default'} {
277284
${isCompact ? 'min-width: 320px;' : 'transform: scale(0.7); transform-origin: left top;'}

frontend/src/components/ContributionStats.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ interface ContributionStatsData {
1515
}
1616

1717
interface ContributionStatsProps {
18-
title: string
19-
stats?: ContributionStatsData
18+
readonly title: string
19+
readonly stats?: ContributionStatsData
2020
}
2121

22-
export default function ContributionStats({ title, stats }: ContributionStatsProps) {
22+
export default function ContributionStats({ title, stats }: Readonly<ContributionStatsProps>) {
2323
const formatNumber = (value?: number) => {
2424
return typeof value === 'number' ? value.toLocaleString() : '0'
2525
}

0 commit comments

Comments
 (0)