From 4431990824862373ed88dde98b8797af289b1011 Mon Sep 17 00:00:00 2001 From: xentara1 Date: Sat, 13 Jan 2024 15:34:57 +0000 Subject: [PATCH] Create Schedules from existing transactions --- .../desktop-client/src/components/Modals.tsx | 2 ++ .../src/components/schedules/ScheduleLink.tsx | 19 +++++++++++++++++++ .../transactions/SelectedTransactions.jsx | 10 ++-------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx index aa296b1b334..63429fac811 100644 --- a/packages/desktop-client/src/components/Modals.tsx +++ b/packages/desktop-client/src/components/Modals.tsx @@ -300,6 +300,8 @@ export function Modals() { modalProps={modalProps} actions={actions} transactionIds={options?.transactionIds} + getTransaction={options?.getTransaction} + pushModal={options?.pushModal} /> ); diff --git a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx index 3c3964508ad..0593dab4841 100644 --- a/packages/desktop-client/src/components/schedules/ScheduleLink.tsx +++ b/packages/desktop-client/src/components/schedules/ScheduleLink.tsx @@ -12,15 +12,21 @@ import { Text } from '../common/Text'; import { View } from '../common/View'; import { ROW_HEIGHT, SchedulesTable } from './SchedulesTable'; +import { SvgAdd } from '../../icons/v0'; +import { Button } from '../common/Button'; export function ScheduleLink({ modalProps, actions, transactionIds: ids, + getTransaction, + pushModal }: { actions: BoundActions; modalProps?: CommonModalProps; transactionIds: string[]; + getTransaction: Function; + pushModal: Function; }) { const [filter, setFilter] = useState(''); @@ -44,6 +50,11 @@ export function ScheduleLink({ actions.popModal(); } + async function onCreate(){ + const firstId1 = [...ids][0]; + pushModal('schedule-edit', { id: null, transaction:getTransaction(firstId1) }); + } + return ( +