diff --git a/frontend/src/forms/TransactionForm.tsx b/frontend/src/forms/TransactionForm.tsx index e9a7dfb..78ef82f 100644 --- a/frontend/src/forms/TransactionForm.tsx +++ b/frontend/src/forms/TransactionForm.tsx @@ -31,6 +31,11 @@ export const TransactionForm = ({ stackId, onSave, onCancel }: Props) => { onSave?.() } + const handleCancel = () => { + console.log('cancelling') + onCancel?.() + } + return (
{ - +
diff --git a/frontend/src/layout/Modal/index.tsx b/frontend/src/layout/Modal/index.tsx index 3e0076a..41f24a0 100644 --- a/frontend/src/layout/Modal/index.tsx +++ b/frontend/src/layout/Modal/index.tsx @@ -1,5 +1,5 @@ import { ModalProps } from 'antd' -import { ReactElement, cloneElement } from 'react' +import { ReactElement } from 'react' import './style.scss' type Props = ModalProps & { children: ReactElement } @@ -10,7 +10,5 @@ export type DankFormProps = { } export const Modal = ({ children, visible }: Props) => { - const el = cloneElement(children, (props: DankFormProps) => ({ ...props })) - - return visible ?
{el}
: null + return visible ?
{children}
: null } diff --git a/frontend/src/widgets/FundBar/index.tsx b/frontend/src/widgets/FundBar/index.tsx index 45535a9..51e701b 100644 --- a/frontend/src/widgets/FundBar/index.tsx +++ b/frontend/src/widgets/FundBar/index.tsx @@ -1,9 +1,10 @@ -import { Stack } from '../../types' -import './style.scss' -import _ from 'lodash' import { useState } from 'react' import { Modal } from '../../layout/Modal' import { TransactionForm } from '../../forms/TransactionForm' +import { Stack } from '../../types' +import _ from 'lodash' + +import './style.scss' type Props = { stack: Stack @@ -22,6 +23,15 @@ export const FundBar = ({ stack }: Props) => { setNewTx(true) } + const handleCancel = () => { + console.log('cancelling tx') + setNewTx(false) + } + + const handleSave = () => { + console.log('tx saved!') + } + return ( <>
@@ -39,8 +49,12 @@ export const FundBar = ({ stack }: Props) => { ${Math.floor(current)} / ${max}
- setNewTx(false)}> - + + )