Skip to content

Commit 771ba43

Browse files
committed
fix(template): use flex layout for description instead of truncation
1 parent 7c583ce commit 771ba43

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

src/template.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ function formatNumber(count: number): string {
2727
return count.toString()
2828
}
2929

30-
function truncateDescription(desc: string | null, maxLength = 120): string {
31-
if (!desc) return 'A CodingWithCalvin project'
32-
if (desc.length <= maxLength) return desc
33-
return desc.substring(0, maxLength - 3) + '...'
34-
}
35-
3630
export function SocialPreviewTemplate({
3731
repo,
3832
logoFullBase64,
@@ -237,15 +231,17 @@ export function SocialPreviewTemplate({
237231
/>
238232

239233
{/* Description */}
240-
<span
234+
<div
241235
style={{
242236
color: COLORS.gray,
243237
fontSize: '26px',
244-
lineHeight: 1.5,
245-
marginTop: '16px'
238+
lineHeight: 1.4,
239+
marginTop: '16px',
240+
flex: 1,
241+
overflow: 'hidden'
246242
}}>
247-
{truncateDescription(repo.description, 200)}
248-
</span>
243+
{repo.description || 'A CodingWithCalvin project'}
244+
</div>
249245
</div>
250246
</div>
251247

0 commit comments

Comments
 (0)