Skip to content

[4/7] Remove t Prop Drilling in Recurrence and Shared EventForm Components #7434

@kushu30

Description

@kushu30

Context

As part of the repository-wide translation compliance cleanup (post #7364), this batch focuses on Recurrence-related and EventForm shared components that are currently passing t as a prop instead of calling useTranslation() locally.

These components are reused across multiple screens, so refactoring must be done carefully to avoid regressions.


Affected Files

  • src/shared-components/EventForm/EventForm.tsx
  • src/shared-components/EventForm/RecurrenceDropdown/RecurrenceDropdown.tsx
  • src/shared-components/EventForm/utils/recurrenceOptions.ts
  • src/shared-components/Recurrence/CustomRecurrenceModal.tsx
  • src/shared-components/Recurrence/RecurrenceEndOptionsSection.tsx
  • src/shared-components/Recurrence/RecurrenceFrequencySection.tsx
  • src/shared-components/Recurrence/RecurrenceMonthlySection.tsx
  • src/shared-components/Recurrence/RecurrenceWeeklySection.tsx
  • src/shared-components/Recurrence/RecurrenceYearlySection.tsx

Required Refactor

For each affected file:

  • Remove t from props and parameters
  • Eliminate any t prop drilling chains
  • Import useTranslation from react-i18next
  • Call const { t } = useTranslation() locally
  • Ensure correct namespace usage
  • Update related tests and mocks where necessary

No UI, recurrence logic, or form behavior should change as part of this refactor.


Acceptance Criteria

  • No component in this batch receives t as a prop
  • All translation calls originate from local useTranslation()
  • Recurrence logic remains functionally identical
  • Tests pass without regression or flakiness
  • Translation lint checks pass in CI
  • Changes are strictly limited to Recurrence and EventForm domain

Metadata

Metadata

Labels

cleanupRemove non-functional or unnecessary coderefactorRefactoring tasksunapproved

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions