Skip to content

[5/7] Remove t Prop Drilling in EventListCard Modals and Related Logic #7435

@kushu30

Description

@kushu30

Context

As part of the repository-wide translation compliance cleanup (post #7364), this batch focuses on EventListCard modals and associated logic files that are currently passing t as a prop instead of calling useTranslation() locally.

These components are modal-driven and interconnected, so care must be taken to avoid breaking preview, update, or delete flows.


Affected Files

  • src/shared-components/EventListCard/Modal/EventListCardModals.tsx
  • src/shared-components/EventListCard/Modal/updateLogic.ts
  • src/shared-components/EventListCard/Modal/Delete/EventListCardDeleteModal.tsx
  • src/shared-components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx
  • src/shared-components/posts/helperFunctions.ts

Required Refactor

For each affected file:

  • Remove t from props and parameters
  • Eliminate t prop drilling chains
  • Import useTranslation from react-i18next
  • Call const { t } = useTranslation() locally within components
  • For non-component utility files, refactor to avoid requiring t as a parameter (move translation responsibility to component level where possible)
  • Update related tests and mocks as needed

No functional, modal, or data update behavior should change.


Acceptance Criteria

  • No component in this batch receives t as a prop
  • Utility functions do not require t as a parameter
  • All translation calls originate from local useTranslation()
  • Modal flows (Preview, Update, Delete) remain fully functional
  • Tests pass with no coverage regression
  • Translation lint checks pass in CI
  • Changes are strictly limited to EventListCard 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