From f6f496f656f6f9016df815955d08d06a2ce87c5f Mon Sep 17 00:00:00 2001 From: Neil <55785687+carkom@users.noreply.github.com> Date: Sat, 16 Sep 2023 01:56:19 -0700 Subject: [PATCH] Dark Theme Final (#1513) --- .eslintrc.js | 38 +------ .../src/components/LoggedInUser.tsx | 4 +- .../src/components/MobileWebMessage.tsx | 6 +- .../src/components/NotesButton.tsx | 18 +-- .../src/components/Notifications.tsx | 34 ++++-- .../desktop-client/src/components/Page.tsx | 6 +- .../src/components/Titlebar.tsx | 16 +-- .../src/components/UpdateNotification.tsx | 18 ++- .../src/components/accounts/Header.js | 4 +- .../src/components/budget/BudgetCategories.js | 9 +- .../src/components/budget/BudgetTotals.js | 11 +- .../src/components/budget/ExpenseGroup.js | 4 +- .../src/components/budget/IncomeGroup.js | 4 +- .../src/components/budget/MobileBudget.js | 3 +- .../components/budget/MobileBudgetTable.js | 68 ++++++----- .../src/components/budget/MobileTable.tsx | 4 +- .../components/budget/MonthCountSelector.tsx | 6 +- .../src/components/budget/MonthPicker.js | 14 ++- .../src/components/budget/RenderMonths.js | 4 +- .../src/components/budget/SidebarCategory.js | 8 +- .../src/components/budget/SidebarGroup.js | 8 +- .../src/components/budget/constants.js | 4 - .../budget/rollover/BudgetSummary.tsx | 27 ++--- .../budget/rollover/rollover-components.tsx | 34 +++--- .../src/components/budget/util.js | 13 ++- .../src/components/common/ExternalLink.tsx | 6 +- .../src/components/mobile/MobileForms.js | 9 +- .../src/components/modals/BudgetSummary.js | 5 +- .../transactions/MobileTransaction.js | 107 +++++++++++------- .../transactions/TransactionsTable.js | 28 ++--- packages/desktop-client/src/style/styles.ts | 1 + .../desktop-client/src/style/themes/dark.ts | 7 ++ .../src/style/themes/development.ts | 7 ++ .../desktop-client/src/style/themes/light.ts | 22 ++++ upcoming-release-notes/1513.md | 5 + 35 files changed, 312 insertions(+), 250 deletions(-) delete mode 100644 packages/desktop-client/src/components/budget/constants.js create mode 100644 upcoming-release-notes/1513.md diff --git a/.eslintrc.js b/.eslintrc.js index 8f4181aff90..ef5d7e4e2a8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -216,43 +216,9 @@ module.exports = { rules: { 'import/no-unused-modules': 'off' }, }, { - //This is temporary. We will remove these as dark theme gets ported files: [ - './packages/desktop-client/src/components/LoggedInUser.*', - './packages/desktop-client/src/components/MobileWebMessage.*', - './packages/desktop-client/src/components/NotesButton.*', - './packages/desktop-client/src/components/Notifications.*', - './packages/desktop-client/src/components/Page.*', - './packages/desktop-client/src/components/Titlebar.*', - './packages/desktop-client/src/components/UpdateNotification.*', - './packages/desktop-client/src/components/accounts/Header.*', - './packages/desktop-client/src/components/alerts.*', - './packages/desktop-client/src/components/budget/BudgetCategories.*', - './packages/desktop-client/src/components/budget/BudgetTotals.*', - './packages/desktop-client/src/components/budget/ExpenseGroup.*', - './packages/desktop-client/src/components/budget/IncomeGroup.*', - './packages/desktop-client/src/components/budget/MobileBudget.*', - './packages/desktop-client/src/components/budget/MobileBudgetTable.*', - './packages/desktop-client/src/components/budget/MobileTable.*', - './packages/desktop-client/src/components/budget/MonthCountSelector.*', - './packages/desktop-client/src/components/budget/MonthPicker.*', - './packages/desktop-client/src/components/budget/RenderMonths.*', - './packages/desktop-client/src/components/budget/SidebarCategory.*', - './packages/desktop-client/src/components/budget/SidebarGroup.*', - './packages/desktop-client/src/components/budget/constants.*', - './packages/desktop-client/src/components/budget/misc.*', - './packages/desktop-client/src/components/budget/report/BudgetSummary.*', - './packages/desktop-client/src/components/budget/report/components.*', - './packages/desktop-client/src/components/budget/rollover/BudgetSummary.*', - './packages/desktop-client/src/components/budget/rollover/rollover-components.*', - './packages/desktop-client/src/components/budget/util.*', - './packages/desktop-client/src/components/common/ExternalLink.*', - './packages/desktop-client/src/components/modals/BudgetSummary.*', - './packages/desktop-client/src/components/payees/index.*', - './packages/desktop-client/src/components/transactions/MobileTransaction.*', - './packages/desktop-client/src/components/transactions/TransactionsTable.*', - './packages/desktop-client/src/components/util/AmountInput.*', - './packages/desktop-client/src/style/*', + './packages/desktop-client/src/style/index.*', + './packages/desktop-client/src/style/palette.*', ], rules: { 'no-restricted-imports': ['off', { patterns: restrictedImportColors }], diff --git a/packages/desktop-client/src/components/LoggedInUser.tsx b/packages/desktop-client/src/components/LoggedInUser.tsx index 4f432c8077f..7e81e9a732d 100644 --- a/packages/desktop-client/src/components/LoggedInUser.tsx +++ b/packages/desktop-client/src/components/LoggedInUser.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { useSelector } from 'react-redux'; import { useActions } from '../hooks/useActions'; -import { colors, styles, type CSSProperties } from '../style'; +import { theme, styles, type CSSProperties } from '../style'; import Button from './common/Button'; import Menu from './common/Menu'; @@ -78,7 +78,7 @@ export default function LoggedInUser({ return ( diff --git a/packages/desktop-client/src/components/Notifications.tsx b/packages/desktop-client/src/components/Notifications.tsx index 368d095563c..f61552521e2 100644 --- a/packages/desktop-client/src/components/Notifications.tsx +++ b/packages/desktop-client/src/components/Notifications.tsx @@ -11,7 +11,7 @@ import type { NotificationWithId } from 'loot-core/src/client/state-types/notifi import { useActions } from '../hooks/useActions'; import AnimatedLoading from '../icons/AnimatedLoading'; import Delete from '../icons/v0/Delete'; -import { styles, colors, type CSSProperties } from '../style'; +import { styles, theme, type CSSProperties } from '../style'; import Button, { ButtonWithLoading } from './common/Button'; import ExternalLink from './common/ExternalLink'; @@ -107,7 +107,11 @@ function Notification({ @@ -200,7 +212,7 @@ function Notification({ left: 0, right: 0, bottom: 0, - backgroundColor: 'rgba(250, 250, 250, .75)', + backgroundColor: theme.tableBackground, alignItems: 'center', justifyContent: 'center', }} diff --git a/packages/desktop-client/src/components/Page.tsx b/packages/desktop-client/src/components/Page.tsx index b6ac595eaee..1971861caaf 100644 --- a/packages/desktop-client/src/components/Page.tsx +++ b/packages/desktop-client/src/components/Page.tsx @@ -1,7 +1,7 @@ import React, { type ReactNode } from 'react'; import { useResponsive } from '../ResponsiveProvider'; -import { colors, styles, type CSSProperties } from '../style'; +import { theme, styles, type CSSProperties } from '../style'; import Text from './common/Text'; import View from './common/View'; @@ -20,8 +20,8 @@ function PageTitle({ {count} uncategorized {count === 1 ? 'transaction' : 'transactions'} @@ -148,19 +150,19 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) { const mobileColor = syncState === 'error' - ? colors.r7 + ? theme.alt4ErrorText : syncState === 'disabled' || syncState === 'offline' || syncState === 'local' - ? colors.n9 + ? theme.sidebarItemText : style.color; const desktopColor = syncState === 'error' - ? colors.r4 + ? theme.alt2ErrorText : syncState === 'disabled' || syncState === 'offline' || syncState === 'local' - ? colors.n6 + ? theme.altTableText : null; const activeStyle = isMobile @@ -337,7 +339,7 @@ export default function Titlebar({ style }) { > )} diff --git a/packages/desktop-client/src/components/UpdateNotification.tsx b/packages/desktop-client/src/components/UpdateNotification.tsx index df42cc420b5..7e844e02999 100644 --- a/packages/desktop-client/src/components/UpdateNotification.tsx +++ b/packages/desktop-client/src/components/UpdateNotification.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import { useActions } from '../hooks/useActions'; import Close from '../icons/v1/Close'; -import { colors } from '../style'; +import { theme } from '../style'; import Button from './common/Button'; import LinkButton from './common/LinkButton'; @@ -36,8 +36,8 @@ export default function UpdateNotification() { bottom: 0, right: 0, margin: '15px 17px', - backgroundColor: colors.p6, - color: 'white', + backgroundColor: theme.altPageTextPositive, + color: theme.tableBackground, padding: '7px 10px', borderRadius: 4, zIndex: 10000, @@ -53,13 +53,19 @@ export default function UpdateNotification() { Restart {' '} ( window.Actual.openURLInBrowser( 'https://actualbudget.org/docs/releases', @@ -74,7 +80,7 @@ export default function UpdateNotification() { style={{ display: 'inline', padding: '1px 7px 2px 7px' }} onClick={() => closeNotification(setAppState)} > - + diff --git a/packages/desktop-client/src/components/accounts/Header.js b/packages/desktop-client/src/components/accounts/Header.js index eb180b07adf..e6dcfe54942 100644 --- a/packages/desktop-client/src/components/accounts/Header.js +++ b/packages/desktop-client/src/components/accounts/Header.js @@ -7,7 +7,7 @@ import ArrowsExpand3 from '../../icons/v2/ArrowsExpand3'; import ArrowsShrink3 from '../../icons/v2/ArrowsShrink3'; import DownloadThickBottom from '../../icons/v2/DownloadThickBottom'; import Pencil1 from '../../icons/v2/Pencil1'; -import { colors, styles } from '../../style'; +import { theme, styles } from '../../style'; import AnimatedRefresh from '../AnimatedRefresh'; import Button from '../common/Button'; import InitialFocus from '../common/InitialFocus'; @@ -170,7 +170,7 @@ export function AccountHeader({ style={{ width: 11, height: 11, - color: colors.n8, + color: theme.altButtonBareText, }} /> diff --git a/packages/desktop-client/src/components/budget/BudgetCategories.js b/packages/desktop-client/src/components/budget/BudgetCategories.js index cfec40f1c42..bab700c8494 100644 --- a/packages/desktop-client/src/components/budget/BudgetCategories.js +++ b/packages/desktop-client/src/components/budget/BudgetCategories.js @@ -1,11 +1,10 @@ import React, { memo, useState, useMemo } from 'react'; -import { colors } from '../../style'; +import { theme, styles } from '../../style'; import View from '../common/View'; import { DropHighlightPosContext } from '../sort'; import { Row } from '../table'; -import { INCOME_HEADER_HEIGHT, MONTH_BOX_SHADOW } from './constants'; import ExpenseCategory from './ExpenseCategory'; import ExpenseGroup from './ExpenseGroup'; import IncomeCategory from './IncomeCategory'; @@ -152,7 +151,7 @@ const BudgetCategories = memo( marginBottom: 10, backgroundColor: 'white', overflow: 'hidden', - boxShadow: MONTH_BOX_SHADOW, + boxShadow: styles.cardShadow, borderRadius: '0 0 4px 4px', flex: 1, }} @@ -162,7 +161,7 @@ const BudgetCategories = memo( switch (item.type) { case 'new-group': content = ( - + diff --git a/packages/desktop-client/src/components/budget/BudgetTotals.js b/packages/desktop-client/src/components/budget/BudgetTotals.js index 2132d0e0bb5..3a811461fec 100644 --- a/packages/desktop-client/src/components/budget/BudgetTotals.js +++ b/packages/desktop-client/src/components/budget/BudgetTotals.js @@ -1,13 +1,12 @@ import React, { memo, useState } from 'react'; import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple'; -import { colors } from '../../style'; +import { theme, styles } from '../../style'; import Button from '../common/Button'; import Menu from '../common/Menu'; import View from '../common/View'; import { Tooltip } from '../tooltips'; -import { MONTH_BOX_SHADOW } from './constants'; import RenderMonths from './RenderMonths'; import { getScrollbarWidth } from './util'; @@ -25,17 +24,17 @@ const BudgetTotals = memo(function BudgetTotals({ backgroundColor: 'white', flexDirection: 'row', flexShrink: 0, - boxShadow: MONTH_BOX_SHADOW, + boxShadow: styles.cardShadow, marginLeft: 5, marginRight: 5 + getScrollbarWidth(), borderRadius: '4px 4px 0 0', - borderBottom: '1px solid ' + colors.border, + borderBottom: '1px solid ' + theme.tableBorder, }} > {menuOpen && ( {dragState && !dragState.preview && dragState.type === 'group' && ( diff --git a/packages/desktop-client/src/components/budget/IncomeGroup.js b/packages/desktop-client/src/components/budget/IncomeGroup.js index 38cbd53cbcf..f7d260fff54 100644 --- a/packages/desktop-client/src/components/budget/IncomeGroup.js +++ b/packages/desktop-client/src/components/budget/IncomeGroup.js @@ -1,6 +1,6 @@ import React from 'react'; -import { colors } from '../../style'; +import { theme } from '../../style'; import { Row } from '../table'; import RenderMonths from './RenderMonths'; @@ -19,7 +19,7 @@ function IncomeGroup({ return ( @@ -386,7 +393,7 @@ class TotalsRow extends PureComponent { style={{ flexDirection: 'row', alignItems: 'center', - backgroundColor: colors.n11, + backgroundColor: theme.tableHeaderBackground, }} data-testid="totals" > @@ -564,7 +571,7 @@ class IncomeCategory extends PureComponent { // flexDirection: 'row', // justifyContent: 'flex-end', // alignItems: 'stretch', -// backgroundColor: colors.n10, +// backgroundColor: colorsm.tableBackground, // padding: 5, // height: 45 // }} @@ -718,7 +725,9 @@ class IncomeBudgetGroup extends Component { } nameTextStyle={{ fontWeight: '500' }} amountTextStyle={{ fontWeight: '500' }} - style={{ backgroundColor: colors.n11 }} + style={{ + backgroundColor: theme.altTableBackground, + }} /> {group.categories.map((category, index) => { @@ -883,7 +892,7 @@ export function BudgetTable(props) { paddingRight: 14, backgroundColor: 'white', borderBottomWidth: 1, - borderColor: colors.n9, + borderColor: theme.tableBorder, }} > {type === 'report' ? ( @@ -905,22 +914,25 @@ export function BudgetTable(props) { margin: '0 -8px', background: showBudgetedCol && !show3Cols - ? `linear-gradient(-45deg, ${colors.p5} 8px, transparent 0)` + ? `linear-gradient(-45deg, ${theme.formInputBackgroundSelection} 8px, transparent 0)` : !show3Cols - ? `linear-gradient(45deg, ${colors.p5} 8px, transparent 0)` + ? `linear-gradient(45deg, ${theme.formInputBackgroundSelection} 8px, transparent 0)` : null, // 45deg to flip it to the lower left corner }} > {show3Cols || showBudgetedCol ? ( - - {!editMode ? ( // {!editMode && ( @@ -1093,7 +1104,11 @@ function BudgetHeader({ padding: '5px 30px 5px 0', }} > - + )} - {serverURL && ( { style={{ height: ROW_HEIGHT, borderBottomWidth: 1, - borderColor: colors.border, + borderColor: theme.tableBorder, flexDirection: 'row', alignItems: 'center', paddingLeft: 10, diff --git a/packages/desktop-client/src/components/budget/MonthCountSelector.tsx b/packages/desktop-client/src/components/budget/MonthCountSelector.tsx index d5bba0f3a20..d3baecf087b 100644 --- a/packages/desktop-client/src/components/budget/MonthCountSelector.tsx +++ b/packages/desktop-client/src/components/budget/MonthCountSelector.tsx @@ -1,7 +1,7 @@ import React from 'react'; import CalendarIcon from '../../icons/v2/Calendar'; -import { colors } from '../../style'; +import { theme } from '../../style'; import View from '../common/View'; import { useBudgetMonthCount } from './BudgetMonthCountContext'; @@ -42,7 +42,9 @@ export function MonthCountSelector({ calendars.push( = i ? colors.n5 : colors.n8} + color={ + maxMonths >= i ? theme.altpageTextSubdued : theme.altButtonBareText + } onClick={() => onChange(i)} />, ); diff --git a/packages/desktop-client/src/components/budget/MonthPicker.js b/packages/desktop-client/src/components/budget/MonthPicker.js index 390f8e77bcf..4466edb38df 100644 --- a/packages/desktop-client/src/components/budget/MonthPicker.js +++ b/packages/desktop-client/src/components/budget/MonthPicker.js @@ -3,7 +3,7 @@ import { useState } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; import useResizeObserver from '../../hooks/useResizeObserver'; -import { styles, colors } from '../../style'; +import { styles, theme } from '../../style'; import View from '../common/View'; export const MonthPicker = ({ @@ -102,12 +102,12 @@ export const MonthPicker = ({ border: 'none', ...(!isMonthBudgeted && { textDecoration: 'line-through', - color: colors.n7, + color: theme.pageTextSubdued, }), ...styles.smallText, ...(selected && { - backgroundColor: colors.p6, - color: 'white', + backgroundColor: theme.tableBorderHover, + color: theme.buttonPrimaryText, }), ...((hovered || selected) && { borderRadius: 0, @@ -119,7 +119,7 @@ export const MonthPicker = ({ }), ...(hovered && selected && { - backgroundColor: colors.p7, + backgroundColor: theme.tableBorderHover, }), ...((idx === firstSelectedIndex || (idx === hoverId && !selected)) && { @@ -146,7 +146,9 @@ export const MonthPicker = ({ left: 0, fontSize: 10, fontWeight: 'bold', - color: isMonthBudgeted ? '#272630' : colors.n7, + color: isMonthBudgeted + ? theme.pageText + : theme.pageTextSubdued, }} > {year} diff --git a/packages/desktop-client/src/components/budget/RenderMonths.js b/packages/desktop-client/src/components/budget/RenderMonths.js index f563d859fe5..044f2ca702d 100644 --- a/packages/desktop-client/src/components/budget/RenderMonths.js +++ b/packages/desktop-client/src/components/budget/RenderMonths.js @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; -import { colors } from '../../style'; +import { theme } from '../../style'; import View from '../common/View'; import NamespaceContext from '../spreadsheet/NamespaceContext'; @@ -22,7 +22,7 @@ function RenderMonths({ component: Component, editingIndex, args, style }) { diff --git a/packages/desktop-client/src/components/budget/SidebarCategory.js b/packages/desktop-client/src/components/budget/SidebarCategory.js index 3ccebb13a3b..cee13b3924f 100644 --- a/packages/desktop-client/src/components/budget/SidebarCategory.js +++ b/packages/desktop-client/src/components/budget/SidebarCategory.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import CheveronDown from '../../icons/v1/CheveronDown'; -import { colors } from '../../style'; +import { theme } from '../../style'; import Button from '../common/Button'; import Menu from '../common/Menu'; import View from '../common/View'; @@ -16,7 +16,7 @@ function SidebarCategory({ dragging, editing, style, - borderColor = colors.border, + borderColor = theme.tableBorder, isLast, onDragChange, onEditMonth, @@ -110,9 +110,9 @@ function SidebarCategory({ '& button': { display: 'none' }, ...(!dragging && !dragPreview && { - '&:hover button': { display: 'flex', color: colors.n1 }, + '&:hover button': { display: 'flex', color: theme.tableTextHover }, }), - ...(dragging && { color: colors.n8 }), + ...(dragging && { color: theme.formInputTextPlaceholderSelected }), // The zIndex here forces the the view on top of a row below // it that may be "collapsed" and show a border on top ...(dragPreview && { diff --git a/packages/desktop-client/src/components/budget/SidebarGroup.js b/packages/desktop-client/src/components/budget/SidebarGroup.js index 2273dac88a9..f470ebb31ce 100644 --- a/packages/desktop-client/src/components/budget/SidebarGroup.js +++ b/packages/desktop-client/src/components/budget/SidebarGroup.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import ExpandArrow from '../../icons/v0/ExpandArrow'; import CheveronDown from '../../icons/v1/CheveronDown'; -import { colors } from '../../style'; +import { theme } from '../../style'; import Button from '../common/Button'; import Menu from '../common/Menu'; import Text from '../common/Text'; @@ -18,7 +18,7 @@ function SidebarGroup({ dragPreview, innerRef, style, - borderColor = colors.border, + borderColor = theme.tableBorder, onEdit, onSave, onDelete, @@ -124,9 +124,9 @@ function SidebarGroup({ style={{ ...style, width: 200, - backgroundColor: colors.n11, + backgroundColor: theme.altTableBackground, '& button': { display: 'none' }, - '&:hover button': { display: 'flex', color: colors.n1 }, + '&:hover button': { display: 'flex', color: theme.tableTextHover }, ...(dragPreview && { paddingLeft: 10, zIndex: 10000, diff --git a/packages/desktop-client/src/components/budget/constants.js b/packages/desktop-client/src/components/budget/constants.js deleted file mode 100644 index d0ac62ba30e..00000000000 --- a/packages/desktop-client/src/components/budget/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -export const INCOME_HEADER_HEIGHT = 70; -export const MONTH_BOX_SHADOW = - '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)'; -export const MONTH_RIGHT_PADDING = 5; diff --git a/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx index f137a857e87..99e5f7621df 100644 --- a/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx +++ b/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx @@ -8,7 +8,7 @@ import * as monthUtils from 'loot-core/src/shared/months'; import DotsHorizontalTriple from '../../../icons/v1/DotsHorizontalTriple'; import ArrowButtonDown1 from '../../../icons/v2/ArrowButtonDown1'; import ArrowButtonUp1 from '../../../icons/v2/ArrowButtonUp1'; -import { colors, styles } from '../../../style'; +import { theme, styles } from '../../../style'; import AlignedText from '../../common/AlignedText'; import Block from '../../common/Block'; import Button from '../../common/Button'; @@ -23,7 +23,6 @@ import useFormat from '../../spreadsheet/useFormat'; import useSheetName from '../../spreadsheet/useSheetName'; import useSheetValue from '../../spreadsheet/useSheetValue'; import { Tooltip } from '../../tooltips'; -import { MONTH_BOX_SHADOW } from '../constants'; import HoldTooltip from './HoldTooltip'; import { useRollover } from './RolloverContext'; @@ -44,10 +43,10 @@ function TotalsList({ prevMonthName, collapsed }: TotalsListProps) { ...(!collapsed && { padding: '5px 0', marginTop: 17, - backgroundColor: colors.n11, + backgroundColor: theme.tableRowHeaderBackground, borderTopWidth: 1, borderBottomWidth: 1, - borderColor: colors.n9, + borderColor: theme.tableBorder, }), ...(collapsed && { padding: 7, @@ -186,11 +185,13 @@ function ToBudget({ fontWeight: 400, userSelect: 'none', cursor: 'pointer', - color: isNegative ? colors.r4 : colors.p5, + color: isNegative ? theme.errorText : theme.pageTextPositive, marginBottom: -1, borderBottom: '1px solid transparent', ':hover': { - borderColor: isNegative ? colors.r4 : colors.p5, + borderColor: isNegative + ? theme.errorText + : theme.pageTextPositive, }, }, ])}`} @@ -289,8 +290,8 @@ export function BudgetSummary({ @@ -366,7 +367,7 @@ export function BudgetSummary({ width={15} height={15} tooltipPosition="bottom-right" - defaultColor={colors.n6} + defaultColor={theme.altTableText} /> @@ -374,7 +375,7 @@ export function BudgetSummary({ {menuOpen && ( @@ -426,8 +427,8 @@ export function BudgetSummary({ alignItems: 'center', padding: '10px 20px', justifyContent: 'space-between', - backgroundColor: colors.n11, - borderTop: '1px solid ' + colors.n10, + backgroundColor: theme.tableHeaderBackground, + borderTop: '1px solid ' + theme.tableBorder, }} > ); } - let headerLabelStyle: CSSProperties = { flex: 1, padding: '0 5px', @@ -197,36 +195,36 @@ export const BudgetTotalsMonth = memo(function BudgetTotalsMonth() { style={{ flex: 1, flexDirection: 'row', - marginRight: MONTH_RIGHT_PADDING, + marginRight: styles.monthRightPadding, paddingTop: 10, paddingBottom: 10, }} > - Budgeted + Budgeted { return format(-parseFloat(value || '0'), 'financial'); }} /> - Spent + Spent - Balance + Balance @@ -237,7 +235,7 @@ export function IncomeHeaderMonth() { return ( onUpdate(e.target.checked)} className={`${css([ { - marginInline: EDITING_PADDING, + marginInline: styles.mobileEditingPadding, }, style, ])}`} diff --git a/packages/desktop-client/src/components/modals/BudgetSummary.js b/packages/desktop-client/src/components/modals/BudgetSummary.js index 3adf6022358..d4f3a82cba6 100644 --- a/packages/desktop-client/src/components/modals/BudgetSummary.js +++ b/packages/desktop-client/src/components/modals/BudgetSummary.js @@ -3,7 +3,7 @@ import React from 'react'; import { rolloverBudget } from 'loot-core/src/client/queries'; import * as monthUtils from 'loot-core/src/shared/months'; -import { colors, styles } from '../../style'; +import { theme, styles } from '../../style'; import Button from '../common/Button'; import Modal from '../common/Modal'; import Text from '../common/Text'; @@ -26,7 +26,7 @@ function ToBudget({ toBudget }) { ...styles.text, fontWeight: '600', fontSize: 22, - color: budgetAmount < 0 ? colors.r4 : colors.n1, + color: budgetAmount < 0 ? theme.errorText : theme.formInputText, }} > {format(budgetAmount, 'financial')} @@ -90,7 +90,6 @@ function BudgetSummary({ month, modalProps }) { For Next Month - - + {monthUtils.format(date, 'MMMM dd, yyyy')} @@ -155,13 +156,13 @@ function Status({ status }) { switch (status) { case 'missed': - color = colors.r3; + color = theme.alt3ErrorText; break; case 'due': - color = colors.y3; + color = theme.alt2WarningText; break; case 'upcoming': - color = colors.n4; + color = theme.alt2TableText; break; default: } @@ -345,13 +346,13 @@ class TransactionEditInner extends PureComponent { style={{ margin: 10, marginTop: 3, - backgroundColor: colors.n11, + backgroundColor: theme.tableHeaderBackground, flex: 1, borderRadius: 4, // This shadow make the card "pop" off of the screen below // it - shadowColor: colors.n3, + shadowColor: theme.cardShadow, shadowOffset: { width: 0, height: 0 }, shadowRadius: 4, shadowOpacity: 1, @@ -368,8 +369,8 @@ class TransactionEditInner extends PureComponent { Back @@ -428,7 +433,6 @@ class TransactionEditInner extends PureComponent { automaticallyAdjustContentInsets={false} keyboardShouldPersistTaps="always" style={{ - backgroundColor: colors.n11, flexGrow: 1, overflow: 'hidden', }} @@ -517,7 +521,7 @@ class TransactionEditInner extends PureComponent { data-testid="category-field" /> ) : ( - + Split transaction editing is not supported on mobile at this time. @@ -592,8 +596,8 @@ class TransactionEditInner extends PureComponent { style={{ borderWidth: 0, paddingVertical: 5, - marginLeft: EDITING_PADDING, - marginRight: EDITING_PADDING, + marginLeft: styles.mobileEditingPadding, + marginRight: styles.mobileEditingPadding, marginTop: 20, marginBottom: 15, backgroundColor: 'transparent', @@ -603,11 +607,11 @@ class TransactionEditInner extends PureComponent { {adding ? (