diff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png index a2e2fc3f1b9..a3662f61ca9 100644 Binary files a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png index 6240ae33bc1..13c57c3eb49 100644 Binary files a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png index 7290097d372..a548f7784ff 100644 Binary files a/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png and b/packages/desktop-client/e2e/accounts.test.js-snapshots/Accounts-closes-an-account-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png new file mode 100644 index 00000000000..78b0b339225 Binary files /dev/null and b/packages/desktop-client/e2e/rules.test.js-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png index d4ff966a8db..e2dd224a8f5 100644 Binary files a/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png differ diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx index 999849eb923..1a4cf70a851 100644 --- a/packages/desktop-client/src/components/Modals.tsx +++ b/packages/desktop-client/src/components/Modals.tsx @@ -23,9 +23,9 @@ import { ConfirmCategoryDelete } from './modals/ConfirmCategoryDelete'; import { ConfirmTransactionEdit } from './modals/ConfirmTransactionEdit'; import { ConfirmUnlinkAccount } from './modals/ConfirmUnlinkAccount'; import { CoverModal } from './modals/CoverModal'; -import { CreateAccount } from './modals/CreateAccount'; +import { CreateAccountModal } from './modals/CreateAccountModal'; import { CreateEncryptionKeyModal } from './modals/CreateEncryptionKeyModal'; -import { CreateLocalAccount } from './modals/CreateLocalAccount'; +import { CreateLocalAccountModal } from './modals/CreateLocalAccountModal'; import { EditField } from './modals/EditField'; import { EditRule } from './modals/EditRule'; import { FixEncryptionKeyModal } from './modals/FixEncryptionKeyModal'; @@ -105,7 +105,7 @@ export function Modals() { case 'add-account': return ( - { - const { isNarrowWidth } = useResponsive(); const { enableScope, disableScope } = useHotkeysContext(); // This deactivates any key handlers in the "app" scope @@ -133,12 +131,14 @@ export const Modal = ({ isCurrent={isCurrent} size={size} style={{ + flex: 1, + padding, willChange: 'opacity, transform', maxWidth: '90vw', minWidth: '90vw', maxHeight: '90vh', minHeight: 0, - borderRadius: 4, + borderRadius: 6, //border: '1px solid ' + theme.modalBorder, color: theme.pageText, backgroundColor: theme.modalBackground, @@ -156,17 +156,14 @@ export const Modal = ({ style={{ justifyContent: 'center', alignItems: 'center', - padding: '0 20px', position: 'relative', - height: 70, + height: 60, }} > {leftHeaderContent} @@ -178,8 +175,7 @@ export const Modal = ({ textAlign: 'center', // We need to force a width for the text-overflow // ellipses to work because we are aligning center. - // This effectively gives it a padding of 20px - width: 'calc(100% - 40px)', + width: 'calc(100% - 60px)', }} > {!title ? ( @@ -200,15 +196,13 @@ export const Modal = ({ style={{ position: 'absolute', right: 0, - marginRight: !isNarrowWidth ? 15 : undefined, - marginLeft: !isNarrowWidth ? 5 : undefined, }} > )} - + {typeof children === 'function' ? children() : children} {loading && ( diff --git a/packages/desktop-client/src/components/manager/DeleteFile.tsx b/packages/desktop-client/src/components/manager/DeleteFile.tsx index 1418fa7bda7..3b1cff19412 100644 --- a/packages/desktop-client/src/components/manager/DeleteFile.tsx +++ b/packages/desktop-client/src/components/manager/DeleteFile.tsx @@ -30,7 +30,6 @@ export function DeleteFile({ modalProps, actions, file }: DeleteFileProps) { diff --git a/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx b/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx index 15026d0d84d..025c9a2658a 100644 --- a/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx +++ b/packages/desktop-client/src/components/modals/AccountAutocompleteModal.tsx @@ -42,12 +42,8 @@ export function AccountAutocompleteModal({ focusAfterClose={false} {...modalProps} onClose={_onClose} - padding={0} style={{ - flex: 0, height: isNarrowWidth ? '85vh' : 275, - padding: '15px 10px', - borderRadius: '6px', backgroundColor: theme.menuAutoCompleteBackground, }} CloseButton={props => ( diff --git a/packages/desktop-client/src/components/modals/AccountMenuModal.tsx b/packages/desktop-client/src/components/modals/AccountMenuModal.tsx index 5e18914e470..36dcfa3f91a 100644 --- a/packages/desktop-client/src/components/modals/AccountMenuModal.tsx +++ b/packages/desktop-client/src/components/modals/AccountMenuModal.tsx @@ -85,12 +85,8 @@ export function AccountMenuModal({ focusAfterClose={false} {...modalProps} onClose={_onClose} - padding={0} style={{ - flex: 1, height: '45vh', - padding: '0 10px', - borderRadius: '6px', }} leftHeaderContent={ - - - )} + + + ); } diff --git a/packages/desktop-client/src/components/modals/CreateAccount.tsx b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx similarity index 99% rename from packages/desktop-client/src/components/modals/CreateAccount.tsx rename to packages/desktop-client/src/components/modals/CreateAccountModal.tsx index ae035dae490..9c4f4ed590e 100644 --- a/packages/desktop-client/src/components/modals/CreateAccount.tsx +++ b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx @@ -24,7 +24,7 @@ type CreateAccountProps = { upgradingAccountId?: string; }; -export function CreateAccount({ +export function CreateAccountModal({ modalProps, syncServerStatus, upgradingAccountId, diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx b/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx index 20cfa1317c8..7de0a7da708 100644 --- a/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx +++ b/packages/desktop-client/src/components/modals/CreateEncryptionKeyModal.tsx @@ -65,11 +65,8 @@ export function CreateEncryptionKeyModal({ diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccount.tsx b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx similarity index 93% rename from packages/desktop-client/src/components/modals/CreateLocalAccount.tsx rename to packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx index 00dd36e108d..2783acf2c88 100644 --- a/packages/desktop-client/src/components/modals/CreateLocalAccount.tsx +++ b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx @@ -12,7 +12,7 @@ import { InitialFocus } from '../common/InitialFocus'; import { InlineField } from '../common/InlineField'; import { Input } from '../common/Input'; import { Link } from '../common/Link'; -import { Modal, ModalButtons } from '../common/Modal'; +import { Modal, ModalButtons, ModalTitle } from '../common/Modal'; import { Text } from '../common/Text'; import { View } from '../common/View'; import { Checkbox } from '../forms'; @@ -23,7 +23,7 @@ type CreateLocalAccountProps = { actions: BoundActions; }; -export function CreateLocalAccount({ +export function CreateLocalAccountModal({ modalProps, actions, }: CreateLocalAccountProps) { @@ -38,7 +38,10 @@ export function CreateLocalAccount({ const validateBalance = balance => !isNaN(parseFloat(balance)); return ( - + } + {...modalProps} + > {() => (
- + - + diff --git a/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx b/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx index 30446306d55..a1a451cb674 100644 --- a/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx +++ b/packages/desktop-client/src/components/modals/FixEncryptionKeyModal.tsx @@ -61,11 +61,8 @@ export function FixEncryptionKeyModal({ hasExistingKey ? 'Unable to decrypt file' : 'This file is encrypted' } style={{ - flex: 1, padding: '0 10px', - borderRadius: '6px', }} - padding={10} onClose={modalProps.onClose} > - {() => ( - <> - - - - setAmount(value)} - onEnter={() => _onSubmit(amount)} - /> - - - - - - - )} + + + + setAmount(value)} + onEnter={() => _onSubmit(amount)} + /> + + + + + ); } diff --git a/packages/desktop-client/src/components/modals/LoadBackup.jsx b/packages/desktop-client/src/components/modals/LoadBackup.jsx index e09f783322a..741b41d7c03 100644 --- a/packages/desktop-client/src/components/modals/LoadBackup.jsx +++ b/packages/desktop-client/src/components/modals/LoadBackup.jsx @@ -74,7 +74,7 @@ export function LoadBackup({ const previousBackups = backups.filter(backup => !backup.isLatest); return ( - + {() => ( + {() => } ); diff --git a/packages/desktop-client/src/components/modals/MergeUnusedPayees.jsx b/packages/desktop-client/src/components/modals/MergeUnusedPayees.jsx index 33ca3d70328..78d0efc1783 100644 --- a/packages/desktop-client/src/components/modals/MergeUnusedPayees.jsx +++ b/packages/desktop-client/src/components/modals/MergeUnusedPayees.jsx @@ -80,7 +80,6 @@ export function MergeUnusedPayees({ modalProps, payeeIds, targetPayeeId }) { return ( - {() => ( + + ({ + borderRadius: 6, + flex: 1, + minWidth: 0, + })} + onChange={setNotes} + /> - ({ - borderRadius: 6, - flex: 1, - minWidth: 0, - })} - onChange={setNotes} - /> - - - + + Save notes + - )} + ); } diff --git a/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx b/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx index 3d26dc45d53..5c860cacc38 100644 --- a/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx +++ b/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx @@ -45,12 +45,8 @@ export function PayeeAutocompleteModal({ focusAfterClose={false} {...modalProps} onClose={_onClose} - padding={0} style={{ - flex: 0, height: isNarrowWidth ? '85vh' : 275, - padding: '15px 10px', - borderRadius: '6px', backgroundColor: theme.menuAutoCompleteBackground, }} CloseButton={props => ( diff --git a/packages/desktop-client/src/components/modals/ReportBalanceMenuModal.tsx b/packages/desktop-client/src/components/modals/ReportBalanceMenuModal.tsx index 1bd2fb83f4c..c77f4776d12 100644 --- a/packages/desktop-client/src/components/modals/ReportBalanceMenuModal.tsx +++ b/packages/desktop-client/src/components/modals/ReportBalanceMenuModal.tsx @@ -41,13 +41,6 @@ export function ReportBalanceMenuModal({ showHeader focusAfterClose={false} {...modalProps} - padding={0} - style={{ - flex: 1, - padding: '0 10px', - paddingBottom: 10, - borderRadius: '6px', - }} > - {() => ( - - - - - - = currentMonth} - style={{ ...styles.mediumText, marginTop: 20 }} - /> - - )} + + + + + + = currentMonth} + style={{ ...styles.mediumText, marginTop: 20 }} + /> + ); } diff --git a/packages/desktop-client/src/components/modals/RolloverBalanceMenuModal.tsx b/packages/desktop-client/src/components/modals/RolloverBalanceMenuModal.tsx index 33f707fdfd2..068c86b1f72 100644 --- a/packages/desktop-client/src/components/modals/RolloverBalanceMenuModal.tsx +++ b/packages/desktop-client/src/components/modals/RolloverBalanceMenuModal.tsx @@ -43,13 +43,6 @@ export function RolloverBalanceMenuModal({ showHeader focusAfterClose={false} {...modalProps} - padding={0} - style={{ - flex: 1, - padding: '0 10px', - paddingBottom: 10, - borderRadius: '6px', - }} > - {() => ( - - - - - )} + + + + ); } diff --git a/packages/desktop-client/src/components/modals/RolloverToBudgetMenuModal.tsx b/packages/desktop-client/src/components/modals/RolloverToBudgetMenuModal.tsx index 9daa6ac60b1..da1c28a1e2f 100644 --- a/packages/desktop-client/src/components/modals/RolloverToBudgetMenuModal.tsx +++ b/packages/desktop-client/src/components/modals/RolloverToBudgetMenuModal.tsx @@ -25,18 +25,7 @@ export function RolloverToBudgetMenuModal({ }; return ( - + defaultMenuItemStyle} onTransfer={onTransfer} diff --git a/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx b/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx index 8a70ceb1572..bac14eeb56d 100644 --- a/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx +++ b/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx @@ -23,18 +23,7 @@ export function ScheduledTransactionMenuModal({ }; return ( - + - {() => ( - <> - - - _onSubmit(e.currentTarget.value)} - /> - - {errorMessage && ( - - * {errorMessage} - - )} - - + + + _onSubmit(e.currentTarget.value)} + /> + + {errorMessage && ( + - - - - )} + * {errorMessage} + + )} + + + + ); } diff --git a/packages/desktop-client/src/components/modals/SwitchBudgetTypeModal.tsx b/packages/desktop-client/src/components/modals/SwitchBudgetTypeModal.tsx index 27b92df6cb5..e4b0c0b499d 100644 --- a/packages/desktop-client/src/components/modals/SwitchBudgetTypeModal.tsx +++ b/packages/desktop-client/src/components/modals/SwitchBudgetTypeModal.tsx @@ -6,7 +6,7 @@ import { useResponsive } from '../../ResponsiveProvider'; import { styles } from '../../style'; import { Button } from '../common/Button'; import { Link } from '../common/Link'; -import { Modal } from '../common/Modal'; +import { Modal, ModalTitle } from '../common/Modal'; import { Paragraph } from '../common/Paragraph'; import { Text } from '../common/Text'; import { type CommonModalProps } from '../Modals'; @@ -28,45 +28,46 @@ export function SwitchBudgetTypeModal({ } : {}; return ( - - {() => ( - <> - - You are currently using a{' '} - - {budgetType === 'report' ? 'Report budget' : 'Rollover budget'}. - {' '} - Switching will not lose any data and you can always switch back. - - + + - Switch to a{' '} - {budgetType === 'report' ? 'Rollover budget' : 'Report budget'} - - - - How do these types of budgeting work? - - - - )} + How do these types of budgeting work? + + + ); } diff --git a/packages/desktop-client/src/components/modals/TransferModal.tsx b/packages/desktop-client/src/components/modals/TransferModal.tsx index 43bf3995dcf..8b19a5dd5a4 100644 --- a/packages/desktop-client/src/components/modals/TransferModal.tsx +++ b/packages/desktop-client/src/components/modals/TransferModal.tsx @@ -72,67 +72,53 @@ export function TransferModal({ const toCategory = categories.find(c => c.id === toCategoryId); return ( - - {() => ( - <> - - - - { - if (!toCategoryId) { - openCategoryModal(); - } - }} - /> - - + + + + + + { + if (!toCategoryId) { + openCategoryModal(); + } + }} + /> + + - - + + - + - - - )} + Transfer + + + ); } diff --git a/upcoming-release-notes/2571.md b/upcoming-release-notes/2571.md new file mode 100644 index 00000000000..c5d0d0172d3 --- /dev/null +++ b/upcoming-release-notes/2571.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [joel-jeremy] +--- + +Use consistent padding in modals