Skip to content

Commit

Permalink
OrgList.tsx file reduced to 568 line -done
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauradip07 committed Jan 15, 2024
1 parent 7e0ce9b commit 573e848
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/screens/OrgList/OrgList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,19 @@ function orgList(): JSX.Element {
</>
)}
{/* Create Organization Modal */}
{/**
* Renders the `OrganizationModal` component.
*
* @param showModal - A boolean indicating whether the modal should be displayed.
* @param toggleModal - A function to toggle the visibility of the modal.
* @param formState - The state of the form in the organization modal.
* @param setFormState - A function to update the state of the form in the organization modal.
* @param createOrg - A function to handle the submission of the organization creation form.
* @param t - A translation function for localization.
* @param userData - Information about the current user.
* @param triggerCreateSampleOrg - A function to trigger the creation of a sample organization.
* @returns JSX element representing the `OrganizationModal`.
*/}
<OrganizationModal
showModal={showModal}
toggleModal={toggleModal}
Expand Down
14 changes: 14 additions & 0 deletions src/screens/OrgList/OrganizationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import convertToBase64 from 'utils/convertToBase64';
import type { ChangeEvent } from 'react';
import styles from './OrgList.module.css';

/**
* Represents the state of the form in the organization modal.
*/
interface InterfaceFormStateType {
name: string;
descrip: string;
Expand All @@ -12,6 +15,10 @@ interface InterfaceFormStateType {
location: string;
image: string;
}

/**
* Represents a user type.
*/
interface InterfaceUserType {
user: {
firstName: string;
Expand All @@ -28,6 +35,9 @@ interface InterfaceUserType {
// Add more properties if needed
}

/**
* Represents the properties of the OrganizationModal component.
*/
interface InterfaceOrganizationModalProps {
showModal: boolean;
toggleModal: () => void;
Expand All @@ -39,6 +49,10 @@ interface InterfaceOrganizationModalProps {
triggerCreateSampleOrg: () => void;
}

/**
* Represents the organization modal component.
*/

const OrganizationModal: React.FC<InterfaceOrganizationModalProps> = ({
showModal,
toggleModal,
Expand Down

0 comments on commit 573e848

Please sign in to comment.