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:
@@ -9,6 +9,7 @@ import { usePermissions } from '../hooks/usePermissions';
|
||||
import SettingsLayout from '../components/layout/SettingsLayout';
|
||||
import { ScheduleSection } from '../components/schedule/ScheduleSection';
|
||||
import FreeVisitPrice from '../components/FreeVisitPrice';
|
||||
import BackButton from '../components/ui/BackButton';
|
||||
import type { ClinicDoctorItem } from '../components/ClinicDoctorsManager';
|
||||
|
||||
/**
|
||||
@@ -56,6 +57,9 @@ function ClinicAppointmentSettingsContent() {
|
||||
|
||||
return (
|
||||
<div className="fade-in" style={{ display: 'flex', flexDirection: 'column', gap: 'var(--gap)' }}>
|
||||
<div>
|
||||
<BackButton fallback="/admin/settings-menu" />
|
||||
</div>
|
||||
<div className="card-title-row">
|
||||
<div>
|
||||
<h1 className="section-title">مدیریت نوبت دهی</h1>
|
||||
|
||||
Reference in New Issue
Block a user