-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ (typescript) migrate parts of ImportTransactionModal to TS (#3570)
- Loading branch information
1 parent
79f640c
commit 23de23b
Showing
15 changed files
with
260 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletions
11
...ortTransactionsModal/MultiplierOption.jsx → ...ortTransactionsModal/MultiplierOption.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
packages/desktop-client/src/components/modals/ImportTransactionsModal/SelectField.jsx
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
packages/desktop-client/src/components/modals/ImportTransactionsModal/SelectField.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
|
||
import { type CSSProperties } from '../../../style'; | ||
import { Select } from '../../common/Select'; | ||
|
||
type SelectFieldProps = { | ||
style?: CSSProperties; | ||
options: string[]; | ||
value: null | string; | ||
onChange: (newValue: string) => void; | ||
hasHeaderRow: boolean; | ||
firstTransaction: Record<string, unknown>; | ||
}; | ||
|
||
export function SelectField({ | ||
style, | ||
options, | ||
value, | ||
onChange, | ||
hasHeaderRow, | ||
firstTransaction, | ||
}: SelectFieldProps) { | ||
return ( | ||
<Select | ||
options={[ | ||
['choose-field', 'Choose field...'], | ||
...options.map( | ||
option => | ||
[ | ||
option, | ||
hasHeaderRow | ||
? option | ||
: `Column ${parseInt(option) + 1} (${firstTransaction[option]})`, | ||
] as const, | ||
), | ||
]} | ||
value={value === null ? 'choose-field' : value} | ||
onChange={onChange} | ||
style={style} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.