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
Problem
NewOpportunity.tsxfound on/components/Dashboard/NewOpportunity/NewOpporunity.tsxcontains multiplefunctions,rendersandstylecomponents 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
styled.ts- Regular
- Accompanying
- Events
Create a separate file for each to follow Single Responsibility Principle
helper.tsfile within the same directoryThrough this approach, we'll follow the same pattern as the rest of the application and it'll be a lot easier to maintain