From cd08d0ee16e2f6eae8d50da5b09a7945045817a0 Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Thu, 23 Jun 2022 21:51:34 +0200 Subject: [PATCH] feat: add transaction select. --- .../ProjectDetailActionsBar.tsx | 18 ++++-- .../components/FinancialSection.tsx | 14 ++--- .../components/TransactionSelect.tsx | 60 +++++++++++++++++++ .../ProjectDetails/components/index.tsx | 1 + 4 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 src/containers/Projects/containers/ProjectDetails/components/TransactionSelect.tsx diff --git a/src/containers/Projects/containers/ProjectDetails/ProjectDetailActionsBar.tsx b/src/containers/Projects/containers/ProjectDetails/ProjectDetailActionsBar.tsx index 62b76eb35..09608d960 100644 --- a/src/containers/Projects/containers/ProjectDetails/ProjectDetailActionsBar.tsx +++ b/src/containers/Projects/containers/ProjectDetails/ProjectDetailActionsBar.tsx @@ -1,5 +1,6 @@ // @ts-nocheck import React from 'react'; +import { useHistory } from 'react-router-dom'; import { Button, Classes, @@ -13,6 +14,7 @@ import { FormattedMessage as T, DashboardRowsHeightButton, } from 'components'; +import { TransactionSelect } from './components'; import withSettings from '../../../Settings/withSettings'; import withSettingsActions from '../../../Settings/withSettingsActions'; import withDialogActions from 'containers/Dialog/withDialogActions'; @@ -33,10 +35,13 @@ function ProjectDetailActionsBar({ // #withSettingsActions addSetting, }) { + const history = useHistory(); const { projectId } = useProjectDetailContext(); // Handle new transaction button click. - const handleNewTransactionBtnClick = () => {}; + const handleNewTransactionBtnClick = ({ path }) => { + history.push(`/${path}`); + }; const handleEditProjectBtnClick = () => { openDialog('project-form', { @@ -60,11 +65,12 @@ function ProjectDetailActionsBar({ return ( -