diff --git a/packages/desktop-client/src/components/common.tsx b/packages/desktop-client/src/components/common.tsx index 7cbd456c15..a96458ec70 100644 --- a/packages/desktop-client/src/components/common.tsx +++ b/packages/desktop-client/src/components/common.tsx @@ -19,7 +19,7 @@ export { default as AlignedText } from './common/AlignedText'; export { default as Block } from './common/Block'; export { default as Button, ButtonWithLoading } from './common/Button'; export { default as Card } from './common/Card'; -export { default as CustomSelect } from './common/CustomSelect'; +export { default as Select } from './common/Select'; export { default as FormError } from './common/FormError'; export { default as HoverTarget } from './common/HoverTarget'; export { default as InitialFocus } from './common/InitialFocus'; diff --git a/packages/desktop-client/src/components/common/CustomSelect.tsx b/packages/desktop-client/src/components/common/Select.tsx similarity index 89% rename from packages/desktop-client/src/components/common/CustomSelect.tsx rename to packages/desktop-client/src/components/common/Select.tsx index 5f95acee3b..8f9b85e881 100644 --- a/packages/desktop-client/src/components/common/CustomSelect.tsx +++ b/packages/desktop-client/src/components/common/Select.tsx @@ -30,11 +30,11 @@ type CustomSelectProps = { * * @example * // Usage: - * // - * // + * // */ -export default function CustomSelect({ +export default function Select({ options, value, defaultLabel = '', diff --git a/packages/desktop-client/src/components/filters/FiltersMenu.js b/packages/desktop-client/src/components/filters/FiltersMenu.js index b63b2d6cc9..5680cb86f4 100644 --- a/packages/desktop-client/src/components/filters/FiltersMenu.js +++ b/packages/desktop-client/src/components/filters/FiltersMenu.js @@ -26,15 +26,7 @@ import { titleFirst } from 'loot-core/src/shared/util'; import DeleteIcon from '../../icons/v0/Delete'; import SettingsSliderAlternate from '../../icons/v2/SettingsSliderAlternate'; import { colors } from '../../style'; -import { - View, - Text, - Tooltip, - Stack, - Button, - Menu, - CustomSelect, -} from '../common'; +import { View, Text, Tooltip, Stack, Button, Menu, Select } from '../common'; import { Value } from '../ManageRules'; import GenericInput from '../util/GenericInput'; @@ -173,7 +165,7 @@ function ConfigureField({ {field === 'amount' || field === 'date' ? ( - - onChange('field', value)} @@ -106,7 +98,7 @@ export function OpSelect({ } return ( - [op, formatOp(op, type)])} value={value} onChange={value => onChange('op', value)} diff --git a/packages/desktop-client/src/components/modals/ImportTransactions.js b/packages/desktop-client/src/components/modals/ImportTransactions.js index 94fe6b0acc..cdec28e883 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactions.js +++ b/packages/desktop-client/src/components/modals/ImportTransactions.js @@ -17,7 +17,7 @@ import { Text, Stack, Modal, - CustomSelect, + Select, Input, Button, ButtonWithLoading, @@ -339,7 +339,7 @@ function SubLabel({ title }) { function SelectField({ width, style, options, value, onChange }) { return ( - [option, option]), @@ -372,7 +372,7 @@ function DateFormatSelect({ return ( - [ f.format, f.label.replace(/ /g, delimiter), @@ -890,7 +890,7 @@ function ImportTransactions({ {filetype === 'csv' && ( - - onChangeDates(...validateStart(allMonths, newValue, end)) @@ -100,7 +100,7 @@ function Header({ options={allMonths.map(({ name, pretty }) => [name, pretty])} /> to - onChangeDates(...validateEnd(allMonths, start, newValue)) diff --git a/packages/desktop-client/src/components/select/RecurringSchedulePicker.js b/packages/desktop-client/src/components/select/RecurringSchedulePicker.js index 816177c463..2f55333502 100644 --- a/packages/desktop-client/src/components/select/RecurringSchedulePicker.js +++ b/packages/desktop-client/src/components/select/RecurringSchedulePicker.js @@ -8,15 +8,7 @@ import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import AddIcon from '../../icons/v0/Add'; import SubtractIcon from '../../icons/v0/Subtract'; import { colors } from '../../style'; -import { - Button, - CustomSelect, - Input, - Tooltip, - View, - Text, - Stack, -} from '../common'; +import { Button, Select, Input, Tooltip, View, Text, Stack } from '../common'; import { useTooltip } from '../tooltips'; import DateSelect from './DateSelect'; @@ -199,7 +191,7 @@ function MonthlyPatterns({ config, dispatch }) { flexDirection: 'row', }} > - - updateField('interval', e.target.value)} defaultValue={config.interval || 1} /> - [opt.id, opt.name])} value={config.frequency} onChange={value => updateField('frequency', value)} diff --git a/packages/desktop-client/src/components/settings/Format.js b/packages/desktop-client/src/components/settings/Format.js index 5c8e844b70..009cc0930d 100644 --- a/packages/desktop-client/src/components/settings/Format.js +++ b/packages/desktop-client/src/components/settings/Format.js @@ -3,7 +3,7 @@ import React from 'react'; import { numberFormats } from 'loot-core/src/shared/util'; import tokens from '../../tokens'; -import { Button, CustomSelect, Text, View } from '../common'; +import { Button, Select, Text, View } from '../common'; import { useSidebar } from '../FloatableSidebar'; import { Checkbox } from '../forms'; @@ -87,7 +87,7 @@ export default function FormatSettings({ prefs, savePrefs }) { >