fix: add sidebar shrink.

This commit is contained in:
elforjani3
2021-01-25 16:51:14 +02:00
parent 0655963607
commit 3d080244e6
5 changed files with 16 additions and 6 deletions

View File

@@ -31,6 +31,7 @@ function ReceivableAgingSummarySheet({
// #withDashboardActions
changePageTitle,
setDashboardBackLink,
setSidebarShrink,
// #withARAgingSummaryActions
requestReceivableAgingSummary,
@@ -59,6 +60,7 @@ function ReceivableAgingSummarySheet({
}, [ARAgingSummaryRefresh, refreshARAgingSummary]);
useEffect(() => {
setSidebarShrink()
// Show the back link on dashboard topbar.
setDashboardBackLink(true);
@@ -66,7 +68,7 @@ function ReceivableAgingSummarySheet({
// Hide the back link on dashboard topbar.
setDashboardBackLink(false);
};
}, [setDashboardBackLink]);
}, [setDashboardBackLink,setSidebarShrink]);
// Handle fetching receivable aging summary report.
const fetchARAgingSummarySheet = useQuery(

View File

@@ -30,6 +30,7 @@ function BalanceSheet({
// #withDashboardActions
changePageTitle,
setDashboardBackLink,
setSidebarShrink,
// #withBalanceSheetActions
fetchBalanceSheet,
@@ -58,8 +59,9 @@ function BalanceSheet({
);
useEffect(() => {
setSidebarShrink();
changePageTitle(formatMessage({ id: 'balance_sheet' }));
}, [changePageTitle, formatMessage]);
}, [changePageTitle, formatMessage, setSidebarShrink]);
// Observes the balance sheet refresh to invalid the query to refresh it.
useEffect(() => {

View File

@@ -32,6 +32,7 @@ function Journal({
// #withDashboardActions
changePageTitle,
setDashboardBackLink,
setSidebarShrink,
// #withPreferences
organizationName,
@@ -54,6 +55,7 @@ function Journal({
}, [changePageTitle, formatMessage]);
useEffect(() => {
setSidebarShrink();
// Show the back link on dashboard topbar.
setDashboardBackLink(true);
@@ -61,7 +63,7 @@ function Journal({
// Hide the back link on dashboard topbar.
setDashboardBackLink(false);
};
});
}, [setDashboardBackLink, setSidebarShrink]);
useEffect(() => {
if (journalSheetRefresh) {

View File

@@ -28,7 +28,8 @@ function ProfitLossSheet({
// #withDashboardActions
changePageTitle,
setDashboardBackLink,
setSidebarShrink,
// #withProfitLoss
profitLossSheetRefresh,
@@ -62,6 +63,7 @@ function ProfitLossSheet({
}, [profitLossSheetRefresh, refreshProfitLossSheet]);
useEffect(() => {
setSidebarShrink()
// Show the back link on dashboard topbar.
setDashboardBackLink(true);
@@ -69,7 +71,7 @@ function ProfitLossSheet({
// Hide the back link on dashboard topbar.
setDashboardBackLink(false);
};
});
},[setDashboardBackLink,setSidebarShrink]);
// Fetches profit/loss sheet.
const fetchSheetHook = useQuery(['profit-loss-sheet', filter],

View File

@@ -27,6 +27,7 @@ function TrialBalanceSheet({
// #withDashboardActions
changePageTitle,
setDashboardBackLink,
setSidebarShrink,
// #withTrialBalance
trialBalanceSheetRefresh,
@@ -62,6 +63,7 @@ function TrialBalanceSheet({
}, [changePageTitle, formatMessage]);
useEffect(() => {
setSidebarShrink();
// Show the back link on dashboard topbar.
setDashboardBackLink(true);
@@ -69,7 +71,7 @@ function TrialBalanceSheet({
// Hide the back link on dashboard topbar.
setDashboardBackLink(false);
};
});
}, [setDashboardBackLink, setSidebarShrink]);
const handleFilterSubmit = useCallback(
(filter) => {