diff --git a/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx b/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx index 3dc2c8e142e2384284c0be476726598604c0dee0..bd7c60bc4287fcd7941580a27ac9eba4fe5f6ea9 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx +++ b/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx @@ -199,11 +199,11 @@ export function AccountDetails({ </View> <PullToRefresh onRefresh={onRefresh}> <TransactionList + account={account} transactions={allTransactions} categories={categories} accounts={accounts} payees={payees} - showCategory={!account.offbudget} isNew={isNewTransaction} onLoadMore={onLoadMore} onSelect={onSelectTransaction} diff --git a/packages/desktop-client/src/components/transactions/MobileTransaction.jsx b/packages/desktop-client/src/components/transactions/MobileTransaction.jsx index 4f05daa85af549127d19b166ed78716e1623d47e..aa939b53990435c6c0634be9f06d443a1c79b9bc 100644 --- a/packages/desktop-client/src/components/transactions/MobileTransaction.jsx +++ b/packages/desktop-client/src/components/transactions/MobileTransaction.jsx @@ -1131,10 +1131,10 @@ export const TransactionEdit = props => { const Transaction = memo(function Transaction({ transaction, + account, accounts, categories, payees, - showCategory, added, onSelect, style, @@ -1169,11 +1169,15 @@ const Transaction = memo(function Transaction({ payee, transferAcct, ); - const prettyCategory = transferAcct - ? 'Transfer' - : isParent - ? 'Split' - : categoryName; + const specialCategory = account?.offbudget + ? 'Off Budget' + : transferAcct + ? 'Transfer' + : isParent + ? 'Split' + : null; + + const prettyCategory = specialCategory || categoryName; const isPreview = isPreviewId(id); const isReconciled = transaction.reconciled; @@ -1260,22 +1264,21 @@ const Transaction = memo(function Transaction({ }} /> )} - {showCategory && ( - <TextOneLine - style={{ - fontSize: 11, - marginTop: 1, - fontWeight: '400', - color: prettyCategory - ? theme.tableTextSelected - : theme.menuItemTextSelected, - fontStyle: prettyCategory ? null : 'italic', - textAlign: 'left', - }} - > - {prettyCategory || 'Uncategorized'} - </TextOneLine> - )} + <TextOneLine + style={{ + fontSize: 11, + marginTop: 1, + fontWeight: '400', + color: prettyCategory + ? theme.tableTextSelected + : theme.menuItemTextSelected, + fontStyle: + specialCategory || !prettyCategory ? 'italic' : undefined, + textAlign: 'left', + }} + > + {prettyCategory || 'Uncategorized'} + </TextOneLine> </View> )} </View> @@ -1296,11 +1299,11 @@ const Transaction = memo(function Transaction({ }); export function TransactionList({ + account, accounts, categories, payees, transactions, - showCategory, isNew, onSelect, scrollProps = {}, @@ -1384,10 +1387,10 @@ export function TransactionList({ > <Transaction transaction={transaction} + account={account} categories={categories} accounts={accounts} payees={payees} - showCategory={showCategory} added={isNew(transaction.id)} onSelect={onSelect} // onSelect(transaction)} /> diff --git a/upcoming-release-notes/2284.md b/upcoming-release-notes/2284.md new file mode 100644 index 0000000000000000000000000000000000000000..7b946dee4810c4ac31daec794a697e053f69f1f4 --- /dev/null +++ b/upcoming-release-notes/2284.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [joel-jeremy] +--- + +Add Off Budget category label to mobile transactions page