Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
sujata
/
advithconsulting.io-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit be231a1f
authored
2025-07-24 15:20:02 +0530
by
JayGuri
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Implemented Breadcrumbing
1 parent
bdfdb72a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
components/reuseables/PageBanner.js
components/reuseables/PageBanner.js
View file @
be231a1
import
React
from
"react"
;
import
React
from
"react"
;
import
Link
from
"next/link"
;
import
Link
from
"next/link"
;
import
Image
from
"next/image"
;
import
Image
from
"next/image"
;
import
{
useRouter
}
from
"next/router"
;
import
{
Swiper
,
SwiperSlide
}
from
"swiper/react"
;
import
{
Swiper
,
SwiperSlide
}
from
"swiper/react"
;
import
{
Pagination
,
Autoplay
}
from
"swiper/modules"
;
import
{
Pagination
,
Autoplay
}
from
"swiper/modules"
;
import
{
Container
}
from
"react-bootstrap"
;
import
{
Container
}
from
"react-bootstrap"
;
const
PageBanner
=
({
banners
=
[]
})
=>
{
const
PageBanner
=
({
banners
=
[]
})
=>
{
const
router
=
useRouter
();
// Function to generate breadcrumbs for client servicing pages
const
generateClientServicingBreadcrumbs
=
()
=>
{
const
pathname
=
router
.
asPath
;
// Only apply custom breadcrumbing for client-servicing pages
if
(
!
pathname
.
includes
(
'/client-servicing'
))
{
return
null
;
}
const
pathSegments
=
pathname
.
split
(
'/'
).
filter
(
segment
=>
segment
);
const
breadcrumbs
=
[];
// Create breadcrumb mapping for better display names
const
segmentNameMap
=
{
'client-servicing'
:
'Client Servicing'
,
// Virtual Finance Office section
'virtual-finance-office'
:
'Virtual Finance Office'
,
'virtual-cfo'
:
'Virtual CFO Services'
,
'virtual-fc'
:
'Virtual FC Services'
,
'book-closures-audit'
:
'Book Closures and Audit Support'
,
'apc'
:
'Accounting Payroll & Compliance'
,
// Advisory Services section
'advisory-services'
:
'Advisory Services'
,
'transaction-advisory'
:
'Transaction Advisory'
,
'risk-advisory'
:
'Risk Advisory'
,
'business-advisory'
:
'Business Advisory'
,
// GCC as a Service
'gcc-as-a-service'
:
'GCC as a Service'
,
// Digital Transformation
'digital-transformation'
:
'Digital Transformation'
,
// Empowering Finance Consultants
'empowering-finance-consultants'
:
'Empowering Finance Consultants'
,
// Bespoke Services
'bespoke-services'
:
'Bespoke Services'
,
// Legacy mappings for existing pages
'cfo'
:
'CFO'
,
'ba'
:
'BA'
,
'ta'
:
'TA'
,
'ra'
:
'RA'
};
// Build breadcrumbs from path segments
let
currentPath
=
''
;
pathSegments
.
forEach
((
segment
,
index
)
=>
{
currentPath
+=
`/
${
segment
}
`
;
const
displayName
=
segmentNameMap
[
segment
]
||
segment
.
replace
(
/-/g
,
' '
).
replace
(
/
\b\w
/g
,
l
=>
l
.
toUpperCase
());
breadcrumbs
.
push
({
name
:
displayName
,
url
:
currentPath
,
isLast
:
index
===
pathSegments
.
length
-
1
});
});
return
breadcrumbs
;
};
const
clientServicingBreadcrumbs
=
generateClientServicingBreadcrumbs
();
return
(
return
(
<
Swiper
<
Swiper
spaceBetween
=
{
30
}
spaceBetween
=
{
30
}
...
@@ -48,10 +109,26 @@ const PageBanner = ({ banners = [] }) => {
...
@@ -48,10 +109,26 @@ const PageBanner = ({ banners = [] }) => {
<
div
className
=
"page-title-content"
>
<
div
className
=
"page-title-content"
>
<
h2
>
{
banner
.
pageTitle
}
<
/h2
>
<
h2
>
{
banner
.
pageTitle
}
<
/h2
>
<
ul
>
<
ul
>
{
clientServicingBreadcrumbs
?
(
// Custom breadcrumbs for client servicing pages
clientServicingBreadcrumbs
.
map
((
breadcrumb
,
breadcrumbIndex
)
=>
(
<
li
key
=
{
breadcrumbIndex
}
>
{
breadcrumb
.
isLast
?
(
breadcrumb
.
name
)
:
(
<
Link
href
=
{
breadcrumb
.
url
}
>
{
breadcrumb
.
name
}
<
/Link
>
)}
<
/li
>
))
)
:
(
// Default breadcrumbs for other pages
<>
<
li
>
<
li
>
<
Link
href
=
{
banner
.
homePageUrl
}
>
{
banner
.
homePageText
}
<
/Link
>
<
Link
href
=
{
banner
.
homePageUrl
}
>
{
banner
.
homePageText
}
<
/Link
>
<
/li
>
<
/li
>
<
li
>
{
banner
.
activePageText
}
<
/li
>
<
li
>
{
banner
.
activePageText
}
<
/li
>
<
/
>
)}
<
/ul
>
<
/ul
>
<
/div
>
<
/div
>
<
/Container
>
<
/Container
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment