Skip to content

chor: refactor NewOpportunity.tsx #768

Description

@DarrellRoberts

Problem

NewOpportunity.tsx found on /components/Dashboard/NewOpportunity/NewOpporunity.tsx contains multiple functions, renders and style components within the same file, making it very hard to read and edit.

If we encounter any bugs with this form, this makes it harder to fix and maintain

Proposed solution

  • Extract any styled component and put it in the styled.ts
  • Extract any zod validation and put it in its own file similar to how the Profile sections are structured
  • As the form is split into three types:
    - Regular
    - Accompanying
    - Events
    Create a separate file for each to follow Single Responsibility Principle
  • Extract any helper function and move them to a helper.ts file within the same directory

Through this approach, we'll follow the same pattern as the rest of the application and it'll be a lot easier to maintain

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions