From 11e2c2a88c8dc95bd47e64b0f315213ddd355ca6 Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Tue, 19 Dec 2023 10:00:34 +0100 Subject: [PATCH] fix(ui): adapt payment confirm size (#712) * ui(modal): fix size of payment confirm modal * ui(send): focus destination field after clearing --- src/components/Modal.tsx | 12 +++++------- src/components/Send/DestinationInputField.tsx | 5 ++++- src/components/Send/index.tsx | 1 + src/components/fb/SpendFidelityBondModal.tsx | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 32e9d026..71dd98de 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -45,16 +45,14 @@ export type InfoModalProps = Omit & { } const InfoModal = ({ - isShown, - title, children, onCancel, onSubmit, submitButtonText, - size, + ...baseModalProps }: PropsWithChildren) => { return ( - + {children} onSubmit()}> @@ -65,15 +63,15 @@ const InfoModal = ({ ) } -export type ConfirmModalProps = Omit & { +export type ConfirmModalProps = BaseModalProps & { onConfirm: () => void } -const ConfirmModal = ({ isShown, title, children, onCancel, onConfirm }: PropsWithChildren) => { +const ConfirmModal = ({ children, onCancel, onConfirm, ...baseModalProps }: PropsWithChildren) => { const { t } = useTranslation() return ( - + {children} (name) const form = useFormikContext() + const ref = useRef(null) const [destinationJarPickerShown, setDestinationJarPickerShown] = useState(false) return ( @@ -106,6 +107,7 @@ export const DestinationInputField = ({ className={styles.button} onClick={() => { form.setFieldValue(field.name, form.initialValues[field.name], true) + setTimeout(() => ref.current?.focus(), 4) }} disabled={disabled} > @@ -118,6 +120,7 @@ export const DestinationInputField = ({
setShowConfirmSendModal(undefined)} diff --git a/src/components/fb/SpendFidelityBondModal.tsx b/src/components/fb/SpendFidelityBondModal.tsx index d4228e23..741cebc8 100644 --- a/src/components/fb/SpendFidelityBondModal.tsx +++ b/src/components/fb/SpendFidelityBondModal.tsx @@ -391,6 +391,7 @@ const SpendFidelityBondModal = ({ {showConfirmSendModal && fidelityBond && selectedDestinationJarIndex !== undefined && ( {