diff --git a/src/core/ui/content/BasePageContentBlock.tsx b/src/core/ui/content/BasePageContentBlock.tsx index 639b5d1946..704533e07f 100644 --- a/src/core/ui/content/BasePageContentBlock.tsx +++ b/src/core/ui/content/BasePageContentBlock.tsx @@ -10,6 +10,7 @@ import { BlockAnchorProvider } from '../keyboardNavigation/NextBlockAnchor'; import { v4 as uuid } from 'uuid'; export interface BasePageContentBlockProps { + flex?: boolean; disablePadding?: boolean; disableGap?: boolean; halfWidth?: boolean; @@ -24,11 +25,11 @@ type BasePageContentBlockWithChildrenProps['padding']; } & Props; -const getFlexDirection = ({ row, disableGap }: { row: boolean; disableGap: boolean }) => { +const getFlexDirection = ({ row, flex }: { row: boolean; flex: boolean }) => { if (row) { return 'row'; } - if (!disableGap) { + if (flex) { return 'column'; } return undefined; @@ -40,6 +41,7 @@ const BasePageContentBlock = forwardRef( { disablePadding = false, disableGap = false, + flex = !disableGap, halfWidth = false, row = false, flexWrap, @@ -60,8 +62,8 @@ const BasePageContentBlock = forwardRef( const mergedSx: Partial> = { padding: disablePadding ? undefined : padding, - display: disableGap ? undefined : 'flex', - flexDirection: getFlexDirection({ row, disableGap }), + display: flex ? 'flex' : undefined, + flexDirection: getFlexDirection({ row, flex }), flexWrap, gap: disableGap ? undefined : gutters(), ...getGridItemStyle(columnsTaken), diff --git a/src/core/ui/content/PageContentBlockSeamless.tsx b/src/core/ui/content/PageContentBlockSeamless.tsx index 1ad7918f73..51d6cb56e7 100644 --- a/src/core/ui/content/PageContentBlockSeamless.tsx +++ b/src/core/ui/content/PageContentBlockSeamless.tsx @@ -6,7 +6,7 @@ import { SystemCssProperties } from '@mui/system/styleFunctionSx/styleFunctionSx export interface PageContentBlockSeamlessProps extends BasePageContentBlockProps, - Omit, + Omit, PropsWithChildren<{}> {} const PageContentBlockSeamless = forwardRef( diff --git a/src/main/topLevelPages/myDashboard/newMemberships/NewMembershipsBlock.tsx b/src/main/topLevelPages/myDashboard/newMemberships/NewMembershipsBlock.tsx index 68e19411a8..50a59c3387 100644 --- a/src/main/topLevelPages/myDashboard/newMemberships/NewMembershipsBlock.tsx +++ b/src/main/topLevelPages/myDashboard/newMemberships/NewMembershipsBlock.tsx @@ -179,24 +179,20 @@ const NewMembershipsBlock = ({ return ( <> - + - - {pendingInvitations.length === 0 && pendingApplications.length === 0 && ( - theme.palette.neutral.light} - marginTop={gutters(-1)} - marginBottom={gutters(0.5)} - > - {t('pages.home.sections.newMemberships.noOpenInvitations')} - - )} - {pendingInvitations.length > 0 && ( - <> - - {t('pages.home.sections.newMemberships.openInvitations')} - - + {pendingInvitations.length === 0 && pendingApplications.length === 0 && ( + theme.palette.neutral.light} marginBottom={gutters(0.5)}> + {t('pages.home.sections.newMemberships.noOpenInvitations')} + + )} + {pendingInvitations.length > 0 && ( + <> + + {t('pages.home.sections.newMemberships.openInvitations')} + + + {pendingInvitations.slice(0, PENDING_MEMBERSHIPS_MAX_ITEMS).map(pendingInvitation => ( ))} - - )} - {pendingApplications.length > 0 && ( - <> - - {t('pages.home.sections.newMemberships.openApplications')} - + + + )} + {pendingApplications.length > 0 && ( + <> + {t('pages.home.sections.newMemberships.openApplications')} + {pendingApplications.map(pendingApplication => ( ))} - - )} - {recentMemberships.length > 0 && ( - <> - {t('pages.home.sections.newMemberships.recentlyJoined')} - {recentMemberships.map(membership => { - switch (membership.type) { - case PendingMembershipItemType.Invitation: - return ( - - {({ invitation }) => ( - - )} - - ); - case PendingMembershipItemType.Application: - return ( - - {({ application: hydratedApplication }) => ( - - )} - - ); - default: - return null; - } - })} - - )} - + + + )} + {recentMemberships.length > 0 && ( + <> + {t('pages.home.sections.newMemberships.recentlyJoined')} + {recentMemberships.map(membership => { + switch (membership.type) { + case PendingMembershipItemType.Invitation: + return ( + + {({ invitation }) => ( + + )} + + ); + case PendingMembershipItemType.Application: + return ( + + {({ application: hydratedApplication }) => ( + + )} + + ); + default: + return null; + } + })} + + )} {pendingMembershipsCount > 0 ? ( setOpenDialog({ type: DialogType.PendingMembershipsList })} /> ) : ( - onOpenMemberships?.()} /> + onOpenMemberships?.()} + /> )}