mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactoring: account form.
refactoring: expense form. refactoring: manual journal form. refactoring: invoice form.
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import moment from 'moment';
|
||||
import { useIntl } from 'react-intl';
|
||||
|
||||
import 'style/pages/FinancialStatements/BalanceSheet.scss';
|
||||
|
||||
@@ -14,25 +10,18 @@ import BalanceSheetActionsBar from './BalanceSheetActionsBar';
|
||||
|
||||
import { FinancialStatement } from 'components';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
import { BalanceSheetProvider } from './BalanceSheetProvider';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
* Balance sheet.
|
||||
*/
|
||||
function BalanceSheet({
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
setDashboardBackLink,
|
||||
setSidebarShrink,
|
||||
|
||||
// #withPreferences
|
||||
organizationName,
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const [filter, setFilter] = useState({
|
||||
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
@@ -41,21 +30,6 @@ function BalanceSheet({
|
||||
accountsFilter: 'all-accounts',
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
setSidebarShrink();
|
||||
changePageTitle(formatMessage({ id: 'balance_sheet' }));
|
||||
}, [changePageTitle, formatMessage, setSidebarShrink]);
|
||||
|
||||
useEffect(() => {
|
||||
// Show the back link on dashboard topbar.
|
||||
setDashboardBackLink(true);
|
||||
|
||||
return () => {
|
||||
// Hide the back link on dashboard topbar.
|
||||
setDashboardBackLink(false);
|
||||
};
|
||||
}, [setDashboardBackLink]);
|
||||
|
||||
// Handle re-fetch balance sheet after filter change.
|
||||
const handleFilterSubmit = (filter) => {
|
||||
const _filter = {
|
||||
@@ -95,7 +69,6 @@ function BalanceSheet({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboardActions,
|
||||
withSettings(({ organizationSettings }) => ({
|
||||
organizationName: organizationSettings.name,
|
||||
})),
|
||||
|
||||
@@ -34,16 +34,7 @@ function FinancialReportsSection({ sectionTitle, reports }) {
|
||||
);
|
||||
}
|
||||
|
||||
function FinancialReports({
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
useEffect(() => {
|
||||
changePageTitle(formatMessage({ id: 'all_financial_reports' }));
|
||||
}, [changePageTitle, formatMessage]);
|
||||
|
||||
export default function FinancialReports() {
|
||||
return (
|
||||
<DashboardInsider name={'financial-reports'}>
|
||||
<div class="financial-reports">
|
||||
@@ -53,4 +44,3 @@ function FinancialReports({
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withDashboardActions)(FinancialReports);
|
||||
|
||||
Reference in New Issue
Block a user