feat: expand sidebar once open form editor page.

feat: rounding money amount.
feat: optimize page form structure.
feat: refactoring make journal and expense form with FastField component.
This commit is contained in:
Ahmed Bouhuolia
2020-11-29 00:06:59 +02:00
parent 53dd447540
commit 011542e2a3
118 changed files with 3883 additions and 2660 deletions

View File

@@ -12,47 +12,39 @@ import PreferencesSidebar from 'components/Preferences/PreferencesSidebar';
import Search from 'containers/GeneralSearch/Search';
import DashboardSplitPane from 'components/Dashboard/DashboardSplitePane';
import withSettingsActions from 'containers/Settings/withSettingsActions';
import { compose } from 'utils';
function Dashboard({
// #withSettings
requestFetchOptions,
}) {
const fetchOptions = useQuery(
['options'], () => requestFetchOptions(),
);
const fetchOptions = useQuery(['options'], () => requestFetchOptions());
return (
<DashboardLoadingIndicator isLoading={fetchOptions.isFetching}>
<Switch>
<Route path="/preferences">
<DashboardSplitPane>
<Sidebar />
<PreferencesSidebar />
</DashboardSplitPane>
<PreferencesContent />
</Route>
<DashboardLoadingIndicator isLoading={fetchOptions.isFetching}>
<Switch>
<Route path="/preferences">
<DashboardSplitPane>
<Sidebar />
<PreferencesSidebar />
</DashboardSplitPane>
<PreferencesContent />
</Route>
<Route path="/">
<DashboardSplitPane>
<Sidebar />
<DashboardContent />
</DashboardSplitPane>
</Route>
</Switch>
<Route path="/">
<DashboardSplitPane>
<Sidebar />
<DashboardContent />
</DashboardSplitPane>
</Route>
</Switch>
<Search />
<DialogsContainer />
</DashboardLoadingIndicator>
<Search />
<DialogsContainer />
</DashboardLoadingIndicator>
);
}
export default compose(
withSettingsActions,
)(Dashboard);
export default compose(withSettingsActions)(Dashboard);

View File

@@ -27,7 +27,7 @@ function DashboardSplitPane({
<SplitPane
allowResize={sidebarExpended}
split="vertical"
minSize={180}
minSize={190}
maxSize={300}
defaultSize={sidebarExpended ? defaultSize : 50}
size={sidebarExpended ? defaultSize : 50}

View File

@@ -29,6 +29,10 @@ function DashboardTopbar({
// #withDashboardActions
toggleSidebarExpend,
recordSidebarPreviousExpand,
// #withDashboard
sidebarExpended,
// #withGlobalSearch
openGlobalSearch,
@@ -41,13 +45,20 @@ function DashboardTopbar({
const handleSidebarToggleBtn = () => {
toggleSidebarExpend();
recordSidebarPreviousExpand();
};
return (
<div class="dashboard__topbar">
<div class="dashboard__topbar-left">
<div class="dashboard__topbar-sidebar-toggle">
<Tooltip
content={<T id={'close_sidebar'} />}
content={
!sidebarExpended ? (
<T id={'open_sidebar'} />
) : (
<T id={'close_sidebar'} />
)
}
position={Position.RIGHT}
>
<Button minimal={true} onClick={handleSidebarToggleBtn}>
@@ -147,10 +158,11 @@ function DashboardTopbar({
export default compose(
withSearch,
withDashboard(({ pageTitle, pageSubtitle, editViewId }) => ({
withDashboard(({ pageTitle, pageSubtitle, editViewId, sidebarExpended }) => ({
pageTitle,
pageSubtitle,
editViewId,
sidebarExpended
})),
withDashboardActions,
)(DashboardTopbar);