Skip to content

Refactor availability screen components#401

Merged
TeddyScript101 merged 2 commits into
mainfrom
SanjayaGrg/fix/Refactor-Availibility-Screen-D-HD
May 22, 2026
Merged

Refactor availability screen components#401
TeddyScript101 merged 2 commits into
mainfrom
SanjayaGrg/fix/Refactor-Availibility-Screen-D-HD

Conversation

@SanjayaGrg
Copy link
Copy Markdown
Collaborator

Summary

Refactored AvailabilityScreen by separating reusable UI sections into smaller components while keeping the existing behavior the same.

What was done

  • extracted AvailabilityViewToggle into a separate reusable component
  • extracted AvailabilitySimpleView into a separate reusable component
  • extracted AvailabilityWeeklyView into a separate reusable component
  • extracted AvailabilityMonthlyView into a separate reusable component
  • extracted AvailabilityCalendarModal into a separate reusable component
  • cleaned up AvailabilityScreen.tsx by removing large inline UI blocks
  • kept availability state, API calls, helper logic, and navigation logic inside AvailabilityScreen
  • preserved the original screen flow and functionality after refactoring

Why

AvailabilityScreen.tsx had become too large and was handling too many UI responsibilities in a single file. This refactor improves:

  • readability
  • maintainability
  • reusability
  • easier debugging
  • easier future updates without changing business logic

Files added

  • src/components/toggle/AvailabilityViewToggle.tsx
  • src/components/view/AvailabilitySimpleView.tsx
  • src/components/view/AvailabilityWeeklyView.tsx
  • src/components/view/AvailabilityMonthlyView.tsx
  • src/components/calendar/AvailabilityCalendarModal.tsx

Files updated

  • src/screen/AvailabilityScreen.tsx

Notes

  • no intended behavior changes
  • refactor focused on UI/component separation only
  • screen logic and availability persistence remain in the main screen

Screenshots:
image

@TeddyScript101 TeddyScript101 merged commit 1c210f4 into main May 22, 2026
2 checks passed
@TeddyScript101 TeddyScript101 deleted the SanjayaGrg/fix/Refactor-Availibility-Screen-D-HD branch May 22, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants