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

View File

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

View File

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

View File

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

View File

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