diff --git a/packages/desktop-client/src/components/FatalError.tsx b/packages/desktop-client/src/components/FatalError.tsx index 6613cd536a3..ec92d7546ea 100644 --- a/packages/desktop-client/src/components/FatalError.tsx +++ b/packages/desktop-client/src/components/FatalError.tsx @@ -167,7 +167,7 @@ export function FatalError({ buttonText, error }: FatalErrorProps) { const showSimpleRender = 'type' in error && error.type === 'app-init-failure'; return ( - + >; showTitle?: boolean; - showClose?: boolean; + editableTitle?: boolean; showOverlay?: boolean; loading?: boolean; noAnimation?: boolean; @@ -52,8 +56,8 @@ export const Modal = ({ padding = 20, showHeader = true, leftHeaderContent, + CloseButton: CloseButtonComponent = ModalCloseButton, showTitle = true, - showClose = true, showOverlay = true, loading = false, noAnimation = false, @@ -200,16 +204,7 @@ export const Modal = ({ marginLeft: !isNarrowWidth ? 5 : undefined, }} > - {showClose && ( - - )} + )} @@ -462,3 +457,21 @@ export function ModalTitle({ ); } + +type ModalCloseButtonProps = { + onClick: ComponentProps['onClick']; + style?: CSSProperties; +}; + +export function ModalCloseButton({ onClick, style }: ModalCloseButtonProps) { + return ( + + ); +} diff --git a/packages/desktop-client/src/components/gocardless/GoCardlessLink.tsx b/packages/desktop-client/src/components/gocardless/GoCardlessLink.tsx index 9a3e3d65677..297763f0d8d 100644 --- a/packages/desktop-client/src/components/gocardless/GoCardlessLink.tsx +++ b/packages/desktop-client/src/components/gocardless/GoCardlessLink.tsx @@ -8,7 +8,7 @@ export function GoCardlessLink() { window.close(); return ( - + {() => ( Please wait... diff --git a/packages/desktop-client/src/components/mobile/transactions/Option.jsx b/packages/desktop-client/src/components/mobile/transactions/Option.jsx index 8fc46836ee0..f8711105cb0 100644 --- a/packages/desktop-client/src/components/mobile/transactions/Option.jsx +++ b/packages/desktop-client/src/components/mobile/transactions/Option.jsx @@ -22,7 +22,7 @@ export function Option({ isLast, item, state }) { background: isSelected ? theme.tableRowBackgroundHighlight : theme.tableBackground, - color: isSelected ? theme.mobileModalText : null, + color: isSelected ? theme.tableText : null, outline: isFocusVisible ? '2px solid orange' : 'none', ...(!isLast && { borderBottom: `1px solid ${theme.tableBorder}` }), }} diff --git a/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx b/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx index 5ec7911bef1..15026d0d84d 100644 --- a/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx +++ b/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx @@ -3,7 +3,7 @@ import React, { type ComponentPropsWithoutRef } from 'react'; import { useResponsive } from '../../ResponsiveProvider'; import { theme } from '../../style'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; -import { Modal } from '../common/Modal'; +import { ModalCloseButton, Modal, ModalTitle } from '../common/Modal'; import { View } from '../common/View'; import { SectionLabel } from '../forms'; import { type CommonModalProps } from '../Modals'; @@ -31,7 +31,12 @@ export function AccountAutocompleteModal({ return ( ({ color: theme.menuAutoCompleteText })} + /> + } noAnimation={!isNarrowWidth} showHeader={isNarrowWidth} focusAfterClose={false} @@ -43,11 +48,14 @@ export function AccountAutocompleteModal({ height: isNarrowWidth ? '85vh' : 275, padding: '15px 10px', borderRadius: '6px', - ...(!isNarrowWidth && { - backgroundColor: theme.mobileModalBackground, - color: theme.mobileModalText, - }), + backgroundColor: theme.menuAutoCompleteBackground, }} + CloseButton={props => ( + + )} > {() => ( @@ -56,7 +64,7 @@ export function AccountAutocompleteModal({ title="Account" style={{ alignSelf: 'center', - color: theme.mobileModalText, + color: theme.menuAutoCompleteText, marginBottom: 10, }} /> diff --git a/packages/desktop-client/src/components/modals/CategoryAutocompleteModal.tsx b/packages/desktop-client/src/components/modals/CategoryAutocompleteModal.tsx index 6d5c9f9722f..9712696555e 100644 --- a/packages/desktop-client/src/components/modals/CategoryAutocompleteModal.tsx +++ b/packages/desktop-client/src/components/modals/CategoryAutocompleteModal.tsx @@ -3,7 +3,7 @@ import React, { type ComponentPropsWithoutRef } from 'react'; import { useResponsive } from '../../ResponsiveProvider'; import { theme } from '../../style'; import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete'; -import { Modal } from '../common/Modal'; +import { ModalCloseButton, Modal, ModalTitle } from '../common/Modal'; import { View } from '../common/View'; import { SectionLabel } from '../forms'; import { type CommonModalProps } from '../Modals'; @@ -32,7 +32,12 @@ export function CategoryAutocompleteModal({ return ( ({ color: theme.menuAutoCompleteText })} + /> + } noAnimation={!isNarrowWidth} showHeader={isNarrowWidth} focusAfterClose={false} @@ -44,11 +49,14 @@ export function CategoryAutocompleteModal({ height: isNarrowWidth ? '85vh' : 275, padding: '15px 10px', borderRadius: '6px', - ...(!isNarrowWidth && { - backgroundColor: theme.mobileModalBackground, - color: theme.mobileModalText, - }), + backgroundColor: theme.menuAutoCompleteBackground, }} + CloseButton={props => ( + + )} > {() => ( @@ -57,7 +65,7 @@ export function CategoryAutocompleteModal({ title="Category" style={{ alignSelf: 'center', - color: theme.mobileModalText, + color: theme.menuAutoCompleteText, marginBottom: 10, }} /> diff --git a/packages/desktop-client/src/components/modals/EditField.jsx b/packages/desktop-client/src/components/modals/EditField.jsx index a4822faf32f..4d0b06465cd 100644 --- a/packages/desktop-client/src/components/modals/EditField.jsx +++ b/packages/desktop-client/src/components/modals/EditField.jsx @@ -278,10 +278,7 @@ export function EditField({ modalProps, name, onSubmit, onClose }) { padding: '15px 10px', borderRadius: '6px', ...(minWidth && { minWidth }), - ...(!isNarrowWidth && { - backgroundColor: theme.mobileModalBackground, - color: theme.mobileModalText, - }), + backgroundColor: theme.menuAutoCompleteBackground, }} > {() => ( @@ -291,7 +288,7 @@ export function EditField({ modalProps, name, onSubmit, onClose }) { title={label} style={{ alignSelf: 'center', - color: theme.mobileModalText, + color: theme.menuAutoCompleteText, marginBottom: 10, }} /> diff --git a/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx b/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx index 6eaf1a5a58b..3d26dc45d53 100644 --- a/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx +++ b/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx @@ -5,7 +5,7 @@ import { usePayees } from '../../hooks/usePayees'; import { useResponsive } from '../../ResponsiveProvider'; import { theme } from '../../style'; import { PayeeAutocomplete } from '../autocomplete/PayeeAutocomplete'; -import { Modal } from '../common/Modal'; +import { ModalCloseButton, Modal, ModalTitle } from '../common/Modal'; import { type CommonModalProps } from '../Modals'; type PayeeAutocompleteModalProps = { @@ -34,7 +34,12 @@ export function PayeeAutocompleteModal({ return ( ({ color: theme.menuAutoCompleteText })} + /> + } noAnimation={!isNarrowWidth} showHeader={isNarrowWidth} focusAfterClose={false} @@ -46,11 +51,14 @@ export function PayeeAutocompleteModal({ height: isNarrowWidth ? '85vh' : 275, padding: '15px 10px', borderRadius: '6px', - ...(!isNarrowWidth && { - backgroundColor: theme.mobileModalBackground, - color: theme.mobileModalText, - }), + backgroundColor: theme.menuAutoCompleteBackground, }} + CloseButton={props => ( + + )} > {() => (