-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (frontend,backend): my organisations tab implemented (#1227)
* feat: my organisations api route added * feat: get my organisation function * feat: added get organisation api service * feat: organisationGridCard Component created * feat: Type added to organisation slice * Feat: My organisation tab for data fetching * refactor: remove missed print statement --------- Co-authored-by: spwoodcock <sam.woodcock@protonmail.com>
- Loading branch information
1 parent
873517c
commit 9a8867d
Showing
7 changed files
with
179 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/frontend/src/components/organisation/OrganisationGridCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import CoreModules from '@/shared/CoreModules'; | ||
import CustomizedImage from '@/utilities/CustomizedImage'; | ||
|
||
const OrganisationGridCard = ({ filteredData, allDataLength }) => { | ||
const cardStyle = { | ||
padding: '20px', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
cursor: 'pointer', | ||
gap: '20px', | ||
boxShadow: 'none', | ||
borderRadius: '0px', | ||
}; | ||
return ( | ||
<div> | ||
<p className="fmtm-text-[#9B9999]"> | ||
Showing {filteredData?.length} of {allDataLength} organizations | ||
</p> | ||
<div className="fmtm-grid fmtm-grid-cols-1 md:fmtm-grid-cols-2 lg:fmtm-grid-cols-3 fmtm-gap-5"> | ||
{filteredData?.map((data, index) => ( | ||
<CoreModules.Card key={index} sx={cardStyle}> | ||
{data.logo ? ( | ||
<div className="fmtm-min-w-[60px] md:fmtm-min-w-[80px] lg:fmtm-min-w-[120px]"> | ||
<CoreModules.CardMedia component="img" src={data.logo} sx={{ width: ['60px', '80px', '120px'] }} /> | ||
</div> | ||
) : ( | ||
<div className="fmtm-min-w-[60px] fmtm-max-w-[60px] md:fmtm-min-w-[80px] md:fmtm-max-w-[80px] lg:fmtm-min-w-[120px] lg:fmtm-max-w-[120px]"> | ||
<CustomizedImage status={'card'} style={{ width: '100%' }} /> | ||
</div> | ||
)} | ||
|
||
<CoreModules.Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }} className="fmtm-overflow-hidden"> | ||
<h2 | ||
className="fmtm-line-clamp-1 fmtm-text-base sm:fmtm-text-lg fmtm-font-bold fmtm-capitalize" | ||
title={data.name} | ||
> | ||
{data.name} | ||
</h2> | ||
<p | ||
className="fmtm-line-clamp-3 fmtm-text-[#7A7676] fmtm-font-archivo fmtm-text-sm sm:fmtm-text-base" | ||
title={data.description} | ||
> | ||
{data.description} | ||
</p> | ||
</CoreModules.Box> | ||
</CoreModules.Card> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default OrganisationGridCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { GetOrganisationDataModel } from '@/models/organisation/organisationModel'; | ||
|
||
export interface IOrganisationState { | ||
organisationFormData: any; | ||
organisationData: GetOrganisationDataModel[]; | ||
myOrganisationData: GetOrganisationDataModel[]; | ||
postOrganisationData: any; | ||
organisationDataLoading: Boolean; | ||
postOrganisationDataLoading: Boolean; | ||
myOrganisationDataLoading: false; | ||
consentDetailsFormData: { | ||
give_consent: any; | ||
review_documentation: any; | ||
log_into: any; | ||
participated_in: any; | ||
}; | ||
consentApproval: Boolean; | ||
organizationApprovalStatus: { | ||
isSuccess: Boolean; | ||
organizationApproving: Boolean; | ||
organizationRejecting: Boolean; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters