feat(tour): add onboarding tours for various admin pages

- Integrated TourButton component into SettingsMenuPage, SkillsPage, SmsWalletPage, StaffPage, StaffSessionDetailPage, StaffTreatmentSessionsPage, SubscriptionPage, TagsSettingsPage, TreatmentCasesPage to enhance user onboarding experience.
- Created new tour definitions for appointments, clinics, staff management, financial management, and patient management, ensuring comprehensive guidance for users navigating the admin panel.
- Updated documentation to reflect the addition of tours and their implementation details.
This commit is contained in:
hamed
2026-08-10 10:10:20 +03:30
parent 20c8eaaad9
commit ecdefa3c24
73 changed files with 1008 additions and 76 deletions
+9 -5
View File
@@ -8,17 +8,21 @@ import { getTour } from '../../lib/tour/registry';
* وجود تور قبل از هر هوکی بررسی می‌شود تا صفحه‌ای که راهنما ندارد — یعنی بیشتر
* صفحات پنل — هیچ درخواستی برای وضعیت تورها نفرستد.
*/
export default function TourButton({ tourId }: { tourId?: string }) {
export default function TourButton({ tourId, ready = false }: { tourId?: string; ready?: boolean }) {
const tour = getTour(tourId);
if (!tour) return null;
return <TourLauncher tourId={tour.id} />;
return <TourLauncher tourId={tour.id} ready={ready} />;
}
/** اجرای خودکار وظیفهٔ خود صفحه است؛ این دکمه فقط دستی اجرا می‌کند. */
function TourLauncher({ tourId }: { tourId: string }) {
const { start } = useTour(tourId);
/**
* `ready` یعنی محتوای صفحه نشسته است و اجرای خودکارِ بار اول مجاز است.
* صفحه‌ای که دکمه را مستقیم می‌گذارد و آماده‌بودنش را نمی‌داند، آن را false می‌گذارد
* و تور فقط با کلیک اجرا می‌شود.
*/
function TourLauncher({ tourId, ready }: { tourId: string; ready: boolean }) {
const { start } = useTour(tourId, { ready });
return (
<button