Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPDX-7815] Make coaching sidebar collapsible #826

Merged
merged 13 commits into from
Jan 9, 2024
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useEffect, useMemo, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import { sortBy } from 'lodash';
import { useTranslation } from 'react-i18next';
import { ReportContactFilterSetInput } from 'pages/api/graphql-rest.page.generated';
Expand All @@ -19,10 +17,6 @@ import { getQueryParam } from 'src/utils/queryParam';
import { useContactFiltersQuery } from '../../contacts/Contacts.generated';
import { ContactsPage } from '../../contacts/ContactsPage';

const PartnerGivingAnalysisReportPageWrapper = styled(Box)(({ theme }) => ({
backgroundColor: theme.palette.common.white,
}));

// The order here is also the sort order and the display order
const reportFilters = [
'designation_account_id',
Expand Down Expand Up @@ -96,48 +90,46 @@ const PartnerGivingAnalysisReportPage: React.FC = () => {
</title>
</Head>
{accountListId ? (
<PartnerGivingAnalysisReportPageWrapper>
<SidePanelsLayout
isScrollBox={true}
leftPanel={
isNavListOpen && filtersLoading ? (
<Loading loading />
) : (
<FilterPanel
filters={filterGroups}
defaultExpandedFilterGroups={new Set(['Report Filters'])}
savedFilters={[]}
selectedFilters={activeFilters}
onClose={() => setNavListOpen(false)}
onSelectedFiltersChanged={setActiveFilters}
/>
)
}
leftOpen={isNavListOpen}
leftWidth="290px"
mainContent={
<PartnerGivingAnalysisReport
accountListId={accountListId}
activeFilters={activeFilters}
isNavListOpen={isNavListOpen}
onNavListToggle={handleNavListToggle}
onSelectContact={handleSelectContact}
title={t('Partner Giving Analysis')}
contactFilters={debouncedFilters}
contactDetailsOpen={!!selectedContactId}
<SidePanelsLayout
isScrollBox={true}
leftPanel={
isNavListOpen && filtersLoading ? (
<Loading loading />
) : (
<FilterPanel
filters={filterGroups}
defaultExpandedFilterGroups={new Set(['Report Filters'])}
savedFilters={[]}
selectedFilters={activeFilters}
onClose={() => setNavListOpen(false)}
onSelectedFiltersChanged={setActiveFilters}
/>
}
rightPanel={
selectedContactId ? (
<ContactsPage>
<ContactsRightPanel onClose={() => handleSelectContact('')} />
</ContactsPage>
) : undefined
}
rightOpen={typeof selectedContactId !== 'undefined'}
rightWidth="60%"
/>
</PartnerGivingAnalysisReportPageWrapper>
)
}
leftOpen={isNavListOpen}
leftWidth="290px"
mainContent={
<PartnerGivingAnalysisReport
accountListId={accountListId}
activeFilters={activeFilters}
isNavListOpen={isNavListOpen}
onNavListToggle={handleNavListToggle}
onSelectContact={handleSelectContact}
title={t('Partner Giving Analysis')}
contactFilters={debouncedFilters}
contactDetailsOpen={!!selectedContactId}
/>
}
rightPanel={
selectedContactId ? (
<ContactsPage>
<ContactsRightPanel onClose={() => handleSelectContact('')} />
</ContactsPage>
) : undefined
}
rightOpen={typeof selectedContactId !== 'undefined'}
rightWidth="60%"
/>
) : (
<Loading loading />
)}
Expand Down
Loading
Loading