Skip to content

Commit

Permalink
Revert "#2246 fix issue of [BUG] search query value in breadcrumbs"
Browse files Browse the repository at this point in the history
This reverts commit 9f5c471.
  • Loading branch information
sanjeevkumar321 committed Feb 2, 2024
1 parent 9f5c471 commit 6521b8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export const TopBar: FC<TopBarProps> = ({}) => {
const { theme } = useTheme()

const category = router.asPath
const searchQuery = router.query.query?.toString() || ''
const categoryName = category?.split('/')[1]?.split('-').join(' ')
const subcategoryName = category?.split('/')[2]?.split('-').join(' ')
let categoryName = category?.split('/')[1]?.split('-').join(' ')

const searchQuery = router.query.query?.toString() || ''

let cleanedCategory = ''
cleanedCategory = (subcategoryName || categoryName)
.replaceAll(regEx, ' ')
.replaceAll('search query ', '')
categoryName = searchQuery.length > 0 ? cleanedCategory : categoryName

// Helper function to capitalize the first letter of each word
const capitalizeEachWord = (str: string) => {
Expand Down

0 comments on commit 6521b8f

Please sign in to comment.