From a96272b55c554773c3732d2b186075260f10d78c Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Wed, 2 Aug 2023 16:59:08 +0530 Subject: [PATCH] feat: changes in components Signed-off-by: bhavanakarwade --- src/app/NavBarSidebar.astro | 6 +- .../organization/OrganizationsList.tsx | 10 +- .../organization/invitations/Invitations.tsx | 269 +++++++++--------- .../invitations/ReceivedInvitations.tsx | 3 +- 4 files changed, 145 insertions(+), 143 deletions(-) diff --git a/src/app/NavBarSidebar.astro b/src/app/NavBarSidebar.astro index 8ecd26918..5323665aa 100644 --- a/src/app/NavBarSidebar.astro +++ b/src/app/NavBarSidebar.astro @@ -289,14 +289,14 @@ import SignOutButton from '../components/SignOutButton/index' --> -   -   + +
diff --git a/src/components/organization/OrganizationsList.tsx b/src/components/organization/OrganizationsList.tsx index 89ef31716..fe76c3866 100644 --- a/src/components/organization/OrganizationsList.tsx +++ b/src/components/organization/OrganizationsList.tsx @@ -199,15 +199,15 @@ const OrganizationsList = () => { )) } - -
) : () + : organizationsList && ( - - }/>) + + } />) }
diff --git a/src/components/organization/invitations/Invitations.tsx b/src/components/organization/invitations/Invitations.tsx index f71e22bb6..62acdce1e 100644 --- a/src/components/organization/invitations/Invitations.tsx +++ b/src/components/organization/invitations/Invitations.tsx @@ -64,7 +64,7 @@ const Invitations = () => { ...currentPage, total: totalPages }) - } + } } //This useEffect is called when the searchText changes @@ -95,151 +95,152 @@ const Invitations = () => { } - return ( -
-
-
- +
+
+ + +
+ + setMessage(data)} + setOpenModal={ + props.setOpenModal + } /> + + {loading + ?
+ -
- - setMessage(data)} - setOpenModal={ - props.setOpenModal - } /> - - {loading - ?
- -
- : invitationsList && invitationsList?.length > 0 ? (
-
-
    - { - invitationsList.map((invitation) => ( - -
  • -
    -
    -
    - - - -
    -
    -

    - {invitation.email} -

    - -
    -
      -
    • -
      -
      - Roles: - {invitation.orgRoles && - invitation.orgRoles.length > 0 && - invitation.orgRoles.map((role: OrgRole, index: number) => { - return ( - - {role.name.charAt(0).toUpperCase() + role.name.slice(1)} - - ); - })} -
      - + : invitationsList && invitationsList?.length > 0 ? (
      +
      +
        + { + invitationsList.map((invitation) => ( + +
      • +
        +
        +
        + + + +
        +
        +

        + {invitation.email} +

        + +
        +
          +
        • +
          +
          + Roles: + {invitation.orgRoles && + invitation.orgRoles.length > 0 && + invitation.orgRoles.map((role: OrgRole, index: number) => { + return ( + + {role.name.charAt(0).toUpperCase() + role.name.slice(1)} + + ); + })}
          -
        • -
        -
        + +
        +
      • +
      +
      - - { - invitation.status === 'pending' + + { + invitation.status === 'pending' + ? + {TextTittlecase(invitation.status)} + + : invitation.status === 'accepted' ? {TextTittlecase(invitation.status)} - : invitation.status === 'accepted' - ? - {TextTittlecase(invitation.status)} - - : - - {TextTittlecase(invitation.status)} - - - } - - - -

      - Invited On: {invitation.createDateTime.split('T')[0]} -

      - -
    -
  • - )) - } -
-
-
) : ( - - } - />) - } - -
- - -
+ : + + {TextTittlecase(invitation.status)} + + + } + + + +

+ Invited On: {invitation.createDateTime.split('T')[0]} +

+ +
+ + )) + } + +
+
) + : invitationsList && ( + + } + />) + } + +
+ +
- +
+ ) } diff --git a/src/components/organization/invitations/ReceivedInvitations.tsx b/src/components/organization/invitations/ReceivedInvitations.tsx index 2d3b40539..890081147 100644 --- a/src/components/organization/invitations/ReceivedInvitations.tsx +++ b/src/components/organization/invitations/ReceivedInvitations.tsx @@ -248,7 +248,8 @@ const ReceivedInvitations = () => { - ) : () + : invitationsList && () }