Skip to content

Commit 5db6f0a

Browse files
committed
docs: add variant prop to ReadingPreferenceSwitcher and update ContextMenu documentation
1 parent 14f8095 commit 5db6f0a

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

src/components/QuranReader/ContextMenu/README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,63 @@
11
# ContextMenu Component
22

3-
This directory contains a refactored version of the ContextMenu component for the Quran reader application.
3+
This directory contains the refactored version of the ContextMenu component for the Quran reader application.
44

55
## Structure
66

77
The component has been refactored into a more maintainable and scalable structure:
88

99
```
1010
ContextMenu/
11-
├── components/ # Individual UI components
12-
│ ├── ChapterNavigation.tsx # Chapter name and sidebar toggle
13-
│ └── PageInfo.tsx # Juz, Hizb, and Page information
14-
├── hooks/ # Custom hooks for state management
15-
│ └── useContextMenuState.ts # Centralized state management
16-
├── styles/ # Styles for the component
17-
│ └── ContextMenu.module.scss # Styles (moved from parent directory)
18-
├── index.tsx # Main component that composes everything
19-
└── README.md # Documentation
11+
├── components/ # Individual UI components
12+
│ ├── ChapterNavigation.tsx # Chapter name and sidebar toggle
13+
│ ├── MobileReadingTabs.tsx # Mobile-specific reading tabs
14+
│ ├── PageBookmarkAction.tsx # Bookmark functionality
15+
│ ├── PageInfo.tsx # Juz, Hizb, and Page information
16+
│ ├── ProgressBar.tsx # Reading progress visualization
17+
│ └── styles/ # Component-specific styles
18+
├── hooks/ # Custom hooks for state management
19+
│ └── useContextMenuState.ts # Centralized state management
20+
├── styles/ # Styles for the component
21+
│ └── ContextMenu.module.scss # Main styles
22+
├── index.tsx # Main component that composes everything
23+
└── README.md # Documentation
2024
```
2125

2226
## Improvements
2327

2428
1. **Separation of Concerns**:
2529
- UI components are separated from state management
2630
- Each component has a single responsibility
31+
- Mobile and desktop experiences are handled separately
2732

2833
2. **Improved Accessibility**:
2934
- Fixed accessibility issues with proper keyboard navigation
3035
- Added proper ARIA roles for interactive elements
36+
- Enhanced focus management for interactive components
3137

3238
3. **Maintainability**:
3339
- Smaller, focused components are easier to understand and modify
3440
- State management is centralized in a custom hook
41+
- Responsive behavior is clearly separated
3542

3643
4. **Scalability**:
3744
- New features can be added by creating new components
3845
- State management is isolated and can be extended easily
46+
- Responsive design patterns are established for future components
3947

4048
5. **Readability**:
4149
- Clear component naming and organization
4250
- Consistent code style and patterns
51+
- Well-documented component responsibilities
52+
53+
## Features
54+
55+
- **Chapter Navigation**: Toggle sidebar and display current chapter
56+
- **Page Information**: Display Juz, Hizb, and Page numbers
57+
- **Reading Preferences**: Switch between different reading modes
58+
- **Progress Tracking**: Visual indicator of reading progress
59+
- **Mobile Optimization**: Specialized components for mobile experience
60+
- **Responsive Layout**: Adapts to different screen sizes and orientations
4361

4462
## Usage
4563

src/components/QuranReader/ReadingPreferenceSwitcher/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type Props = {
4444
* @param {SwitchSize} [props.size] - Size of the switch component
4545
* @param {boolean} [props.isIconsOnly] - Whether to show only icons without text
4646
* @param {ReadingPreferenceSwitcherType} [props.type] - The context where this switcher is being used
47+
* @param {SwitchVariant} [props.variant] - Variant of the switch component
4748
* @returns {JSX.Element} React component for switching reading preferences
4849
*/
4950
const ReadingPreferenceSwitcher = ({

0 commit comments

Comments
 (0)