Skip to content

Commit 4fb8a25

Browse files
committed
fix: display full content in statistics cards
- Remove manual text truncation that limited titles to 12 characters - Change line-clamp from 1 to 2 for summary grid cards to show full text - Increase padding and add min-height to accommodate full content - Change grid cards from fixed height to line-clamp-3 for better text display - Fixes issue where statistics card titles were truncated with ellipses
1 parent 9d1e2c4 commit 4fb8a25

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/Stats.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const Stats = () => {
126126
></div>
127127
</motion.div>
128128
<div className="p-4 sm:p-5 md:p-6">
129-
<h3 className="text-gray-700 dark:text-gray-200 text-lg sm:text-xl font-medium mb-2 sm:mb-3 font-AnonymousPro line-clamp-2 h-12 sm:h-14">
129+
<h3 className="text-gray-700 dark:text-gray-200 text-lg sm:text-xl font-medium mb-2 sm:mb-3 font-AnonymousPro line-clamp-3">
130130
{stat.title}
131131
</h3>
132132
<motion.div
@@ -165,7 +165,7 @@ const Stats = () => {
165165
{statisticsData.map((stat, index) => (
166166
<motion.div
167167
key={index}
168-
className={`px-2 sm:px-3 md:px-4 py-2 sm:py-3 rounded-md sm:rounded-lg ${stat.bgColor} border ${stat.borderColor} flex flex-col items-center justify-center`}
168+
className={`px-2 sm:px-3 md:px-4 py-3 sm:py-4 md:py-5 rounded-md sm:rounded-lg ${stat.bgColor} border ${stat.borderColor} flex flex-col items-center justify-center min-h-[80px] sm:min-h-[90px]`}
169169
whileHover={{
170170
scale: 1.05,
171171
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
@@ -177,9 +177,8 @@ const Stats = () => {
177177
>
178178
{stat.value}
179179
</span>
180-
<span className="text-gray-700 dark:text-gray-300 text-2xs sm:text-xs md:text-sm text-center mt-0.5 sm:mt-1 line-clamp-1">
181-
{stat.title.split('.')[0].substring(0, 12)}
182-
{stat.title.split('.')[0].length > 12 ? '...' : ''}
180+
<span className="text-gray-700 dark:text-gray-300 text-2xs sm:text-xs md:text-sm text-center mt-0.5 sm:mt-1 line-clamp-2 leading-tight">
181+
{stat.title}
183182
</span>
184183
</motion.div>
185184
))}

0 commit comments

Comments
 (0)