Skip to content

Commit

Permalink
Color Fixes / Regression fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Sep 13, 2023
1 parent 03a3925 commit 2f5914f
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 58 deletions.
7 changes: 2 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +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/common/ExternalLink.*',
'./packages/desktop-client/src/components/payees/index.*',
'./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 }],
Expand Down
10 changes: 8 additions & 2 deletions packages/desktop-client/src/components/UpdateNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@ export default function UpdateNotification() {
<Text>
<LinkButton
onClick={updateApp}
style={{ color: theme.buttonPrimaryText, textDecoration: 'underline' }}
style={{
color: theme.buttonPrimaryText,
textDecoration: 'underline',
}}
>
Restart
</LinkButton>{' '}
(
<LinkButton
style={{ color: theme.buttonPrimaryText, textDecoration: 'underline' }}
style={{
color: theme.buttonPrimaryText,
textDecoration: 'underline',
}}
onClick={() =>
window.Actual.openURLInBrowser(
'https://actualbudget.org/docs/releases',
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/accounts/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -170,7 +170,7 @@ export function AccountHeader({
style={{
width: 11,
height: 11,
color: colors.n8,
color: theme.altButtonBareText,
}}
/>
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
}}
Expand All @@ -162,7 +161,7 @@ const BudgetCategories = memo(
switch (item.type) {
case 'new-group':
content = (
<Row style={{ backgroundColor: colors.n11 }}>
<Row style={{ backgroundColor: theme.altTableBackground }}>
<SidebarGroup
group={{ id: 'new', name: '' }}
editing={true}
Expand Down Expand Up @@ -235,7 +234,7 @@ const BudgetCategories = memo(
content = (
<View
style={{
height: INCOME_HEADER_HEIGHT,
height: styles.incomeHeaderHeight,
backgroundColor: 'white',
}}
>
Expand Down
11 changes: 5 additions & 6 deletions packages/desktop-client/src/components/budget/BudgetTotals.js
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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,
}}
>
<View
style={{
width: 200,
color: colors.n4,
color: theme.pageTextLight,
justifyContent: 'center',
paddingLeft: 15,
paddingRight: 5,
Expand All @@ -57,7 +56,7 @@ const BudgetTotals = memo(function BudgetTotals({
<DotsHorizontalTriple
width={15}
height={15}
style={{ color: colors.n5 }}
style={{ color: theme.altpageTextSubdued }}
/>
{menuOpen && (
<Tooltip
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/budget/ExpenseGroup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { colors } from '../../style';
import { theme } from '../../style';
import View from '../common/View';
import { useDraggable, useDroppable, DropHighlight } from '../sort';
import { Row, ROW_HEIGHT } from '../table';
Expand Down Expand Up @@ -56,7 +56,7 @@ function ExpenseGroup({
style={{
fontWeight: 600,
opacity: group.hidden ? 0.33 : undefined,
backgroundColor: colors.n11,
backgroundColor: theme.altTableBackground,
}}
>
{dragState && !dragState.preview && dragState.type === 'group' && (
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/budget/IncomeGroup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { colors } from '../../style';
import { theme } from '../../style';
import { Row } from '../table';

import RenderMonths from './RenderMonths';
Expand All @@ -19,7 +19,7 @@ function IncomeGroup({
return (
<Row
collapsed={true}
style={{ fontWeight: 600, backgroundColor: colors.n11 }}
style={{ fontWeight: 600, backgroundColor: theme.altTableBackground }}
>
<SidebarGroup
group={group}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ function Saved({ projected }) {
}}
>
{projected ? (
<Label title="PROJECTED SAVINGS" style={{ color: theme.formInputText }} />
<Label
title="PROJECTED SAVINGS"
style={{ color: theme.formInputText }}
/>
) : (
<Label
title={isNegative ? 'OVERSPENT' : 'SAVED'}
Expand Down Expand Up @@ -1101,7 +1104,11 @@ function BudgetHeader({
padding: '5px 30px 5px 0',
}}
>
<ArrowThinLeft style={{ color: theme.formInputTextReadOnlySelection }} width="15" height="15" />
<ArrowThinLeft
style={{ color: theme.formInputTextReadOnlySelection }}
width="15"
height="15"
/>
</Button>
)}
<Text
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/budget/MobileTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { type ComponentProps, type ReactNode } from 'react';

import { type CSSProperties, colors } from '../../style';
import { type CSSProperties, theme } from '../../style';
import View from '../common/View';

export const ROW_HEIGHT = 50;
Expand All @@ -16,7 +16,7 @@ export const ListItem = ({ children, style, ...props }: ListItemProps) => {
style={{
height: ROW_HEIGHT,
borderBottomWidth: 1,
borderColor: colors.border,
borderColor: theme.tableBorder,
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 10,
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/budget/RenderMonths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -22,7 +22,7 @@ function RenderMonths({ component: Component, editingIndex, args, style }) {
<View
style={{
flex: 1,
borderLeft: '1px solid ' + colors.border,
borderLeft: '1px solid ' + theme.tableBorder,
...style,
}}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -16,7 +16,7 @@ function SidebarCategory({
dragging,
editing,
style,
borderColor = colors.border,
borderColor = theme.tableBorder,
isLast,
onDragChange,
onEditMonth,
Expand Down Expand Up @@ -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 && {
Expand Down
8 changes: 4 additions & 4 deletions packages/desktop-client/src/components/budget/SidebarGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -18,7 +18,7 @@ function SidebarGroup({
dragPreview,
innerRef,
style,
borderColor = colors.border,
borderColor = theme.tableBorder,
onEdit,
onSave,
onDelete,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions packages/desktop-client/src/components/budget/constants.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { type ReactNode, forwardRef } from 'react';

import { colors } from '../../style';
import { theme } from '../../style';

let externalLinkColors = {
purple: colors.p4,
blue: colors.b4,
purple: theme.pageTextPositive,
blue: theme.pageTextLink,
muted: 'inherit',
};
type ExternalLinkProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import CheveronDown from '../../icons/v1/CheveronDown';
import ArrowsSynchronize from '../../icons/v2/ArrowsSynchronize';
import CalendarIcon from '../../icons/v2/Calendar';
import Hyperlink2 from '../../icons/v2/Hyperlink2';
import { colors, styles, theme } from '../../style';
import { styles, theme } from '../../style';
import AccountAutocomplete from '../autocomplete/AccountAutocomplete';
import CategoryAutocomplete from '../autocomplete/CategoryAutocomplete';
import PayeeAutocomplete from '../autocomplete/PayeeAutocomplete';
Expand Down Expand Up @@ -416,14 +416,14 @@ function StatusCell({

let statusColor =
status === 'cleared'
? colors.g5
? theme.noticeText
: status === 'missed'
? colors.r6
? theme.errorText
: status === 'due'
? colors.y5
? theme.alt3WarningText
: selected
? colors.b7
: colors.n7;
? theme.altPageTextLink
: theme.pageTextSubdued;

function onSelect() {
if (isClearedField) {
Expand Down Expand Up @@ -1043,20 +1043,20 @@ const Transaction = memo(function Transaction(props) {
style={{
color:
notes === 'missed'
? colors.r6
? theme.errorText
: notes === 'due'
? colors.y4
? theme.alt3WarningText
: selected
? colors.b5
: colors.n6,
? theme.formLabelText
: theme.altTableText,
backgroundColor:
notes === 'missed'
? colors.r10
? theme.altErrorBackground
: notes === 'due'
? colors.y9
? theme.altWarningBackground
: selected
? colors.b8
: colors.n10,
? theme.formLabelBackground
: theme.alt2TableBackground,
margin: '0 5px',
padding: '3px 7px',
borderRadius: 4,
Expand Down
Loading

0 comments on commit 2f5914f

Please sign in to comment.