fix: allow award title unbold via custom styles (#3250) (#3257)

This commit is contained in:
EMRAN
2026-07-27 13:22:37 +02:00
committed by GitHub
parent 47349e7ab3
commit 08d859010c
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -78,9 +78,9 @@ function sectionHeading(title: string, colorHex: string): Paragraph {
});
}
function titleAndSubtitle(primary: string, secondary: string, rightText?: string): Paragraph {
function titleAndSubtitle(primary: string, secondary: string, rightText?: string, bold = true): Paragraph {
const baseRun = getBaseRun();
const children: (TextRun | ExternalHyperlink)[] = [new TextRun({ text: primary, bold: true, ...baseRun })];
const children: (TextRun | ExternalHyperlink)[] = [new TextRun({ text: primary, bold, ...baseRun })];
if (secondary) {
children.push(new TextRun({ text: `${secondary}`, ...baseRun }));
@@ -321,7 +321,7 @@ function renderAwards(section: Sections["awards"], colorHex: string): Paragraph[
const paragraphs: Paragraph[] = [sectionHeading(section.title, colorHex)];
for (const item of items) {
paragraphs.push(titleAndSubtitle(item.title, item.awarder, item.date));
paragraphs.push(titleAndSubtitle(item.title, item.awarder, item.date, false));
if (item.description) {
paragraphs.push(...htmlToParagraphs(item.description, getHtmlStyle()));
@@ -749,7 +749,7 @@ const AwardsSection = ({ sectionId = "awards", sectionData }: ItemSectionProps<A
<SectionItem key={item.id}>
<SectionItemHeader>
<View style={composeStyles(splitRowStyle, awardTitleDateRowStyle)}>
<ItemTitle website={item.website}>{item.title}</ItemTitle>
<ItemTitle website={item.website} bold={false}>{item.title}</ItemTitle>
<Text style={composeStyles(alignEndStyle)}>{item.date}</Text>
</View>
<Text>{item.awarder}</Text>