prettify headings

This commit is contained in:
Andrzej Stepien 2023-09-07 10:07:49 +02:00
parent e483e39c5d
commit e54ac1aa89
1 changed files with 3 additions and 2 deletions

View File

@ -83,8 +83,9 @@ export default function Table(props) {
}
return"\u2002"
}
const capitalisedHeading = heading.slice(0,1).toUpperCase()+heading.slice(1)
return <th key={heading + i}><button onClick={isSortable()?() => { changeSortBy(heading) }:()=>{}}>{renderArrows(heading)+" "+capitalisedHeading+" "+renderArrows(heading)}</button></th>
const prettifiedHeading = heading.slice(0,1).toUpperCase()+heading.slice(1)
.replace(/_/,' ')
return <th key={heading + i}><button onClick={isSortable()?() => { changeSortBy(heading) }:()=>{}}>{renderArrows(heading)+" "+prettifiedHeading+" "+renderArrows(heading)}</button></th>
})}
</tr>
}