diff --git a/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx b/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx index 7da1dc8fa7d..a50c3162fc2 100644 --- a/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx +++ b/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { SvgFilter } from '../../icons/v1'; -import { Button } from '../common/Button'; +import { Button } from '../common/Button2'; -export function CompactFiltersButton({ onClick }: { onClick: () => void }) { +export function CompactFiltersButton({ onPress }: { onPress: () => void }) { return ( - ); diff --git a/packages/desktop-client/src/components/filters/FilterExpression.tsx b/packages/desktop-client/src/components/filters/FilterExpression.tsx index 34df7694a76..11062c175ef 100644 --- a/packages/desktop-client/src/components/filters/FilterExpression.tsx +++ b/packages/desktop-client/src/components/filters/FilterExpression.tsx @@ -7,7 +7,7 @@ import { type RuleConditionEntity } from 'loot-core/src/types/models'; import { SvgDelete } from '../../icons/v0'; import { type CSSProperties, theme } from '../../style'; -import { Button } from '../common/Button'; +import { Button } from '../common/Button2'; import { Popover } from '../common/Popover'; import { Text } from '../common/Text'; import { View } from '../common/View'; @@ -59,9 +59,9 @@ export function FilterExpression({ > - ); diff --git a/packages/desktop-client/src/components/filters/FiltersMenu.jsx b/packages/desktop-client/src/components/filters/FiltersMenu.jsx index 8baacffe99e..30642fb7d81 100644 --- a/packages/desktop-client/src/components/filters/FiltersMenu.jsx +++ b/packages/desktop-client/src/components/filters/FiltersMenu.jsx @@ -1,4 +1,5 @@ import React, { useState, useRef, useEffect, useReducer } from 'react'; +import { Form } from 'react-aria-components'; import { useHotkeys } from 'react-hotkeys-hook'; import { Trans, useTranslation } from 'react-i18next'; @@ -24,7 +25,7 @@ import { titleFirst } from 'loot-core/src/shared/util'; import { useDateFormat } from '../../hooks/useDateFormat'; import { styles, theme } from '../../style'; -import { Button } from '../common/Button'; +import { Button } from '../common/Button2'; import { Menu } from '../common/Menu'; import { Popover } from '../common/Popover'; import { Select } from '../common/Select'; @@ -141,8 +142,8 @@ function ConfigureField({ { + isSelected={value === true} + onPress={() => { dispatch({ type: 'set-op', op: 'is' }); dispatch({ type: 'set-value', value: true }); }} @@ -150,8 +151,8 @@ function ConfigureField({ { + isSelected={value === false} + onPress={() => { dispatch({ type: 'set-op', op: 'is' }); dispatch({ type: 'set-value', value: false }); }} @@ -169,8 +170,8 @@ function ConfigureField({ dispatch({ type: 'set-op', op: currOp })} + isSelected={currOp === op} + onPress={() => dispatch({ type: 'set-op', op: currOp })} /> ))} @@ -184,8 +185,8 @@ function ConfigureField({ dispatch({ type: 'set-op', op: currOp })} + isSelected={currOp === op} + onPress={() => dispatch({ type: 'set-op', op: currOp })} /> ))} @@ -193,7 +194,17 @@ function ConfigureField({ )} -
+ { + e.preventDefault(); + onApply({ + field, + op, + value, + options: subfieldToOptions(field, subfield), + }); + }} + > {type !== 'boolean' && ( - - + ); } @@ -347,10 +347,10 @@ export function FilterButton({ onApply, compact, hover, exclude }) { > {compact ? ( dispatch({ type: 'select-field' })} + onPress={() => dispatch({ type: 'select-field' })} /> ) : ( - dispatch({ type: 'select-field' })} /> + dispatch({ type: 'select-field' })} /> )} diff --git a/packages/desktop-client/src/components/filters/NameFilter.tsx b/packages/desktop-client/src/components/filters/NameFilter.tsx index b8ad19ac0fa..77fb85132ac 100644 --- a/packages/desktop-client/src/components/filters/NameFilter.tsx +++ b/packages/desktop-client/src/components/filters/NameFilter.tsx @@ -1,8 +1,9 @@ import React, { useRef, useEffect } from 'react'; +import { Form } from 'react-aria-components'; import { useTranslation } from 'react-i18next'; import { theme } from '../../style'; -import { Button } from '../common/Button'; +import { Button } from '../common/Button2'; import { Input } from '../common/Input'; import { Stack } from '../common/Stack'; import { Text } from '../common/Text'; @@ -35,7 +36,12 @@ export function NameFilter({ return ( <> {menuItem !== 'update-filter' && ( -
+ { + e.preventDefault(); + onAddUpdate(); + }} + > - -
+ )} {err && ( diff --git a/packages/desktop-client/src/components/filters/OpButton.tsx b/packages/desktop-client/src/components/filters/OpButton.tsx index f061cb0c81a..606149badc4 100644 --- a/packages/desktop-client/src/components/filters/OpButton.tsx +++ b/packages/desktop-client/src/components/filters/OpButton.tsx @@ -1,34 +1,38 @@ import React from 'react'; +import { css } from 'glamor'; + import { friendlyOp } from 'loot-core/src/shared/rules'; import { type CSSProperties, theme } from '../../style'; -import { Button } from '../common/Button'; +import { Button } from '../common/Button2'; type OpButtonProps = { op: string; - selected: boolean; - onClick: () => void; + isSelected: boolean; + onPress: () => void; style?: CSSProperties; }; -export function OpButton({ op, selected, style, onClick }: OpButtonProps) { +export function OpButton({ op, isSelected, style, onPress }: OpButtonProps) { return ( diff --git a/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx b/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx index 3d4b3d701c0..bd42f61ead6 100644 --- a/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx +++ b/packages/desktop-client/src/components/filters/SavedFilterMenuButton.tsx @@ -6,7 +6,7 @@ import { type TransactionFilterEntity } from 'loot-core/types/models'; import { type RuleConditionEntity } from 'loot-core/types/models/rule'; import { SvgExpandArrow } from '../../icons/v0'; -import { Button } from '../common/Button'; +import { Button } from '../common/Button2'; import { Popover } from '../common/Popover'; import { Text } from '../common/Text'; import { View } from '../common/View'; @@ -163,9 +163,9 @@ export function SavedFilterMenuButton({ {conditions.length > 0 && (