Skip to content

Commit

Permalink
chore: fixes typo in sidebar
Browse files Browse the repository at this point in the history
fixes typo in sidebar
  • Loading branch information
rupali-codes authored Aug 2, 2024
2 parents 34a4974 + ff3e13c commit 2023961
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion components/SideNavbar/SideNavbarCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ import type { ISidebar } from '../../types'

import { Icons } from 'components/icons'

const categoriesToUppercase = ['ai'];

const capitalizeCategory =(category: string) =>{
return category
.split('-')
.map(word => categoriesToUppercase.includes(word.toLowerCase())
? word.toUpperCase()
: word.charAt(0).toUpperCase() + word.slice(1)
)
.join(' ');

}

export const SideNavbarCategory: FC<{
categoryData: ISidebar
expand: boolean
Expand Down Expand Up @@ -52,7 +65,7 @@ export const SideNavbarCategory: FC<{
category.length < 4 ? 'uppercase' : 'capitalize'
}`}
>
{category.split('-').join(' ')}
{capitalizeCategory(category)}
</h1>
<Icons.angleDown
className={`${
Expand Down

0 comments on commit 2023961

Please sign in to comment.