feat: implement BackButton component for consistent navigation
- Added BackButton component to standardize back navigation across pages. - Integrated BackButton into various pages, replacing custom back buttons for consistency. - Updated PageHeader to accept backTo prop for displaying BackButton when navigating from subpages. - Created useGoBack hook to handle navigation logic, determining whether to go back in history or redirect to a fallback page. - Added tests for BackButton and its integration with PageHeader to ensure expected behavior.
This commit is contained in:
@@ -184,6 +184,7 @@ export default function RepresentationDetailPage() {
|
||||
return (
|
||||
<div>
|
||||
<PageHeader
|
||||
backTo="/admin/representations"
|
||||
title="جزئیات نماینده"
|
||||
breadcrumbs={[
|
||||
{ label: 'داشبورد', to: '/admin/dashboard' },
|
||||
@@ -206,6 +207,7 @@ export default function RepresentationDetailPage() {
|
||||
return (
|
||||
<div>
|
||||
<PageHeader
|
||||
backTo="/admin/representations"
|
||||
title="نماینده یافت نشد"
|
||||
breadcrumbs={[
|
||||
{ label: 'داشبورد', to: '/admin/dashboard' },
|
||||
@@ -224,6 +226,7 @@ export default function RepresentationDetailPage() {
|
||||
return (
|
||||
<div>
|
||||
<PageHeader
|
||||
backTo="/admin/representations"
|
||||
title={name}
|
||||
breadcrumbs={[
|
||||
{ label: 'داشبورد', to: '/admin/dashboard' },
|
||||
|
||||
Reference in New Issue
Block a user